WordPress.org

Forums

Recent Posts FlexSlider
[resolved] change post link to the category link (4 posts)

  1. miau18
    Member
    Posted 11 months ago #

    Hi i need help to change the recent post link to it's own category link
    can anyone help?

    https://wordpress.org/plugins/recent-posts-flexslider/

  2. David Laietta
    Member
    Plugin Author

    Posted 11 months ago #

    This may work (I haven't tested it):

    In the plugin, find the file recent-posts-flexslider/views/display.php and look for line 35, which has this:

    $output .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">';

    I would change that code to link to the category page, which should be set with the category that you selected in the widget, using the variable $categories that the plugin sets. Note that it only links to one category, despite the plural name.

    $output .= '</a><a href="' . get_category_link($categories) . '">';

    That should get you what you need!

    Thanks for using the plugin,
    David

  3. David Laietta
    Member
    Plugin Author

    Posted 11 months ago #

    Apologies, I forgot to wrap the code up.

    This may work (I haven't tested it):

    In the plugin, find the file recent-posts-flexslider/views/display.php and look for line 35, which has this:

    $output .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">';

    I would change that code to link to the category page, which should be set with the category that you selected in the widget, using the variable $categories that the plugin sets. Note that it only links to one category, despite the plural name.

    $output .= '<a href="' . get_category_link($categories) . '">';

    That should get you what you need!

    Thanks for using the plugin,
    David

  4. miau18
    Member
    Posted 10 months ago #

    great it works... thanks

Reply

You must log in to post.

About this Plugin

  • Recent Posts FlexSlider
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.