WordPress.org

Ready to get started?Download WordPress

Forums

Single Latest Posts Lite
Thumbnails not showing--coding already there (10 posts)

  1. mallorycruz
    Member
    Posted 11 months ago #

    Hello! I am trying to use this on my homepage but unfortunately, I cannot get the thumbnails to show.

    Below is the coding on the functions.php . As you can see, the thumbnail coding is already there.

    **
    * Enable support for Post Thumbnails on posts and pages
    *
    * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
    */
    add_theme_support( 'post-thumbnails' );
    add_image_size( 'thumb-small', 50, 50, true );
    add_image_size( 'thumb-medium', 300, 135, true );
    add_image_size( 'thumb-featured', 640, 250, true );

    Any reason why this isn't working?

    http://wordpress.org/plugins/single-latest-posts-lite/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 11 months ago #

    Hi,

    I'm wondering how are you using Single Latest Posts? Widget, Shortcode or Embedded Function?

    In case you're using shortcodes or embedded function then you must set thumbnails parameter, something like:

    // Shortcode
    [slposts title_only=false
            thumbnail=true
    ]
    
    // Embedded function
    $args = array(
          'title_only' => 'false',
          'thumbnail' => 'true'
    );
    single_latest_posts( $args );

    For widgets just set Thumbnails > Display Thumbnails > Show.

    If you need more help, please don't hesitate to ask.

    Cheers.

  3. mallorycruz
    Member
    Posted 11 months ago #

    Hi! Thank you so much for your reply! I am using embedded because I'm using this in a page to serve as my homepage. Where does this code go? In functions.php ?

    Thanks,
    Mallory

  4. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 11 months ago #

    Hello,

    If you're doing your own theme, then the best way to embed Single Latest Posts is using templates, please visit this link where you will find how to do it: slposts_cptTemplate.php please bear in mind this is just an example, some options there may not be available in the Lite version of Single Latest Posts.

    Hope this helps.

  5. mallorycruz
    Member
    Posted 11 months ago #

    Hi again! I just tried using the widget and the thumbnails still didn't work. If the thumbnail is just posted as a regular part of the blog content, it should work, right? Does it need to be somewhere else or identified in another way?

  6. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 11 months ago #

    Aha, good point. I forgot to mention, thumbnails are called "Featured Images", when creating a new post you'll see a box where you can set the image at the bottom of the right side. I made two screenshots to show you how does it look like and where to activate the featured images in case you don't see it where it should be.

    1.- Activate Featured Image
    2.- Set Post's Featured Image

    Cheers.

  7. mallorycruz
    Member
    Posted 11 months ago #

    Excellent! Thank you so much!!!

  8. mallorycruz
    Member
    Posted 11 months ago #

    Me again--so I fixed the thumbnail issue but when I posted a new blog today, it messed up the formatting. Is there a way I can fix this?

    You can see what I'm talking about here-- http://www.mallorycruz.com

    Thanks!

  9. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 11 months ago #

    Hello Mallory,

    That's a CSS issue, I've tweaked the default CSS stylesheet to fix it. Please download this stylesheet: slp-mallory.css (save it into your WordPress active theme folder /wp-content/themes/fashionistas/) then add this to the arguments array:

    'css_style' => 'slp-mallory'

    So your template $arg array should look something like this:

    // Embedded function
    $args = array(
          'title_only' => 'false',
          'thumbnail' => 'true',
          'css_style' => 'slp-mallory'
    );
    single_latest_posts( $args );

    Once you've done this, then your site should display blocks this way: Screenshot

    If you're interested to know what I've changed, block elements have CSS class .slposts-block-item you'll find it at line 421 in default_style.css:

    .slposts-block-item {
        float: none !important;
        display: inline-block;
        width: 47%;
        margin-right: 10px;
        margin-bottom: 10px;
    }

    I've replaced float: left; by float: none !important; and added display: inline-block;. Feel free to customize this CSS file to suit your needs.

    Cheers.

  10. mallorycruz
    Member
    Posted 11 months ago #

    Thank you! We're much closer! As you can see, the bottom two boxes are aligned but the top right is now lower.

    http://www.mallorycruz.com

    Thank you so much for all of your help. I really, really appreciate it!

Reply

You must log in to post.

About this Plugin

About this Topic