Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1332633

    Hi,

    Hoping you can help.

    We have a blog page that, almost of all post are in the “normal” format. But we need to add some as “link” format.
    When I click on the image post on the index, it works fine. The issue is on the button “Read More” that links to the post URL it self instead of the post link added.

    Can you help?

    Thank you

    #1332689

    Hey Kyle,

    Thank you for the inquiry.

    Looks like the read more button’s link doesn’t go through the same content filter function unlike the link used in the post image. Please try to modify the config-templatebuilder/avia-shortcodes/postslider/postslider.php file and look for this code around line 723.

    	$permalink = '<div class="read-more-link"><a href="' . get_permalink( $the_id ) . '" class="more-link">' . __( 'Read more', 'avia_framework' ) . '<span class="more-link-arrow"></span></a></div>';
    

    Replace the get_permalink( $the_id ) function with $link, then move it below this code.

    	if( $format == 'link' )
    					{
    						$current_post = array();
    						$current_post['content'] = $entry->post_content;
    						$current_post['title'] = avia_wp_get_the_title( $entry );
    
    						if( function_exists( 'avia_link_content_filter' ) )
    						{
    							$current_post = avia_link_content_filter( $current_post );
    						}
    
    						$link = $current_post['url'];
    					}
    

    Best regards,
    Ismael

    #1332842

    Hi Ismael,

    Thank you for the quick reply.

    I made the changes (replaced and moved below) and add the postslider.php to my child theme folder (into the shortcodes folder).

    but i get the “critical error on this website”

    What i may be doing wrong?

    Thank you

    #1332911

    Hey!

    Thank you for the update.

    What was the error? Would you mind testing it again using this bit of code?

    $permalink = '<div class="read-more-link"><a href="' . $link . '" class="more-link">' . __( 'Read more', 'avia_framework' ) . '<span class="more-link-arrow"></span></a></div>';
    

    Place it around line 727, just below the code that we mentioned above.

    Best regards,
    Ismael

    #1332986

    Hi Ismael,

    Thank you for the quick reply.

    The Error of the previous solution was:
    There has been a critical error on this website.
    Learn more about troubleshooting WordPress.

    And the site did not load.

    But i added the code you sent now and it worked like a charm.

    Thank you very much, for your help.
    Until a next time
    Cheers

    #1333043

    Hi,

    Great, I’m glad that you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1333145

    That it is all

    Thank you Rikard.

    You can close it.

    Cheers

    #1333192

    Hi,

    Thanks for letting us know, I’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Post format – Link – Read more button’ is closed to new replies.