StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have -- and this forum will be removed on July 1st, 2013.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-14-2011, 07:13 AM
CharlesClarkson's Avatar
CharlesClarkson CharlesClarkson is offline
Community Moderator
 
Join Date: Feb 2009
Location: Stephenville, TX, USA
Posts: 11,356
Lightbulb

Quote:
Originally Posted by mckinleydenali View Post
How can I remove any content from the header section and replace it with a PHP script which loads banners?
Almost everything in Genesis is inserted using a WordPress Action. To remove anything from a page requires:
  1. Finding out how it got there and
  2. Reversing that action.
It the same thing no matter which section you are working on, including the page header.

Searching the Genesis code for the markup in the page source (<div id="header">) you'll found this on the bottom of the genesis/lib/structure/header.php Genesis theme file:
PHP Code:
add_action'genesis_header''genesis_do_header' ); 
Suspecting it might be adding the Genesis header, I used this in the functions.php child theme file on a test site:
PHP Code:
remove_action'genesis_header''genesis_do_header' ); 
After testing to make sure that removed the header, test to see if a custom function will put it back.
PHP Code:
remove_action'genesis_header''genesis_do_header' );
add_action'genesis_header''child_do_header' );
function 
child_do_header() {
    
genesis_do_header();

It does. Now change it to add your custom code:
PHP Code:
remove_action'genesis_header''genesis_do_header' );
add_action'genesis_header''child_do_header' );
/**
 * Add custom header to pages.
 */
function child_do_header() {
    
// Add custom header code here.

__________________
Charles "Rubeus Hagrid" Clarkson
StudioPress on Facebook

I'm not really a smart person. I just play one on the Internet.

Please use the HTML or PHP tags for pasting code.
Please make your links click-able: this_is_annoying.com
http://this_is_not_annoying.com.
 

Tags
banner ads, header

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing header banner and favicon qleapent General Discussion 7 12-13-2010 07:43 AM
Replacing header text with banner twanag General Discussion 9 05-25-2009 02:11 PM
Removing Banner Ad and replacing header idtguru General Discussion 2 04-06-2009 06:38 PM


All times are GMT -5. The time now is 05:37 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.