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
  • #7500
    Darryl Schmidt

    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
  • #7506
    Darryl Schmidt

    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.

    Jason Bobich

    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.

    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.

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

    Darryl Schmidt

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

    Darryl Schmidt

    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?

    Jason Bobich

    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.