WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WP Favorite Posts] WP-Favorite alway at top of the webpage

[Plugin: WP Favorite Posts] WP-Favorite alway at top of the webpage

Viewing 15 replies - 1 through 15 (of 17 total)
  • caricari

    @caricari

    the same is happening to me!!!
    http://www.luxoimoveis.com
    Do anyone know why?

    bren

    @devfor

    yes this is because of the following reasons

    in wp-favorite-posts.php
    function wpfp_list_favorite_posts() is calling the template file in this manner before $content is being checked for shortcodes

    if (@file_exists(TEMPLATEPATH.'/wpfp-page-template.php')):
            include(TEMPLATEPATH.'/wpfp-page-template.php');
        else:
            include("wpfp-page-template.php");
        endif;

    this means that before the $content is parsed, whatever is happening in the template file is causing the favorite links to be generated ahead of the content rendering thereby circumventing the ability to place the favorites inline as a swap out for the shortcodes

    looking at the template file itself, we can see it’s set up to echo it’s contents as opposed to generate a return string

    <?php
        echo "<div class='wpfp-span'>";
       ... code truncated for posting here ...
        echo "</div>";
        wpfp_cookie_warning();
    ?>

    I’m sure the author could change this – I’m currently hacking away at the code to try and strip the template into rendering and layout sections so that I can include the rendering inline as opposed to ahead of all content but other things are taking my time

    for pointers something along the lines of

    <?php
    
    $wpfp_echoStr = '';
    $wpfp_echoStr .='<div class="wpfp-span">';
       ... code truncated for posting here ...
    $wpfp_echoStr .= "</div>";
    
    //if(wpfp_cookie_warning())...
    //generate your warning strings and tag on to output//
    //do the same for remove links etc//
    
    $wpfp_echoStr .= '<div class="wpfp-userinteration">';
    $wpfp_echoStr .= $wpfp_userinteration;
    $wpfp_echoStr .= "</div>";
    
    ?>

    understand that you will need to work out when and how to call $wpfp_echoStr for inclusion – I’ll report back if I get around to it

    great plugin btw!

    bren

    @devfor

    ok scrap that… we are in luck

    http://nxsn.com/projects/wp-favorite-posts/comment-page-8/#comment-7582
    http://pastebin.com/dHq8fXpW

    thanks to the person who did the work for us
    just be aware that this is a hack to include in your theme functions and not a replacement for the plugin

    note that there is an error in the hack at line 50

    $output.=wpfp_cookie_warning();

    should be

    $output.=my_wpfp_cookie_warning();

    hopefully the author will release a new API compliant version soon

    bren

    @devfor

    argh… hits head against desk

    the hack is not working
    the shortcode is [my-wp-favorite-posts] but the output stops at <div class=”content”…

    Have you tried creating a custom wpfp template file in your theme directory ?

    * create a new page template by duplicating the standard one and renaming it to whatever you choose (see http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates for more info)
    * in your new page template, add the wpfp php call <?php (if function_exists('wpfp_list_favorite_posts')) wpfp_list_favorite_posts(); ?> right there where you’d like having the bookmarks show up
    * apply the new template to your list page in the admin. Do not add the shortcode on the list page, the php call is sufficient !

    This is the simplest way I have found to avoid duplicate and misleading listings…

    Yes, i did a new page template but did not use php call instead of shortcode,

    I will try it

    Plugin Author Huseyin Berberoglu

    @hberberoglu

    hi, can you give the url ? i’ll look up to it.

    Plugin Author Huseyin Berberoglu

    @hberberoglu

    Try to use [wp-favorite-posts] instead of {{wp-favorite-posts}}

    Hi, i loaded it in a user passeword protected page, in the profile page, if you want to see it you should register

    http://www.twittbox.com/profile

    and of course, you should go in detail page, to add favorite to see something lol

    Plugin Author Huseyin Berberoglu

    @hberberoglu

    I’ve added some links to my favorites. I didn’t see any problems ?

    I didn’t make the change, but i wanted to add My Favorites after My saved search, but my favorite is alway at the top.

    I didn’t replace it by the php line instead of the shortcode.

    Plugin Author Huseyin Berberoglu

    @hberberoglu

    put wpfp_list_favorite_posts(); php function wherever you want to show user’s favorites.

    If you want to test, go to home page, click a title link, it will open a new window, at the top menu you have Save search, click it, give a title and save, return to profile page, now My saved search is after all favorites, but like i said, i wanted it at the top but the Favorite stay on top of the Entry DIV

    Hi Huseyin Berberoglu, is there a way that i can send the favorites list on e-mail. Thanks

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Plugin: WP Favorite Posts] WP-Favorite alway at top of the webpage’ is closed to new replies.