Tagged: link, Post Format, read more button
-
AuthorPosts
-
December 13, 2021 at 6:08 pm #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
December 14, 2021 at 4:51 am #1332689Hey 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,
IsmaelDecember 14, 2021 at 6:05 pm #1332842Hi 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
December 15, 2021 at 9:28 am #1332911Hey!
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,
IsmaelDecember 15, 2021 at 4:10 pm #1332986Hi 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
CheersDecember 16, 2021 at 9:04 am #1333043Hi,
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,
RikardDecember 16, 2021 at 4:17 pm #1333145That it is all
Thank you Rikard.
You can close it.
Cheers
December 17, 2021 at 6:30 am #1333192Hi,
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 -
AuthorPosts
- The topic ‘Post format – Link – Read more button’ is closed to new replies.