WordPress.org

Ready to get started?Download WordPress

Forums

Posts in Sidebar
[resolved] Designating image for display (8 posts)

  1. mbeckelhimer
    Member
    Posted 1 year ago #

    I have a question about thumbnails and feature images. I use the widget to post an excerpt and image to my home page, in a 400-pixel-wide column. From there, the user can link to the main blog page, with a 525-wide column. I'm not sure I understand the concept of the thumbnail and the featured image as they relate to your widget. But what I'd like to do is have a 400-pixel-wide image (whether you call that a "featured image" or "thumbnail") get posted from the widget on the home page, and the have a larger 525-pixel-wide image display on the blog page. In the widget, you have a checkbox to "Display the featured image in the post" and then a dropdown for "thumbnail, small, ...". I'm not sure how this is supposed to work. Thanks in advance for explaining. I love the widget and want to make it work perfectly for my site!

    http://wordpress.org/extend/plugins/posts-in-sidebar/

  2. aldolat
    Member
    Plugin Author

    Posted 1 year ago #

    Hi mbeckelhimer,
    we'll make it perfect for your site! :-)

    When you upload an image, WordPress creates some copies of it in different sizes. These sizes are predefined. But you can add all the sizes you need. Only consider that the more sizes you add, the slower will be the process of uploading an image, because WordPress must create more sizes of a single image.

    When you create a new custom image size, this will be available and ready to use in the dropdown of Posts in Sidebar.

    Adding custom sizes requires to modify the functions.php of your current theme. You can do it using the tool already available in your WordPress Dashboard, or you can use an FTP client to download in your computer that file, edit it and upload it back to the server. Choose the method you like.

    Step 1
    Definition of two new custom sizes

    Go to your WordPress Dashboard > Appearance > Editor.
    On the right, click on Theme Functions (functions.php).
    Add these lines at the end of it:

    function my_custom_images_size() {
    	add_image_size( 'my-525x100-image', 525, 100, true );
    	add_image_size( 'my-400x200-image', 400, 150, true );
    }
    add_action( 'after_setup_theme', 'my_custom_images_size' );

    525 and 100 are the width and the height of the new size respectively: edit these values according to your needs. The same thing is for 400 and 150.

    Look carefully if there's a ?> sign at the end of this file: if it's present, add those lines before the ?>!

    Save the file.

    Step 2
    Using the new image sizes

    Go to Dashboard > Appearance > Widgets.
    Modify the widgets that are using Posts in Sidebar and assign the new image sizes accordingly.

    Step 3
    Uploading the images to let WordPress create the new sizes

    Open the post which needs the new size and upload an image. This image will be processed by WordPress and will have two new sizes (besides the old sizes). Choose it as Featured image.

    Save the post.

    Now you should see that for this post the new sizes are used.

    Repeat this step 3 for other posts.

    Final note

    If you have a lot of images to process, you can use a plugin that automates the processing. For example, Regenerate Thumbnails is a plugin that creates the new sizes you just added to your functions.php. This plugin can regenerate all the new sizes at once or you can choose which files are to be processed. More info are available in the plugin's page.

    Hope this helps.

    Let me know if you have any other questions.

  3. mbeckelhimer
    Member
    Posted 1 year ago #

    Thank you for the quick, detailed reply. Let me work on this and let you know how it goes!

  4. mbeckelhimer
    Member
    Posted 1 year ago #

    Hi, another question. Does your code pull in video clips? I embedded a Vimeo code in my post, but it doesn't display.

  5. aldolat
    Member
    Plugin Author

    Posted 1 year ago #

    To display video in the widget you have to choose "The entire content" in the dropdown of the section "The text of the post".

    The plugin will display the entire text as is, not only the video.

  6. aldolat
    Member
    Plugin Author

    Posted 1 year ago #

    Are you having difficulties, mbeckelhimer?

  7. DietTeam
    Member
    Posted 1 year ago #

    I would like to use this plug-in for displaying video posts. The widget displays the video fine when I select "entire content". I have two issues. The video image is too large for the sidebar. I've tried adjusting the image size by editing the functions.php file as you mentioned above, but it does not seem to change the size of the video. The second issue is that it displays all the descriptive text. Is there any way I can get it to just display the video? Thanks.

  8. aldolat
    Member
    Plugin Author

    Posted 1 year ago #

    Editing the functions.php to define a new image size is intended to be used only for images, not for videos.

    A link to your site could be useful to understand your issues correctly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.