WordPress.org

Ready to get started?Download WordPress

Forums

WP Favorite Posts
WP-Favorite alway at top of the webpage (18 posts)

  1. onigetoc
    Member
    Posted 3 years ago #

    Hi, I love wp-favorite but i find annoying that whatever the place i add the shortcut {{wp-favorite-posts}} The list alway appear at the top of the page instead to appear where i place it on the page.

    Any idea to corect that?

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. caricari
    Member
    Posted 2 years ago #

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

  3. bren
    Member
    Posted 2 years ago #

    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!

  4. bren
    Member
    Posted 2 years ago #

    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

  5. bren
    Member
    Posted 2 years ago #

    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"...

  6. itsogay
    Member
    Posted 2 years ago #

    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...

  7. onigetoc
    Member
    Posted 2 years ago #

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

    I will try it

  8. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 2 years ago #

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

  9. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 2 years ago #

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

  10. onigetoc
    Member
    Posted 2 years ago #

    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

  11. onigetoc
    Member
    Posted 2 years ago #

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

  12. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 2 years ago #

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

  13. onigetoc
    Member
    Posted 2 years ago #

    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.

  14. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 2 years ago #

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

  15. onigetoc
    Member
    Posted 2 years ago #

    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

  16. caricari
    Member
    Posted 2 years ago #

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

  17. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 2 years ago #

    Can you send me the profile page's (http://www.twittbox.com/profile ) code ?

  18. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 2 years ago #

    @caricari no way for this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic