Community Forums › Forums › Archived Forums › General Discussion › Modifying breadcrumb names on Author Pro
Tagged: Author Pro, breadcrumbs, library
- This topic has 9 replies, 3 voices, and was last updated 9 years, 4 months ago by
carasmo.
-
AuthorPosts
-
October 28, 2015 at 10:06 am #169362
ratsnacks
MemberHi
I mailed support who suggested putting this out here:
On http://andrewgmarshall.com/books/ how to Remove "Archives for Library" and display "Bookstore" instead?
I was given http://wpsites.net/web-design/change-breadcrumbs-in-genesis/ which gets close but not precisely what I want, and the plugin by Nick looks abandoned so I don't want to install it.
Thanks
http://andrewgmarshall.com/books/November 3, 2015 at 10:32 am #170004ratsnacks
MemberBump 🙂
November 11, 2015 at 12:47 pm #170786ratsnacks
MemberLast hopeful bump
November 11, 2015 at 1:23 pm #170789Porter
ParticipantI really have no idea how to change it, even with a css hack-job. There's no selector for that piece of text, it's just on the page, no span, no class, not even just a p tag, nothing.
What are you using to generate those breadcrumbs? I would install Yoast SEO (almost a must-have for any site anyway), and use those breadcrumbs. From there, I might be able to write some css that can change it specifically for that archive.
November 12, 2015 at 5:55 am #170840ratsnacks
MemberHi Porter
Thanks - this was helpful. I was simply using the default Author Pro theme breadcrumbs, but had Yoast installed so activated the Yoast breadcrumbs.
This meant I could remove the "Archives for" part with ease.
The remaining task is changing the reference to "Library" in all the breadcrumbs to "Bookstore". I am guessing this is buried somewhere deep in the theme code?
A final thing is that Yoast pumps out the full post title e.g. http://andrewgmarshall.com/book/i-cant-get-over-my-partners-affair-50-questions-about-recovering-from-extreme-betrayal-and-the-long-term-impact-of-infidelity/. Without editing the post title itself, is there a way to show shortened versions (like in the main nav menu dropdown links)?
Thanks!
November 12, 2015 at 9:35 am #170859carasmo
ParticipantIt's not buried in the theme code, it's part of WordPress itself. If your slug is Library then it will display as Library. Change the words with jQuery put it after the doc ready but before the closing in your particular theme's main.js or global.js file.
$('.breadcrumb').each(function() { var text = $(this).text(); $(this).text(text.replace('You are here:', '')); //Replaces 'You are here:' with nothing var textNext = $(this).text(); $(this).text(textNext.replace('Library', 'Bookstore')); //Replaces instances of Library with Bookstore });
November 12, 2015 at 9:44 am #170861ratsnacks
MemberHi
Thanks, again very helpful. Before I try this can I clarify - where you typed:
"Change the words with jQuery put it after the doc ready but before the closing"
Should that instructions have some semi-colons or brackets?
Thanks!
November 12, 2015 at 9:57 am #170863carasmo
ParticipantNo that is the code to insert. See below for an example using your global.js file and where to insert.
After you make changes to css or js, clear your cache.
jQuery(function( $ ){ // Add opacity class to site header if( $( document ).scrollTop() > 0 ){ $( '.site-header' ).addClass( 'shrink' ); $( '.nav-secondary' ).addClass( 'shrink' ); } $( document ).on('scroll', function(){ if ( $( document ).scrollTop() > 0 ){ $( '.site-header' ).addClass( 'shrink' ); $( '.nav-secondary' ).addClass( 'shrink' ); } else { $( '.site-header' ).removeClass( 'shrink' ); $( '.nav-secondary' ).removeClass( 'shrink' ); } }); // Add class for tertiary menu $(window).scroll(function() { var distanceFromTop = $(document).scrollTop(); if (distanceFromTop >= $( '.front-page-1' ).height() + 40 ) { $( '.nav-secondary' ).addClass( 'fixed' ); } else { $( '.nav-secondary' ).removeClass( 'fixed' ); } }); $( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu' ).addClass( 'responsive-menu' ).before( '<div class="responsive-menu-icon"></div>' ); $( '.responsive-menu-icon' ).click(function(){ $(this).next( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu' ).slideToggle(); }); $( window ).resize(function(){ if ( window.innerWidth > 800 ) { $( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu, nav .sub-menu' ).removeAttr( 'style' ); $( '.responsive-menu > .menu-item' ).removeClass( 'menu-open' ); } }); $( '.responsive-menu > .menu-item' ).click(function(event){ if ( event.target !== this ) return; $(this).find( '.sub-menu:first' ).slideToggle(function() { $(this).parent().toggleClass( 'menu-open' ); }); }); /*---------- text replace -------------*/ $('.breadcrumb').each(function() { var text = $(this).text(); $(this).text(text.replace('You are here:', '')); //Replaces 'You are here:' with nothing var textNext = $(this).text(); $(this).text(textNext.replace('Library', 'Bookstore')); //Replaces instances of Library with Bookstore }); // end text replace }); // the end of your ready function
November 12, 2015 at 10:00 am #170866ratsnacks
MemberExcellent, that is great, I will try. Thanks for your time!
November 12, 2015 at 10:00 am #170867carasmo
ParticipantIf you view code instructions via email then you may get unwanted characters that will mess up your site. Use the pre code in the box in the post itself.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.