[Support request] Page Headers on User Profile/Author Pages

Home Forums Support [Support request] Page Headers on User Profile/Author Pages

Home Forums Support Page Headers on User Profile/Author Pages

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #381377
    Xavier Verhoeven

    I love the way Page Headers can be applied to global locations, but I can’t figure out how I can add them to author pages (eg http://khq.dietdigital.com.au/our-people/amy-buckley/). This is set up using an author.php template – is there a way I can call the page header from the template?

    I want a Page Header that sits behind the nav area, so it’s not something I can easily hardcode the HTML for.

    Any pointers would be much appreciated, or if it’s something that can be added to the plugin, that would be even better!

    #381480
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Currently you would have to do something custom for this, but I love the idea. I’ve made note of it to add to the Page Headers add-on.

    Let me know if you need more info on the custom solution πŸ™‚

    #382035
    Xavier Verhoeven

    Thanks Tom. A tip on the best way to implement this would be great. Seems like I’d need to hack at a couple of files in the plugin to get it working, which wouldn’t be ideal.

    #382132
    Tom
    Lead Developer
    Lead Developer

    Currently you would have to build your own page header without the plugin, then hook it into the author page.

    Less than ideal – I’ll see if I can bake this into the next version (no promises) πŸ™‚

    #382213
    Xavier Verhoeven

    That would be awesome! I know it’s a bit of an edge case, but I feel like it makes as much sense as having global locations for post types – just that authors isn’t quite a post type.

    I’ll wait and see. If I need to implement before it’s there, I’ll just have to do it manually.

    Thanks again. I’m a big GP fan.

    #503863
    Katie Jones

    Hi all – +1 on this (and as always, +1 on how much I love this theme!). Has this been done yet, or any pointers to someone who did it?

    Thanks!

    #504259
    Tom
    Lead Developer
    Lead Developer

    This hasn’t been done yet, but will be soon.

    GPP 1.6 is close, and this might not make it in. However, there is a new filter meaning we can easily create a Page Header and place it anywhere with a simple conditional πŸ™‚

    #505063
    Katie Jones

    Sweet, good to know! Thanks, Tom!

    #505354
    Tom
    Lead Developer
    Lead Developer

    No problem! Ping me back in here once 1.6 is released and I’ll share the code πŸ™‚

    #505396
    Katie Jones

    Sweet, thanks! πŸ™‚

    #538863
    Colby

    Hello,
    Just used GP premium for the first time, on a new build. It’s really great, nice work.

    Is there a filter snippet anyone can share to place the page header in the aforementioned pages?

    thanks!

    #539180
    Leo
    Staff
    Customer Support

    Hi there,

    This should work with GPP1.6

    add_filter( 'generate_page_header_id', function( $id ) {
    	if ( is_author() ) {
    	 	return 17686; // ID of the Page Header to use.
    	}
      
      	return $id;
    } );
    #539615
    Colby

    Thanks Leo, i’ll give that a try!

    #539945
    Leo
    Staff
    Customer Support

    No problem!

    #540250
    Colby

    The snippet worked great, thanks!

    I ended up using it for bbpress also, i was able to assign the page header to the main pages for bbpress through the global locations in the admin, with the exception of the profile page of the BB user. So i adapted the snippet above as follows and it works (just posting here in case anyone else runs into the same scenario).

    Swapped “is_author()” with “is_bbpress()”

    add_filter( ‘generate_page_header_id’, function( $id ) {
    if ( is_bbpress() ) {
    return 17686; // ID of the Page Header to use.
    }

    return $id;
    } );

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.