About Sridhar Katakam
I am an independent WordPress web consultant with 10 years of experience in WordPress theme installation, customization, administration, maintenance, support, documentation, troubleshooting and PSD/design to WP.
Genesis and WordPress Tutorials
Session expired
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.
Worked like a charm. Between your helpful notes and looking at Brad’s article to determine how to add a class to my div, I was able to make this work on the site-tagline-left element instead of the right. Now I have the ability to modify the call to action on every page.
Thank you very much.
John
John, I am trying to follow your code for custom text on the left vs the right. Problem is I don’t see a custom field to input text. Can you please advise?
Sridhar,
On this topic but taking it one step further. I’ve been having trouble with my tagline spacing on the homepage because I replaced the backstretch with an image. So now the 600px top padding is too much. If I shorten it, the tagline on all other pages conflicts with the header. I tried CSS to test if the element site-tagline follows the home-image vs the header but since there is no parent selector in CSS, I failed. So I tried php where I added a section If is home and then put a class in the div. I think this is the right logic but my syntax only broke the page. The idea is once I have a class selector on the items, I can add or subtract padding. An alternate would be to work one level high on the whole tagline and have a home tagline and a page tagline.
Can you advise me on syntax? Here is the logic I’m thinking of.
If is home – print site description and site-tagline right but make the div home-tagline
else
if is page – print the custom fields unless there isn’t one defined for that page
then
print site description and site-tagline right.
My code that WORKED following your tutorial and without the testing for home is this:
//* Add the site tagline section
add_action( ‘genesis_after_header’, ‘minimum_site_tagline’ );
function minimum_site_tagline() {
printf( ”, genesis_attr( ‘site-tagline’ ) );
genesis_structural_wrap( ‘site-tagline’ );
printf( ”, genesis_attr( ‘site-tagline-left’ ) );
if ( is_page() && genesis_get_custom_field(‘custom_site_tagline_left_content’) ) :
echo ”. genesis_get_custom_field(‘custom_site_tagline_left_content’).”;
else :
printf( ‘%s’, genesis_attr( ‘site-description’ ), esc_html( get_bloginfo( ‘description’ ) ) );
endif;
echo ”;
printf( ”, genesis_attr( ‘site-tagline-right’ ) );
genesis_widget_area( ‘site-tagline-right’ );
echo ”;
genesis_structural_wrap( ‘site-tagline’, ‘close’ );
echo ”;
}
My broken attempt to add the home page test is this:
function minimum_site_tagline() {
printf( ”, genesis_attr( ‘site-tagline’ ) );
genesis_structural_wrap( ‘site-tagline’ );
printf( ”, genesis_attr( ‘site-tagline-left’ ) );
if ( is_home() )
printf( ”, genesis_attr( ‘site-tagline-left’ ) );
printf( ‘%s’, genesis_attr( ‘site-description’ ), esc_html( get_bloginfo( ‘description’ ) ) );
elseif ( is_page() && genesis_get_custom_field(‘custom_site_tagline_left_content’) ) :
echo ”. genesis_get_custom_field(‘custom_site_tagline_left_content’).”;
else :
printf( ‘%s’, genesis_attr( ‘site-description’ ), esc_html( get_bloginfo( ‘description’ ) ) );
endif;
echo ”;
printf( ”, genesis_attr( ‘site-tagline-right’ ) );
genesis_widget_area( ‘site-tagline-right’ );
echo ”;
genesis_structural_wrap( ‘site-tagline’, ‘close’ );
echo ”;
}
any thoughts?
John
Sridhar,
You can delete the last post. It turns out that there is a custom class defined on the front-page.php that allows for the addition of .home in the css to indicate different styling for homepage elements. Thus .site-tagline can be called .home .site-tagline and the change only impacts home page. This all came from Nick at Studio Press and it works. So all of my messing around was unnecessary. Your solution worked great and the ability to modify home page layout solves my need perfectly.
John
Hello, I am wondering if you know how to make the site-tagline-left automatically show the page title of the page you are currently on. Is this hard to achieve?
Here: http://www.sridharkatakam.com/show-pagepost-title-site-tagline-left-area-minimum-pro/
Thanks a lot! Thanks for the info, great blog by the way some amazing content on here!
Worked great, except I had to change the editor in the custom field to be able to use the genesis CTA button. Keep up the good work. You just saved me from having to go to a wordpress multisite to achieve what I wanted.
Hi,
what if I want to change every posts also (not just pages)?
Thanks for this great site!