WordPress.org

Support

Support » Plugins and Hacks » Special Recent Posts » Special Recent Posts to open in a new window/tab

Special Recent Posts to open in a new window/tab

Viewing 6 replies - 1 through 6 (of 6 total)
  • Would like to open my ‘Special Recent Posts’ in a fancyBox solution.

    So would like to see this question answered also.

    Thanks?

    Plugin Author Luca Grandicelli

    @lgrandicelli

    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.

    Cool, thanks, will try this out!

    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);
    Plugin Author Luca Grandicelli

    @lgrandicelli

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

    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 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Special Recent Posts to open in a new window/tab’ is closed to new replies.
Skip to toolbar