This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Custom header on a specific page

  • Creator
    Topic
  • #7500
    Darryl Schmidt
    Participant

    I would like to specify a different logo and social media links on a specific page. How might I go about this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #7506
    Darryl Schmidt
    Participant

    So, here is what I’ve done so far.

    Created an option for an alternate logo upload as follows:

    $option = array(
        'name'  => 'Lounge Logo',
        'desc'  => 'This is the logo that will only be displayed on the Lounge page. Recommended height: 150 pixels.',
        'id'    => 'lounge_logo',
        'type'  => 'upload'
    );
    themeblvd_add_option( 'layout', 'header', 'lounge_logo', $option );

    I know that I can now use themeblvd_get_option( 'lounge_logo' ): to place the alternate logo, but where? Do I need to use a hook?

    I would also like to add a second set of social media options that mimic the included set, but for this specific page and intercept the function on that specific page to use the alternate social links instead of the defaults.

    #7516
    Jason Bobich
    Keymaster

    Hello Darryl,

    There are really a lot of approaches you could take here. I’d start by checking out the actions map and just deciding how you want to tackle it. There’s really no specific right answer here.

    http://dev.themeblvd.com/tutorial/primary-framework-action-hooks/

    A possible approach — From checking out the actions map page, you can see the theme has a default logo function called themeblvd_header_logo_default that’s hooked to the action “themeblvd_header_logo”. So one thing you can do is just get rid of that and create your own logo function. You’d unhook it, and hook in your own function. In your own function, you’ll want to take advantage of WordPress’s handy conditionals to do different things for whatever pages.

    function my_header_logo(){
    	if( is_page( 'foo' ) ) {
    		// your logo for foo page
    	else if( is_page( 'bar' ) ) {
    		// your logo for bar page
    	} else {
    		// ... your default logo
    	}
    }
    remove_action('themeblvd_header_logo', 'themeblvd_header_logo_default');
    add_action('themeblvd_header_logo', 'my_header_logo');

    Unless you really have a need to control the logo from your theme options, you could even remove that option you added and the default logo option, as well.

    http://dev.themeblvd.com/tutorial/add-remove-edit-theme-option/#themeblvd_remove_option

    http://dev.themeblvd.com/tutorial/default-framework-options/

    … Then you’d simplify things down to just outputting the markup for your logo within whatever function you hook. Less moving parts.

    #7573
    Darryl Schmidt
    Participant

    Thank you, Jason! I appreciate the help. I’m going to go with your suggestion to alter the logo function.

    #7578
    Darryl Schmidt
    Participant

    I would also like to have different links on the social media buttons on the same specific page as the one with the different logo. I looked around at the action hooks you provided, but it seems that part of it is a little bit more involved. Can you provide a little insight?

    #7579
    Jason Bobich
    Keymaster

    How are you implementing social icons? You’re just putting markup in the header for the icons manually? Are you using themeblvd_contact_bar function? Or you haven’t done anything with social icons, and don’t even know where to start? 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.