Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244237

    I have a page here:

    http://wholisticmedicalcentre.com.au/holistic-health-news/

    I’ve built this using Layout Builder and the Blog content element specifying”single author, small preview pic” specifying excerpt with “read more” link

    But the read more link doesn’t point to the permalink for the associated post.

    Any clues would be appreciated. I am using Enfold 2.6

    • This topic was modified 10 years, 8 months ago by bongoman.
    #244884

    Hi bongoman!

    Can we take a look at your settings from the backend? If you provide admin login credentials as a private reply here on the forums we can log in and take a look and then see whats going on. I know there has been some quirks with the new setting so seeing it first hand would be the quickest and most direct way to try and fix it.

    Regards,
    Devin

    #245820
    This reply has been marked as private.
    #246398

    Hi!

    I don’t know why the read more link doesn’t work on your server but I solved the issue. I replaced this code in includes/loop-index.php:

    
    	$current_post['content'] 	= $blog_content == "content" ? get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>') : get_the_excerpt();
    	$current_post['content'] 	= $blog_content == "excerpt_read_more" ? $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>' : $current_post['content'];
    	$current_post['before_content'] = "";
    

    with

    
    	$current_post['content'] 	= $blog_content == "content" ? get_the_content(' ') : get_the_excerpt();
    	$current_post['content'] 	= $blog_content == "excerpt_read_more" ? $current_post['content'].'<div class="read-more-link"><a href="'.get_permalink($current_post['the_id']).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span></a></div>' : $current_post['content'];
    	$current_post['content'] 	= $blog_content == "content" ? $current_post['content'].'<div class="read-more-link"><a href="'.get_permalink(get_the_ID()).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span></a></div>' : $current_post['content'];
    	$current_post['before_content'] = "";
    

    and now the loop uses the get_permalink() function instead of the get_the_content() function to generate the read more link. If you place the modified loop-index.php into your child theme the change is also update safe.

    Best regards,
    Peter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.