WordPress.org

Ready to get started?Download WordPress

Forums

Magazine Basic
[resolved] Displaying thumbnails with excerpt on index page (12 posts)

  1. Christinevarniere
    Member
    Posted 1 year ago #

    The last upgrade for Magazine Basic was a disaster. I chose to keep the new version and had to rebuild all my blog interface.

    There's still 2 things that don't work:

    - how can I display a thumbnail with the excerpt for the articles on the index page?
    in the previous version I think that was automatic but it doesn't work with this one. In the full text page, the image linked with the article is displayed but no thumbnail on the index page...

    - the excerpts displayed on the index page have only a few characters (around 200, that's too short, especially for the las published article), it doesn't display the text till the "more" tag. How can I do that?

    Thank you for your help! have a nice day.

    http://wordpress.org/extend/themes/magazine-basic/

  2. c.bavota
    Member
    Theme Author

    Posted 1 year ago #

    1. You now need to set the featured image: https://themes.bavotasan.com/faqs/how-do-i-set-a-featured-image-for-my-post/

    2. If you want to customize the excerpt, use the actual custom Excerpt box on your post edit screen. If you don't see the custom Excerpt box, click on Screen Options in the top right and check the appropriate box.

  3. Christinevarniere
    Member
    Posted 1 year ago #

    Thank you C.B. (By the way the video on the faqs page does'nt work)

    Does this mean that I have to edit all the posts in order to set a featured image? All articles already have an image which was used as thumbnail by the previous version of the theme.
    Pity that it doesn't work anymore...

    Same thing for the excerpt, the text displayed used to be until the "more" tag, without having to duplicate the text.

    Have a nice day.

  4. huberte
    Member
    Posted 1 year ago #

    PLease ! Yes ! Same pb here ! Update is a disaster !

    NO image in excerpt !

    NO lenght for excerpt !

    The secondary menu (in header in menu) : if you leave it blanck, it'll add pages automatically !

    Edit : By the way, I had to edit the php manually to customize The Read more text for foreign languages. Is there a way to do the same to customize the excerpt ?

  5. Christinevarniere
    Member
    Posted 1 year ago #

    To avoid redefining a "Featured image" and simply use the first image of the post as a thumbnail, add the following function in functions.php

    function autoset_featured() {
              global $post;
              $already_has_thumb = has_post_thumbnail($post->ID);
                  if (!$already_has_thumb)  {
                  $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
                              if ($attached_image) {
                                    foreach ($attached_image as $attachment_id => $attachment) {
                                    set_post_thumbnail($post->ID, $attachment_id);
                                    }
                               }
                            }
          }
    add_action('the_post', 'autoset_featured');
    add_action('save_post', 'autoset_featured');
    add_action('draft_to_publish', 'autoset_featured');
    add_action('new_to_publish', 'autoset_featured');
    add_action('pending_to_publish', 'autoset_featured');
    add_action('future_to_publish', 'autoset_featured');
  6. Christinevarniere
    Member
    Posted 1 year ago #

    To avoid redefining a "Featured image" and simply use the first image of the post as a thumbnail, add the following function in functions.php

    function autoset_featured() {
              global $post;
              $already_has_thumb = has_post_thumbnail($post->ID);
                  if (!$already_has_thumb)  {
                  $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
                              if ($attached_image) {
                                    foreach ($attached_image as $attachment_id => $attachment) {
                                    set_post_thumbnail($post->ID, $attachment_id);
                                    }
                               }
                            }
          }
    add_action('the_post', 'autoset_featured');
    add_action('save_post', 'autoset_featured');
    add_action('draft_to_publish', 'autoset_featured');
    add_action('new_to_publish', 'autoset_featured');
    add_action('pending_to_publish', 'autoset_featured');
    add_action('future_to_publish', 'autoset_featured');
  7. Christinevarniere
    Member
    Posted 1 year ago #

    Then for the size of the thumbnail (when using more than one column), you need to chnage the CSS, otherwise the thumbnail will use 100% of the space available.

    /* .two-col .entry-content img, */
    .three-col .entry-content img,
    .widget-post .entry-content img {
    width: 100%;
    }

    Thanks to the French bloggers who helped find this solution.

  8. huberte
    Member
    Posted 1 year ago #

    Thanks Christiane. Which blogs?

    C.B. Do you plan to re add this feature and correct the secondary menu?

  9. Christinevarniere
    Member
    Posted 1 year ago #

    @Huberte: I found the solution on the French forum:

  10. huberte
    Member
    Posted 1 year ago #

    No link Christiane. And does not work so well : http://www.madinin-art.net/

    c.bavota , any news ?

  11. webcabbie
    Blocked
    Posted 8 months ago #

    Wow.. the new one is way worse than like 4 versions ago.. is there a way to downgrade?

  12. signsintime
    Member
    Posted 7 months ago #

    Christinevarniere, to add the code to automatically use first image as featured, where in the functions.php does that go or can it be added at the very end of the file? Does it replace any previous code?

    When using a modified functions.php file does it go in the child theme folder or does it only work from parent theme folder?

    function autoset_featured() {
              global $post;
              $already_has_thumb = has_post_thumbnail($post->ID);
                  if (!$already_has_thumb)  {
                  $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
                              if ($attached_image) {
                                    foreach ($attached_image as $attachment_id => $attachment) {
                                    set_post_thumbnail($post->ID, $attachment_id);
                                    }
                               }
                            }
          }
    add_action('the_post', 'autoset_featured');
    add_action('save_post', 'autoset_featured');
    add_action('draft_to_publish', 'autoset_featured');
    add_action('new_to_publish', 'autoset_featured');
    add_action('pending_to_publish', 'autoset_featured');
    add_action('future_to_publish', 'autoset_featured');

    Thanks!
    Jeri

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic