Support » Plugin: WP Favorite Posts » display the actual favourites list on custom page

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Huseyin Berberoglu


    it should be like that;

    if_(user_logged_in()) {



    Thanks I will give it a try.

    But how do I show the post excerpt and thumbnail if the favourites?
    I came across solveigm’s post but it wasn’t working for me the code he gave out is

    echo "";
        if ($favorite_post_ids):
    		$favorite_post_ids = array_reverse($favorite_post_ids);
            foreach ($favorite_post_ids as $post_id) {
                $p = get_post($post_id);
                echo "<div class='post'><div class='entry'>";
    						echo "<a href='".get_permalink($post_id)."'>";
    						echo get_the_post_thumbnail ( $post_id, 'thumbnail', array('class' => 'alignleft'));
    						echo "</a>";
                echo "<h3><a href='".get_permalink($post_id)."' title='". $p->post_title ."'>" . $p->post_title . "</a></h3> ";
                echo $p->post_excerpt;
                echo "<br><br>";
              	echo wpfp_remove_favorite_link($post_id);
              	echo "</div></div>";
                echo "<br>";
            echo "";
            echo $wpfp_options['favorites_empty'];
            echo "<br><br>";
        echo "";

    in the wpfp-page-template.php-file, I have done the same but no excerpt is showing, I also saw another post saying I need to make a call the my functions.php

    Can you help me to get the exerpt showing?

    Thanks Huseyin!

    For the excerpt to show, you must have written something in the excerpt-window in the post-editor. It doesn’t produce automatic excerpts from your text.

    Thanks for responding solveigm

    so there is no way to call and display the wordpress generated excerpt <?php the_excerpt(); ?> in the favourites?

    I have not written any excerpt in all my post as I thought WP can generate them automatically, and I can alter it in many ways.


    you could try to trim the text down to, say, 20 words to generate an auto-excerpt. here’s a snippet i use a lot:

    // add to functions.php
    function custom_field_excerpt($title) {
    			global $post;
    			$text = get_field($title);
    			if ( '' != $text ) {
    				$text = strip_shortcodes( $text );
    				$text = apply_filters('the_content', $text);
    				$text = str_replace(']]>', ']]>', $text);
    				$excerpt_length = 20; // 20 words
    				$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
    				$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    			return apply_filters('the_excerpt', $text);
    /// then use <?php echo custom_field_excerpt('field_name'); ?>

    By the way… i can’t get this plugin to generate a list of favorite posts. is it working for you with the latest WP version? // edit, it was a custom post type problem. fix was here:

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘display the actual favourites list on custom page’ is closed to new replies.