Community Forums › Forums › Archived Forums › Design Tips and Tricks › Eleven40 Page Title widget customization
Tagged: page title widget
- This topic has 2 replies, 2 voices, and was last updated 10 years, 7 months ago by afinevo.
-
AuthorPosts
-
September 3, 2013 at 12:42 pm #60474afinevoMember
Hey everyone. I'm currently using the elevn40 theme (not the pro version) and I am using the Page Title widget for banner advertising and of course this shows on every page and post. Since I am in the process of renewing my home page, is there a way that I can use this widget differently for the home page. I would like to use text for the widget on my home page and then use it for banner advertising or however I see fit on other pages and posts.
Thanks in advance!
http://allgaragefloors.comSeptember 4, 2013 at 9:35 am #60638cruisegleMemberHi
It is a while since I have done this and am sure there is an easier way to do it. However what you could do is remove this from the function file: (Please note you don't have to remove it)
/** Add the page title section */
add_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' );
function eleven40_page_title() {
genesis_widget_area( 'page-title', array(
'before' => '<div class="page-title widget-area">',
) );
}Then go to simple hooks and check the button under "Content Hooks" to allow for php for the genesis_before_content_sidebar_wrap hook.
In the hook box itself you can add something like this for individual pages.
<div class="page-title widget-area">
<?php if (is_home()) { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for Home page') ) : ?>
<?php endif; ?>
<?php } elseif (is_page('epoxy-flooring')) { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for this page') ) : ?>
<?php endif; ?>
<?php } elseif (is_page('garage-floor-tiles')) { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for this page') ) : ?>
<?php endif; ?>
<?php } ?>
</div>Go to Simple Sidebar plugin and add the name of the Sidebars that you have added above; technically you might want to add the sidebars first.
If it is category based use this:
<div class="page-title widget-area">
<?php if (is_home()) { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for Home page') ) : ?>
<?php endif; ?>
<?php } elseif (is_category('mat-coverings')) { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for this category') ) : ?>
<?php endif; ?>
<?php } elseif (is_category('cleaning-concrete-repair')) { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for this category') ) : ?>
<?php endif; ?>
<?php } ?>
</div>You could add a universal sidebar that covers every page bar the home or any other page; this would look like this:
<div class="page-title widget-area">
<?php if (is_home()) { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for Home page') ) : ?>
<?php endif; ?>
<?php } else { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name of Sidebar for the universal one') ) : ?>
<?php endif; ?>
<?php } ?>
</div>If using a custom front page use is_front_page instead of is_home
Don't forget that you can mix and match pages and categories etc using elseif but be aware of the hierarchy of the content. By that I mean if you have something in a category and a child of that category and you want the child category to behave differently from the main category then the elseif for this child category must come before the elseif of the main category etc.
Hope this helps and sorry i my coding is wrong!
I’m an SEO Consultant by trade; who is getting by; just!
September 4, 2013 at 3:52 pm #60718afinevoMemberWow.... that's more than what I had bargained for. I will try it out on my test site to see how it works.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.