Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #318850

    Hi,

    I’m trying to use the more tag to define the length of my excerpts on the blog page, however the tag seems to be ignored: excerpts are still shown till the number of words is reached.

    Any idea how to override ignore the default word count, and use the more tag – weather the excerpt is only 15 words, 150 or even 1500. And do you guys know if this plugin might solve my issue? It says that it’ll work depending on the theme I’m using…

    Thnx in advance!

    #319012

    Hi Marc!

    Thank you for using Enfold.

    Are you using the Blog Posts element? If not, use it to create a blog page then set the Blog Content Length to Full Content. This will utilize the more tag properly.

    Regards,
    Ismael

    #319100

    Hi Ismael, thnx for the reply!

    Yes, I’m using the Blog Posts Content Element. I just set the Blog Content Length to Full Content. In the blog post I inserted the more-tag by using the button ‘Insert Read More tag’. After saving I see the complete blog post, instead of the first part till the more-tag.

    On the other hand, I’ve found a kind of workaround.

    (1) On the blog page set the Blog Content Length to Excerpt with read more link
    (2) On the blog post checked the Excerpt option through the screen options
    (3) On the blog post filled the Excerpt text area below the body text area

    This makes it possible to exactly define the excerpt, even with another text than used in the main content.

    So the issue is not solved, but I’ve found a solution that feels pretty good.

    Cheers,
    Marc

    #319156

    Hi Ismael!

    On my page that tip doesn’t work. And I can’t use Marc’s solution, becaue my 300 Posts have no excerpt area filled out. But I use “More Tags”. So my Problem: Cut off the text an the <!–more> Tag

    I allredy had a solution but thats not working any more with theme updates. It came from here: https://kriesi.at/support/topic/bug-no-post-intro-via-more-tag-ist-shown-when-using-avia-layout-builder/#post-219225

    summery from that former solution, the code is:

    add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1);
    function avia_category_content_filter($current_post)
    {
    if(!is_single())
    {
    	$current_post['content'] =  get_the_excerpt();
    	$current_post['content'] .= '<div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span></a></div>';
    }
    return $current_post;
    }  

    So, it works here: http://www.schwarzwaldgeier.de/uebersicht-news/

    But not when the blog sections made by avia layout builder like Startpage (and formerly that worked): http://www.schwarzwaldgeier.de

    What can I do?

    Thanx so much for helping us.

    Stefan

    #321670

    Hey Stefan!

    Try adding this at the very end of your theme / child theme functions.php file:

    function change_blog_archive_style() {	
    	global $avia_config;
    	if(!is_single()){ $avia_config['blog_content'] = "excerpt_read_more"; }
    }
    add_action('get_header', 'change_blog_archive_style');

    Cheers!
    Josue

    #321697

    Hi Josue,

    As I wrote in this topic (https://kriesi.at/support/topic/cut-excerpt-off-at-more-tag-instead-of-using-wordcharacter-count/#post-319100), my problem is solved because I use a plugin. However, I want to try your solution as well; that would be the easiest solution in case of future text changes in the excerpt/preview.

    But then I have one question: will such a hard coded solution last in future updates of the theme?

    Cheers,
    Marc

    • This reply was modified 10 years, 2 months ago by Marc Bijl.
    #321699

    Hi Marc!

    It should if you are using a child theme or a plugin like this to store custom functions separated from the main theme.

    Best regards,
    Josue

    #321766

    Allright, that would not be much of a problem then, since I use a child theme ;-)

    Thnx for the quick reply!
    Marc

    #322004

    Hope it does the trick Marc :)

    #322124

    Hi Josue,

    Just tried your solution:

    (1) Added the code to functions.php of my child theme.
    (2) Went to the Blog Posts Content Element of my blog page, and set the Blog Content Length to Full Content.
    (3) In the blog post I inserted the more-tag by using the button ‘Insert Read More tag’.

    After saving I still see the complete blog posts, instead of the first part till the more-tag.

    Hope to hear from @simpson199 if it works for him…

    BTW
    As said before, for me the problem is already solved by a workaround (https://kriesi.at/support/topic/cut-excerpt-off-at-more-tag-instead-of-using-wordcharacter-count/#post-319100).

    Cheers,
    Marc

    #322303

    Hi Josue,

    Just tried this solution of @Dude and works perfectly!!!
    https://kriesi.at/support/topic/length-of-description-in-preview/#post-322259

    As far as I can see/test right now, it doesn’t make a difference how to set the Length Blog Content of the Blog Posts Element on my Blog page: I think it can be either excerpt + readmore or full blog length. Hope to get some time tonight to do some more testing…

    For now, this is just fab!!! :-)
    Cheers, Marc

    #322305

    And, the great thing is: this way all the HTML is shown in the excerpt of the blog page too! Things like a css class for the excerpt font, hyperlinks, etcetera. How cool is that? Neat stuf!

    For me, as creator of the topic, it can be closed! :-)

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Cut excerpt off at more tag instead of using word/character count’ is closed to new replies.