-
Author
-
May 23, 2014 at 20:10 #18657PatagoniaParticipant
Hi, one specific and one general question:
1- I moved the post-meta and want to take out the time and author from the post-meta box, and maybe also either tags or categories. This is a regular feature in many other themes, you can normally choose which parts you want, so consider this a feature request. I found some declarations in functions.php, is that where the meta items are defined?
How do I change that function? Do I just add the same function to my child’s functions.php, and then delete parts? Which parts do I need to take out?
2- How do I make changes to the theme-functions.php? Will adding functions to the child’s functions.php be enough, or do I need to make a lib folder etc?
Thanks!
May 24, 2014 at 04:22 #18694PatagoniaParticipantI solved 1) with a combination of function and CSS, not sure if this is optimal, but seems to work:
– To hide the time (the time will still pop-up as alt text when hovering over the date):
Add to child theme Style.Css:COPY CODEarticle .article-meta .post-meta a.post-time:after { content: none;
To remove author, I added the entire function to child theme functions.php and deleted the author part:
COPY CODEfunction kleo_entry_meta($echo=true, $att=array()) { $meta_list = array(); // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'kleo_framework' ) ); // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'kleo_framework' ) ); $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark" class="post-time"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $meta_list[] = '<small>'.$date.'</small>'; $cat_tag = array(); if ( $categories_list ) { $cat_tag[] = $categories_list; } if ($tag_list) { $cat_tag[] = $tag_list; } if (!empty($cat_tag)) { $meta_list[] = '<small class="meta-category">'.implode(", ",$cat_tag).'</small>'; } //comments if (!isset($att['comments']) || (isset($att['comments']) && $att['comments'] !== false)) { $meta_list[] = '<small class="meta-comment-count"><a href="'. get_permalink().'#comments"> '.get_comments_number().' <i class="icon-chat-1 hover-tip" data-original-title="'.sprintf( _n( 'This article has one comment', 'This article has %1$s comments', get_comments_number(), 'kleo_framework' ),number_format_i18n( get_comments_number() ) ).'" data-toggle="tooltip" data-placement="top"></i></a></small>'; } if ($echo) { echo implode(", ", $meta_list); } else { return implode(", ", $meta_list); } }
And made a lot of CSS and template changes as well.
Still it would be a bit more userfriendly to have the option in the backend about which meta parts (not) to show.
I would appreciate advice re question #2 above.
Thanks!
May 28, 2014 at 10:34 #18947AbeKeymasterHi, Yes, copying the function kleo_entry_meta to your child theme functions.php is the right way to override default theme function. This can be done with every function you see in the theme that is wrapped in a conditional if ( !function_existst(‘function_name’) ) {}
That is a good idea to select which meta to appear. I wrote it down to keep it in mind
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.