Jump to content


Photo
- - - - -

Customizing custom logo for a specific page or template

logo php page_id branding

Best Answer Simon_P , 27 December 2012 - 06:22 PM

You need to use the WordPress function is_page() http://codex.wordpre...ference/is_page

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 joaoreis

joaoreis

    Advanced Member

  • Members
  • 30 posts
  • LocationPorto alegre
  • Framework Version:v2.3.8
  • Country: Country Flag

Posted 27 December 2012 - 06:18 PM

Hello! Friends,

 

 I would like to replace the custom logo only for some specific pages, is it possible to do?

 

 I've found a hook "pagelines_before_branding_icons", but i don't know if i'm using it right.

 

 Here is the code i added to the pagelines-customize/function.php

 

   function frontlogo(){

echo '<a id="39" class="plbrand mainlogo-link" title="InteSys" href="

Please Login or Register to see this Hidden Content

"><img class="mainlogo-img" alt="InteSys" src="image link here" />
</a>
';
// the page id is 39 and 222.
}

add_action( 'pagelines_before_branding_icons', 'frontlogo' );

 

 In this case the image is added on all pages and what i wanted to do is replace the current image by another.

 

 Any help?

 

Many thanks!



#2 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 27 December 2012 - 06:22 PM   Best Answer

You need to use the WordPress function is_page() 

Please Login or Register to see this Hidden Content


  • joaoreis likes this

#3 joaoreis

joaoreis

    Advanced Member

  • Members
  • 30 posts
  • LocationPorto alegre
  • Framework Version:v2.3.8
  • Country: Country Flag

Posted 02 January 2013 - 04:23 PM

 It worked! I've added the code you said on the php and also add this code on the css file ".page-id-39  #branding img.mainlogo-img {display:none}" and now it's working.

 

 Thanks a lot!







Also tagged with one or more of these keywords: logo, php, page_id, branding