Community Forums › Forums › Archived Forums › Design Tips and Tricks › Balance Theme: Swap Breadcrumbs with Title
- This topic has 10 replies, 2 voices, and was last updated 11 years, 1 month ago by csbeck.
-
AuthorPosts
-
March 13, 2013 at 12:10 pm #25896tylerkelleyMember
I'm using Simple Hooks and I am familiar with functions.php. I am looking for the best way to swap the breadcrumbs with a page or post title in the Balance theme. It just makes sense.
March 13, 2013 at 12:45 pm #25903csbeckMemberI guess I'm thick-sculled but I don't understand what you are asking. Your breadcrumbs look appropriate on this link. What do you want them to be instead of the page or post title?
Or do you mean you want the title on top and the breadcrumbs under the title?
Perhaps this will help:
http://my.studiopress.com/snippets/breadcrumbs/#reposition
Chris
March 13, 2013 at 1:37 pm #25922tylerkelleyMemberYes - I would like the actual title sit where the breadcrumbs are right now and put the breadcrumbs beneath the gray area. I think the breadcrumbs are way too prominent on each page. I will check out your link and see if that helps.
March 13, 2013 at 1:39 pm #25923tylerkelleyMemberI see that I can remove the breadcrumbs but in doing so I lose the full width gray background that looks so nice in this theme: Balance. Is there a way to just put the post title in that spot so I don't lose the gray bar? Hope this makes sense.
March 13, 2013 at 1:58 pm #25928csbeckMemberWell you could add a new div by using Genesis Simple Hooks and put a div above the inner section. Then style that div like the breadcrumb section is now styled. Then change the breadcrumb styling to something less prominent.
Were you able to still see the breadcrumbs but after the title of the page? That was the part that I didn't check to see if it actually worked.
March 13, 2013 at 4:47 pm #26068tylerkelleyMemberI'm beginning to think this is not possible or at least not very easy and that's why Studiopress did not do it. The problem occurs when trying to take the post title and remove it from the loop and into the area after the header.
March 13, 2013 at 5:03 pm #26073csbeckMemberLooks like you're almost there. Did you want it to look differently? Perhaps send a mockup of what you are hoping.
If you are close, how did you accomplish this? Did you use the Simple Hooks code from that sample post?
If you like the page title in that grey bar (the way it is now), then you could make a new div and put the entry-title within that div (do this in your Simple Hook code). Give the new div a style and make it have the grey background and keep it 100% wide. Then make the entry-title the same width of your inner div (960px) and set the margins to 0 auto with no background.
Let me know if that helps.
Chris
March 13, 2013 at 8:32 pm #26101tylerkelleyMemberI appreciate the assistance - I wish it were as simple as CSS. I'm using this code:
/** Reposition the Titles */
/*------------------------------------------------------------ */
# removes default title display
remove_action('genesis_post_title', 'genesis_do_post_title');
# adds action to header to check and output the different titles based on what is being viewed
add_action('get_header','canishowtitle');
function canishowtitle() {
if ( is_page() || is_single() ) { # check if page or single post
add_action('genesis_after_header', 'genesis_do_post_title');
# check if using the blog template that comes with most genesis themes
if ( is_page_template('page_blog.php') ) {
# add titles back to posts in the loop
add_action('genesis_post_title','genesis_do_post_title');
}
}
else if ( is_category() ) { #check if viewing a category
# add the category title
add_action('genesis_after_header', 'add_category_title' );
# add titles back to posts in the loop
add_action('genesis_post_title','genesis_do_post_title');
}
else if ( is_tag() ) {
# add the tag title
add_action('genesis_after_header', 'add_tag_title' );
# add titles back to posts in the loop
add_action('genesis_post_title','genesis_do_post_title');
}
else if ( is_archive() ) {
# add the archive title including if it is a date archive
add_action('genesis_after_header', 'add_archive_title' );
# add titles back to posts in the loop
add_action('genesis_post_title','genesis_do_post_title');
}
else if ( ! is_home() ) {
# if all else fails, display it anyways, except on the home page
add_action('genesis_after_header', 'genesis_do_post_title');
}
}
function add_category_title() {
# display the current category title
echo '<h1 class="entry-title">' . single_cat_title( '', false ) . '</h1>';
}
function add_tag_title() {
# display the current tag archive title
echo '<h1 class="entry-title">' . single_tag_title( '', false ) . '</h1>';
}
function add_archive_title() {
# display the current date or blog archives title
if ( is_day() ) { # day archive
echo '<h1 class="entry-title">' . get_the_date() . '</h1>';
}
elseif ( is_month() ) { #month archive
echo '<h1 class="entry-title">' . get_the_date( 'F Y' ) . '</h1>';
}
elseif ( is_year() ) { #year archive
echo '<h1 class="entry-title">' . get_the_date( 'Y' ) . '</h1>';
}
else { # general archive default
echo '<h1 class="entry-title">Blog Archives</h1>';
}
}
/*------------------------------------------------------------ */Unfortunately, this does not cover the bbpress pages like http://aaatennis.org/forums/
It should say "Player Forums" not "Blog Archives"
March 14, 2013 at 7:40 am #26161csbeckMemberYeah, that's a lot.
OK, so we can get rid of the lower "Player Forums" now using CSS - just create a new style called:
#inner .wrap #content-sidebar-wrap #content. h2.entry-title and set display: none;
One of your last lines - the last else says to name the general archive default to Blog Archives. If you change that to Player Forums, won't that wrap it up?
March 14, 2013 at 8:45 am #26175tylerkelleyMemberThanks for all your help. Looks good.
March 14, 2013 at 9:17 am #26186csbeckMemberGreat! You're welcome.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.