Tagged: x
-
AuthorPosts
-
March 23, 2016 at 2:22 pm #849952
I’m using the Ethos stack with most recent posts on my homepage. I’ve turned post meta on, but I’d like to remove the author and date from regular posts and the date from indexed posts. Any suggestions? Also, do you know how I can add a “read more” link to my post excerpts? Lastly, I’d like to remove the words “Permalink to” when you hover over post titles. Not sure if it’ll help, but I do have a child theme set up.
Any help would be greatly appreciated!
Thanks
March 23, 2016 at 6:45 pm #850337Hi there,
Thanks for posting in.
Please add this CSS to Admin > Appearance > Customizer > Custom > CSS
.single-post .p-meta > span:nth-child(2), .blog .p-meta > span:nth-child(2){ display: none; }
Then add this code to Admin > Appearance > Customizer > Custom > Javascript
jQuery( function($) { var link = $('.single-post .p-meta > span:first-child a'); $('.single-post .p-meta > span:first-child').html('In ').append( link ); $('.blo .entry-title a').attr('title',''); } );
As for the “read more”, please add this code to your child theme’s functions.php
function x_excerpt_string( $more ) { $stack = x_get_stack(); if ( $stack == 'integrity' ) { return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>'; } else { return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>'; } } add_filter( 'excerpt_more', 'x_excerpt_string' );
Hope this helps.
March 23, 2016 at 6:55 pm #850353Thanks for getting back to me. When I added the first code to Custom CSS, it removed the dates from regular posts, but the author is still there and it didn’t remove the date from the indexed posts. When I added the code to Custom Javascript, I didn’t notice anything change. Author, date, and “Permalink to” all still there.
March 23, 2016 at 8:06 pm #850430Hello There,
After doing the changes, always remember to clear all caches since you have installed a caching plugin, W3 Total Cache before testing your site so that the code from the latest changes will always in use. This will help you to avoid any potential errors and see the changes immediately to take place on the front end. Caching plugins are best to turn on only when you’ve finished building the site.
Please let us know how it goes.
March 23, 2016 at 8:32 pm #850467Ok, thanks for the advice. I only enabled the Cache plugin because it was suggested for another issue I was having with Cornerstone. After emptying the caches, the only change the occurred was the date being removed from regular posts.
March 23, 2016 at 9:40 pm #850522Hi There,
Please check the first attached screenshot. It is your blog index page. The date was hidden already.
Screenshot #2 shows that author and date were hidden too.Please do update above javascript to this:
jQuery( function($) { var link = $('.single-post .p-meta > span:first-child a'); $('.single-post .p-meta > span:first-child').html('In ').append( link ); $('.blog .entry-title a').attr('title',''); } );
I’ve changed this .blo to this .blog.
Hope this helps.
-
AuthorPosts