Support » Plugin: Simplicity Save for Later » Show content of posts on the saved posts.

  • Resolved noonecares

    (@thedeanamsterdam)


    Hey great plugin!

    One question..

    1. At the moment you only see the title of the post on the page where the saved posts are displayed but i also want the post content or even better only a specific amount of the post content to show up under the title. Is that possible?

    Bye!

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

    (@ratkosolaja)

    You can already do that. In your themes’ functions.php file, simply add something like this:

    function twentyseventeen_save_for_later_html( $html ) {
    	$html = '';
    	if ( has_post_thumbnail() ) {
    		$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' );
    		$html .= '<div class="rs-item-image" style="background-image: url(' . $thumbnail[0] . ');"></div>';
    	}
    	$html .= '<div class="rs-item-float">';
    		$html .= '<div class="rs-item-title">' . get_the_title() . '</div>';
    		$html .= '<div class="rs-item-date">' . get_the_date() . '</div>';
    	$html .= '</div>';
    	$html .= '<div class="rs-item-content" style="float: left; width: 100%; margin-top: 20px;">' . apply_filters( 'the_content', get_the_content() ) . '</div>';
    
    	return $html;
    }
    add_filter( 'rs_saved_for_later_item_html', 'twentyseventeen_save_for_later_html', 10, 1 );

    I’ve used get_the_contents() – you can use get_the_excerpt() without that apply_filters call, so:

    $html .= '<div class="rs-item-content" style="float: left; width: 100%; margin-top: 20px;">' . get_the_excerpt() . '</div>';

    Of course, some additional styling may be required.

    noonecares

    (@thedeanamsterdam)

    ok i can’t try it because the plugin doesnt work correctly anymore. I cant save anymore.
    http://www.trendflix.nl

    Plugin Author ratkosolaja

    (@ratkosolaja)

    Did you update the plugin to the latest version?

    noonecares

    (@thedeanamsterdam)

    never mind i fixed it!

    Plugin Author ratkosolaja

    (@ratkosolaja)

    Awesome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.