WordPress.org

Forums

Customizr
[resolved] I cannot find option to modify my post excerpts (16 posts)

  1. Stephen Myall
    Member
    Posted 1 year ago #

    I have been using customizr for 4 days now and really love it however I am finding difficult to find the answer I want in the existing Q&As . Im sure that will come with time but here is what I would like to accomplish with my post exceprts. ref: http://www.reboot2elementary.com/

    [ Moderator note: careful when adding links to posts here. Fixed. ]

    How do I add "this post was created in [category] on [date] by[author] under the post titles in the excerpt ? (The same line I want is under the post title when you open it)

    How do I stop the excerpt post title being a link to the post and add a "read more" or "continue reading" button at the bottom. (I can find where to change the text but I cant find how to enable it)

    Is it possible to add a static title above all the posts like "latest posts"?

    Finally, ref: featured images. How do I remove that dynamic circle thing? I want to use my own (non-dynamic) icons as featured images. What is the maximun size permitted?.

    I apologize for multiple questions in the one post and I am happy to separate them out in different questions. Thank you in advance, your help to date has been fantastic.

    Stephen

  2. bravokeyl
    Member
    Posted 1 year ago #

    It takes a while ..go on read.
    Create a child theme and create a folder parts in child theme
    1)Currently it is

    This entry was posted in category and tagged tags on date by author.

    if you want to change as above
    copy the class-content-post_metas.php in parts folder of parent theme and paste it in the child theme go to lines 76-82 where it says

    if ( $tag_list ) {
                    $utility_text   = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                    } elseif ( $categories_list ) {
                    $utility_text   = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                    } else {
                    $utility_text   = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                }

    those are the culprits change them to your wish. like you asked

    if ( $tag_list ) {
                    $utility_text   = __( 'This post was created in %1$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                    } elseif ( $categories_list ) {
                    $utility_text   = __( 'This post was created in %1$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                    } else {
                    $utility_text   = __( 'This post was created in %1$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                }

    2) check this
    http://codex.wordpress.org/Function_Reference/the_excerpt#Make_the_.22read_more.22_link_to_the_post

    To do that create a new file functions.php(be careful!) in child theme and add

    function new_excerpt_more( $more ) {
    	return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">   Read More</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );

    Don't want to link title to post then, add copy the file class-content-post_list.php and add it to the child theme got to lines 113 -120 where its says

    if ((get_the_title() != null)) {
                          printf(
                              '<h2 class="entry-title format-icon">%1$s %2$s</h2>' ,
                              '<a href="'.get_permalink().'" title="'.esc_attr( sprintf( __( 'Permalink to %s' , 'customizr' ), the_title_attribute( 'echo=0' ) ) ).'" rel="bookmark">'.((get_the_title() == null) ? __( '{no title} Read the post ยป' , 'customizr' ):get_the_title()).'</a>' ,
                              //check if comments are opened AND if there are comments to display
                              (comments_open() && get_comments_number() != 0) ? '<span class="comments-link"><span '.$style.' class="fs1 icon-bubble"></span><span class="inner">'.get_comments_number().'</span></span>' : ''
                          );
                      }

    and change it to

    if ((get_the_title() != null)) {
                          printf(
                              '<h2 class="entry-title format-icon">%1$s %2$s</h2>' ,
                              get_the_title() ,
                              //check if comments are opened AND if there are comments to display
                              (comments_open() && get_comments_number() != 0) ? '<span class="comments-link"><span '.$style.' class="fs1 icon-bubble"></span><span class="inner">'.get_comments_number().'</span></span>' : ''
                          );
                      }

    3)It is possible..copy the index.php file and paste it in child theme
    go to line 21 where it says
    <div id="content" class="<?php echo tc__f( '__screen_layout' , tc__f ( '__ID' ) , 'class' ) ?> article-container">

    just below that add
    <h2>Latest Posts </h2>

    4)You can set featured images while writing the posts ..if it isn't there then theme checks for images uploaded to the post and displays it.Those circles are just styles applied to it.

    Do it carefully if you get any error just revert back to the parent theme.

  3. Stephen Myall
    Member
    Posted 1 year ago #

    I think I was spoilt when using the WEAVER 11 theme as everything was Gui.

    I need to read these instructions carefully and find the files you are refering. I been in my hosted file mannager but couldnt find them.

  4. Stephen Myall
    Member
    Posted 1 year ago #

    My site:
    I am working through these today. Its been a big learning curve but well worth the effort/ Thanks so far, here is an update

    #1 Worked on the post itself however it did not add the date/author string to under the excerpt title (this was my original request)

    #2 Creating the functions.php file in root and pasting the code did not work for me. I cannot execute part 2 of #2 until I get this sorted

    I will try the other instructions now

  5. Stephen Myall
    Member
    Posted 1 year ago #

    #3 Worked and put "latest posts" above" my excerpts as I wanted, However it also put the same "latest posts" above the header of every open post even older posts. I need to remove this one.

    #4 Your response is ambiguous to me "do what carefully"? I know how to add featured images to each post but i want to remove the dynamic "circle styles"

    This ihas been a big learning for me today and thank you for all your help I feel much more comfortable making changings in customizr and my child theme.

  6. bravokeyl
    Member
    Posted 1 year ago #

    #1 It seems you didn't add the code correctly.

  7. bravokeyl
    Member
    Posted 1 year ago #

    #3 use the following conditional instead of <h2>Latest Posts </h2>

    <?php if(!is_singular()) : ?> <h2>Latest Posts </h2> <?php endif;?>

    #4 what i mean is, whenever you are editing in functions.php be careful because even if there is a little extra quote it gives a parse error.

  8. bravokeyl
    Member
    Posted 1 year ago #

    #1 Got it.As you are using home page for blog posts it is not displaying category ,author,date.

    To get that on home page copy class-content-post_list.php (if you haven't) into the child theme
    go to lines 123-127 where it says

    <?php //meta not displayed on home page, only in archive or search pages
                          if ( !tc__f('__is_home') ) {
                              do_action( '__post_metas' );
                          }
                      ?>

    change that to

    <?php 
    
       do_action( '__post_metas' );
      ?>

    4)No circles for thumbnails:
    GO to line 326 in class-content-post_list.php where it says
    $html .= '<a class="round-div '.$no_effect_class.'" href="'.get_permalink( get_the_ID() ).'" title="'.get_the_title( get_the_ID()).'"></a>';

    Change that to
    $html .= '<a '.$no_effect_class.'" href="'.get_permalink( get_the_ID() ).'" title="'.get_the_title( get_the_ID()).'"></a>';

  9. Stephen Myall
    Member
    Posted 1 year ago #

    Ignore this:
    #1 This what I pasted and it still does not work (I tried again). Do I need to change the parts of the string where it says customizr to mt child name to make it work?

    if ( $tag_list ) {
                    $utility_text   = __( 'This post was created in %1$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                    } elseif ( $categories_list ) {
                    $utility_text   = __( 'This post was created in %1$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                    } else {
                    $utility_text   = __( 'This post was created in %1$s on %3$s<span class="by-author"> by %4$s</span>.' , 'customizr' );
                }
  10. bravokeyl
    Member
    Posted 1 year ago #

  11. Stephen Myall
    Member
    Posted 1 year ago #

    A big thank you #1, 3 &4 are now fixed but the first part of the solution to #2 produced an error

    Recap: #2 is put a "read more" link or button below each post extract on the home page.

    I created the functions.php in my child theme as suggested and pasted the code in

    function new_excerpt_more( $more ) { return ' Read More'; } add_filter( 'excerpt_more', 'new_excerpt_more' );

  12. bravokeyl
    Member
    Posted 1 year ago #

    Oh! you forgot to wrap that in php , add the following instead of that

    <?php
    function new_excerpt_more( $more ) {
    	return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">   Read More</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' ); ?>
  13. Stephen Myall
    Member
    Posted 1 year ago #

    hmmm! No error message this time but still no "read more" link under each extract.

  14. bravokeyl
    Member
    Posted 1 year ago #

    It seems you are using manual excerpts.
    If you are using manual excerpts , add this in functions.php

    <?php
    
    function excerpt_read_more_link($output) {
     global $post;
     return $output . '<a href="'. get_permalink($post->ID) . '"> Read More...</a>';
    }
    add_filter('the_excerpt', 'excerpt_read_more_link');
    
    ?>
  15. bravokeyl
    Member
    Posted 1 year ago #

    Did it work ?

  16. Stephen Myall
    Member
    Posted 1 year ago #

    Yes you are correct and it works now. The support here is phenominal and in the coming days i will write a review and make a donation. I will now mark this as resolved , however I have a new question that i will post seperately. Thank you again for all your help

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic