Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to position the breadcrumb under the title:
Tagged: breadcrumb, Breakthrough Pro
- This topic has 8 replies, 4 voices, and was last updated 5 years, 9 months ago by Brad Dalton.
-
AuthorPosts
-
December 1, 2018 at 8:27 am #224757SupermanParticipant
I would like to move the breadcrumb to the position under the title. FOr instance, under the title on this page: https://www.sambuno.com/people-review-your-website-where-it-matters/
Screencast: https://www.useloom.com/share/75f1cb05d95741bb828139e1970ebe05
Where would I place the code below within the functions.php file in order to get it to show where I want it to show.
//* Reposition the breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );
view rawChild Theme: breakthrough
https://www.sambuno.com/people-review-your-website-where-it-matters/December 1, 2018 at 8:56 am #224758Victor FontModeratorThe title is displayed within the WordPress loop. Breadcrumbs are meant to be displayed outside of the loop. You're going to have some challenges that you need to understand by moving the breadcrumbs into the loop.
When you have an archive page or any page that displays multiple posts, the breadcrumbs will display after the title for every post. This will not look good. I think you should limit the display to single pages and posts only.
This will do it for you:
add_action('pre_get_posts', 'do_move_breadcrumbs'); function do_move_breadcrumbs() { if ( is_single() || is_page() ) { //* Reposition the breadcrumbs remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); add_action( 'genesis_before_entry_content', 'genesis_do_breadcrumbs' ); } }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 1, 2018 at 6:04 pm #224764SupermanParticipantVictor thanks.
I simply want to move show the breadcrumbs on the pages and posts and after pasting the code provided, there is no effect.
Please advise.
December 1, 2018 at 6:05 pm #224765Brad DaltonParticipantDecember 1, 2018 at 6:25 pm #224766SupermanParticipantThe instruction is not clear. Though here is a screencast of what I am looking to accomplish with the breadcrumbs
Screencast; https://www.useloom.com/share/5e53fb39498844fbbadd857221586a37
December 1, 2018 at 6:59 pm #224767AnitaCKeymasterI posted a response in Facebook but wanted to share it here too.
So the reason why it won't work is because the breadcrumb code is already included in the functions. Remove your code. Then look at Lines 211-213. You want to change line 213 to the preferred location.
// Move breadcrumbs to below header. remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );
Change it to this:
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_breadcrumbs', 15 );
Then adjust your CSS.
Look through your functions file and you will see all of these things. Then if you want to move them around, install the Genesis Visual Hook Guide which will help you position things where you want them to go.
Need help with customization or troubleshooting? Reach out to me.
December 1, 2018 at 8:57 pm #224770Brad DaltonParticipantDecember 1, 2018 at 9:24 pm #224771AnitaCKeymasterGenesis Sample does not include the breadcrumb code in the child theme. It's pulling the breadcrumbs from the framework. Breakthrough Pro has included the breadcrumb code on lines 211-213. So adding a new function at the bottom the way he was doing it would not work because of the priority. That's why I suggested he remove his code and change it on Line 213.
Need help with customization or troubleshooting? Reach out to me.
December 3, 2018 at 5:02 pm #224806Brad DaltonParticipant -
AuthorPosts
- The topic ‘How to position the breadcrumb under the title:’ is closed to new replies.