WordPress.org

Ready to get started?Download WordPress

Forums

WP Favorite Posts
Full post in the favorite page (11 posts)

  1. tropman
    Member
    Posted 2 years ago #

    Hi,
    I'd like to display the full post (or if it's not possible, the full image of the post) in the favorite page, above the title link. And i'd like the image to be linked to the post.
    Thank you for your help!

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

  2. Pranjalg
    Member
    Posted 2 years ago #

    Hey, I am also interested to show full post instead of just post titles on favorite posts page.

    Any help would be greatly appreciated1

    Thanks :)

  3. martinmich
    Member
    Posted 1 year ago #

    if ($favorite_post_ids):
    		$favorite_post_ids = array_reverse($favorite_post_ids);
            foreach ($favorite_post_ids as $post_id) {
                $p = get_post($post_id);
    
    $content_post = get_post($post_id);
    $content = $content_post->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    
                $content = apply_filters('the_content', $content);
                echo "<li>";
                echo "<a href='".get_permalink($post_id)."' title='". $p->post_title ."'>" . $p->post_title . "</a> ";
                echo $content;
                wpfp_remove_favorite_link($post_id);
                echo "</li>";
  4. mechanicvirus
    Member
    Posted 1 year ago #

    Is it possible to have it display a whole entry with divs?

  5. qzha017
    Member
    Posted 1 year ago #

    Hi martinmich can you please paste the whole code for the wpfp-page-template.php?

    I cant get it to work, I have got

    <?php
        echo "<div class='wpfp-span'>";
        if (!empty($user)):
            if (!wpfp_is_user_favlist_public($user)):
                echo "$user's Favorite Posts.";
            else:
                echo "$user's list is not public.";
            endif;
        endif;
    
        if ($wpfp_before):
            echo "<p>".$wpfp_before."</p>";
        endif;
    
        echo "<ul>";
        if ($favorite_post_ids):
    		$favorite_post_ids = array_reverse($favorite_post_ids);
            $post_per_page = wpfp_get_option("post_per_page");
            $page = intval(get_query_var('paged'));
    foreach ($favorite_post_ids as $post_id) {
                $p = get_post($post_id);
    
           $content_post = get_post($post_id);
    $content = $content_post->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    
            query_posts(array('post__in' => $favorite_post_ids, 'posts_per_page'=> $post_per_page, 'orderby' => 'post__in', 'paged' => $page));
            while ( have_posts() ) : the_post();
    
     $content = apply_filters('the_content', $content);
                echo $content;
                echo "<li><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> ";
                wpfp_remove_favorite_link(get_the_ID());
                echo "</li>";
            endwhile;
    
            echo '<div class="navigation">';
                if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
                <div class="alignleft"><?php next_posts_link( __( '&larr; Previous Entries', 'buddypress' ) ) ?></div>
                <div class="alignright"><?php previous_posts_link( __( 'Next Entries &rarr;', 'buddypress' ) ) ?></div>
                <?php }
            echo '</div>';
    
            wp_reset_query();
        else:
            echo "<li>";
            echo $wpfp_options['favorites_empty'];
            echo "</li>";
        endif;
        echo "</ul>";
    
        echo '<p>'.wpfp_clear_list_link().'</p>';
        echo "</div>";
        wpfp_cookie_warning();
    ?>

    And its not working. If you could please help me to get the excerpt I was looking to get the excerpt but if I cant I will have to settle for the whole content.

    Thank you martinmich!

  6. chrisgagner
    Member
    Posted 1 year ago #

    martinmich, Where does this code need to go?

  7. bobham
    Member
    Posted 1 year ago #

    in wpfp-page-template.php, replace

    while ( have_posts() ) : the_post();
                echo "<li><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> ";
                wpfp_remove_favorite_link(get_the_ID());
                echo "</li>";
            endwhile;

    by this code:

    while ( have_posts() ) : the_post();
    $content_post = get_post($post_id);
    $content = $content_post->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
                $content = apply_filters('the_content', $content);
                echo "<li><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> ";
                wpfp_remove_favorite_link(get_the_ID());
                echo $content;
                echo "</li>";
            endwhile;
  8. rashawn336
    Member
    Posted 1 year ago #

    I tried the code above and I get a parse error on line 49 `<?php
    echo "<div class='wpfp-span'>";
    if (!empty($user)):
    if (!wpfp_is_user_favlist_public($user)):
    echo "$user's Favorite Posts.";
    else:
    echo "$user's list is not public.";
    endif;
    endif;

    if ($wpfp_before):
    echo "<p>".$wpfp_before."</p>";
    endif;

    echo "<ul>";
    if ($favorite_post_ids):
    $favorite_post_ids = array_reverse($favorite_post_ids);
    $post_per_page = wpfp_get_option("post_per_page");
    $page = intval(get_query_var('paged'));
    foreach ($favorite_post_ids as $post_id) {
    $p = get_post($post_id);

    $content_post = get_post($post_id);
    $content = $content_post->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);

    query_posts(array('post__in' => $favorite_post_ids, 'posts_per_page'=> $post_per_page, 'orderby' => 'post__in', 'paged' => $page));
    while ( have_posts() ) : the_post();
    $content_post = get_post($post_id);
    $content = $content_post->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    $content = apply_filters('the_content', $content);
    echo "<li><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> ";
    wpfp_remove_favorite_link(get_the_ID());
    echo $content;
    echo "</li>";
    endwhile;

    echo '<div class="navigation">';
    if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
    <div class="alignleft"><?php next_posts_link( __( '← Previous Entries', 'buddypress' ) ) ?></div>
    <div class="alignright"><?php previous_posts_link( __( 'Next Entries →', 'buddypress' ) ) ?></div>
    <?php }
    echo '</div>';

    wp_reset_query();
    else:
    echo "<li>";
    echo $wpfp_options['favorites_empty'];
    echo "</li>";
    endif;
    echo "</ul>";

    echo '<p>'.wpfp_clear_list_link().'</p>';
    echo "</div>";
    wpfp_cookie_warning();
    ?>`

  9. bobham
    Member
    Posted 1 year ago #

    @rashawn336: You need to delete lines 20-26 in your file as they are unnecessary now:

    foreach ($favorite_post_ids as $post_id) {
    $p = get_post($post_id);
    
    $content_post = get_post($post_id);
    $content = $content_post->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
  10. rashawn336
    Member
    Posted 1 year ago #

    It work thanks!!!

  11. Tech4Eleven
    Member
    Posted 1 year ago #

    was hopeful about this code but doesnt work on custom post types. I use this code from here: http://wordpress.org/support/topic/plugin-wp-favorite-posts-thumbnail-and-exerpt-in-favorite-page-view-blog-look?replies=10 to get my favorites page working but that code doesnt show the post content, only the excerpt. need a mix of these two..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic