WordPress.org

Ready to get started?Download WordPress

Forums

Special Recent Posts
Special Recent Posts to open in a new window/tab (7 posts)

  1. redcrab1277
    Member
    Posted 1 year ago #

    Hi All,

    I'd like the links for Special Recent Posts to open in a new window/tab but I'm not sure where to add the target="_blank" reference.... any help would be much appreciated!

    Cheers,
    Ben

    http://wordpress.org/extend/plugins/special-recent-posts/

  2. Ramzii
    Member
    Posted 1 year ago #

    Would like to open my 'Special Recent Posts' in a fancyBox solution.

    So would like to see this question answered also.

    Thanks?

  3. Luca Grandicelli
    Member
    Plugin Author

    Posted 1 year ago #

    If you need to add some custom class to the srp generated liniks, you have to open the classes/class-main.php file and look for any instance of "href".
    For each highlighted result, there you'll find an array with a predefined class name. Just add a space and insert your custom one. If you need to add a "target=_blank", on that line, add a new array item.
    So for example that would result as:

    array('class' => 'srp-widget-thmblink', 'href' => get_permalink($post->ID), 'target' => '_blank')

    NOTE: You are editing the core php of this plugin, so please make a backup copy of it before proceeding.

  4. Ramzii
    Member
    Posted 1 year ago #

    Cool, thanks, will try this out!

  5. Ramzii
    Member
    Posted 1 year ago #

    Tried this! And it works, kinda, but the problem that comes is as follow:

    It opens not only the newspost in a fancybox window..

    It opens the whole webpage inside a fancybox window!

    So what do i need to do (strip out) to only make it open the text of the newspost in a pop up fancybox window? Instead of the whole webpage?

    Thanks.

    My edit:

    // Building linked post title HTML
    
    $ptitlelink  =  $this->srp_create_tag('a', $this->extractTitle($post), array('class' => 'srp-post-title-link', 'class' => 'fancybox', 'href' => get_permalink($post->ID), 'title' => the_title_attribute(array('echo' => 0))));
    
    $srp_content .= $this->srp_create_tag('h4', $ptitlelink, $ptitle_heading_atts);
  6. Luca Grandicelli
    Member
    Plugin Author

    Posted 1 year ago #

    I'm sorry, you can't open the post content in a fancybox window atm.

  7. Ramzii
    Member
    Posted 1 year ago #

    Ahh too bad man, is it possible with the PRO paid version of your plugin?

    Or will it be? Or is it too much to ask for atm? Thanks for the support anyways :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic