Tagged: posts
- This topic has 1 reply, 2 voices, and was last updated 9 years, 3 months ago by Sakin.
-
AuthorPosts
-
December 21, 2014 at 3:00 pm #49158alukaszewiczMember
Reading the forums I have been able to remove the dates by adding the below code to the Custom CSS Styles.
.entry-date { display: none; }
That works, but leaves this at the top of the post “Posted on by” and then the author. All I really want to do is now remove the “on” of “Posted on by” to just say “Posted by” and then the author name.
To do this I attempted to use Modify code from the functions.php and modify that in the Custom CSS Styles
function catchbox_posted_on() { printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date updated" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'catchbox' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'catchbox' ), get_the_author() ) ), get_the_author() ); }
Specifically I changed
<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark">
to
<span class="sep">Posted </span><a href="%1$s" title="%2$s" rel="bookmark">
This didn’t work it still reads as “Posted on by”
Could someone point me to the right piece of code to add to the custom style css
Example post from my site:
gettingstamped.com/2014/09/28/the-best-travel-camera-bag-for-a-dslr-camera
Thanks!
December 21, 2014 at 9:34 pm #49177SakinKeymaster@alukaszewicz: You shouldn’t edit any core theme file inside ‘catch-box’ directory. As all these changes will be reverted back to original when you update the theme. So, if you want to change any functions, then you need to first build child theme. Read this for child theme http://catchthemes.com/blog/create-child-theme-wordpress/, from here you can also download sample child theme. Then you can copy and paste the following code in your child theme functions.php file.
function catchbox_posted_on() { printf( __( '<span class="by-author">Posted by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'catchbox' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'catchbox' ), get_the_author() ) ), get_the_author() ); }
-
AuthorPosts
- The topic ‘Removing dates only from posts’ is closed to new replies.