WordPress.org

Forums

WPeMatico
[resolved] Enable first image / Featured Image (10 posts)

  1. tpinkus
    Member
    Posted 1 year ago #

    I have this enabled (Enable first image found on content as Featured Image), but its not grabbing the images.

    Running:
    -- wp3.71
    -- WPeMatico 1.1.8

    http://wordpress.org/plugins/wpematico/

  2. Mrinal Kanti Roy
    Member
    Posted 1 year ago #

    Hi,

    It could be a plugin conflict.

    Try those---
    1) Deactivate all the plugins except this one: WPeMatico, then check your site, if it worked then activate plugins one by one & find which one is causing this issue.

    2) If the previous trick doesn't works, then disable the '(Enable first image found on content as Featured Image)' option via plugin's settings page and then add the following codes into functions.php file of your current theme which will work perfectly for setting auto featured image.

    function set_featured_image_for_posts()
    {
      // Get all posts so set higher number,
     // you can increase to any number if you have big amount of posts
      $args = array( 'numberposts' => 5000);
    
      // all posts
      $all_posts = get_posts( $args );	
    
      foreach($all_posts as $k=>$v)
      {
        $args = array(
        'numberposts' => 1,
        'order'=> 'ASC',
        'post_mime_type' => 'image',
        'post_parent' => $v->ID,
        'post_type' => 'attachment'
        );	
    
        // Get attachments
        $attachments = get_children( $args );
        $i=0;
        foreach($attachments as $attach)
        {
          // Get only first image
          if($i==0)
            $attachmentsid = $attach->ID;
          $i++;
        }
    
        // Set Featured image
        set_post_thumbnail($v->ID,$attachmentsid);
      }
    
    }
  3. tpinkus
    Member
    Posted 1 year ago #

    Deactivated all plugins except WPeMatico, and still have no images getting saved.

    Added the code you provided to my functions.php and still no images getting saved.

    Here are my settings:

    IMAGES
    Cache Images: checked
    No link to source images: not checked

    ENABLED FEATURES
    nothing enabled

    ADVANCED FETCHING
    nothing enabled

    OPTIONS FOR THIS CAMPAIGN
    max items: 10
    use feed date: unchecked
    Post title links to source: unchecked
    Strip links from content: checked
    Discussion options Closed (no pings)

    OPTIONS FOR IMAGES
    Cancel Cache: uncecked

    POST TEMPLATE
    nothing checked or added

    CAMPAIGN CATEGORIES
    Add auto Categories: checked (fav feature)

  4. tpinkus
    Member
    Posted 1 year ago #

    Hello :( please help me

  5. etruel
    Member
    Plugin Author

    Posted 1 year ago #

    hi,
    have you solved the problem with new version 1.1.9 ?

  6. tpinkus
    Member
    Posted 1 year ago #

    No, upgrading to v1.1.9 did not resolve the issue.

    Here is a chunk of the log that I think is saying the image couldn't be saved... let me know "if" and "what" I can do.

    2014-02-19 00:45.39: Uploading images.
    2014-02-19 00:45.39: Uploading image...http://abcnewsradioonline.com/storage/music-news-images/M_DanielleBradberyWhiteDress630_021414.jpg?__SQUARESPACE_CACHEVERSION=1392414514852
    2014-02-19 00:45.39: [WARNING] wp_upload_bits error:Array ( [error] => Invalid file type ) , trying custom function.
    2014-02-19 00:45.39: [WARNING] Extension not allowed:/www/MYDAILY-NEWS/htdocs/wp-content/uploads/sites/3M_DanielleBradberyWhiteDress630_021414.jpg?__SQUARESPACE_CACHEVERSION=1392414514852

  7. etruel
    Member
    Plugin Author

    Posted 1 year ago #

    as you can see in log this is not a plugin error.

    the image URL of your source is: http://abcnewsradioonline.com/storage/music-news-images/M_DanielleBradberyWhiteDress630_021414.jpg?__SQUARESPACE_CACHEVERSION=1392414514852

    The image URL is all the string included chars after "?"
    Wordpress checks the extension and see that there is not jpg, png or gif (etc) then return "Extension not allowed"

    I can make a filter for you as custom support. If you are interested can contact me on etruel [at] gmail [dot] com

  8. datoseb
    Member
    Posted 1 year ago #

    I apologize that here on this topic I bring but I would ask etruel:

    Is it possible to do this in a one Campain to put the image tag with a custom size. The problem is that it is one of the page where i get a news is redesigned their website and they are using very high-resolution images that do not fit mine. Please, is it possible to make a custom image tag as eg html tag to Post template in singel Campain something as:

    <img src="<?php post_image(); ?>" width="50%" height="50%"/>

    Thanks in advance

  9. esmi
    Forum Moderator
    Posted 1 year ago #

    @datoseb: If you require assistance then, as per the Forum Welcome, please post your own topic.

    This topic has been resolved.

  10. datoseb
    Member
    Posted 1 year ago #

    @esmi thanks and apologize for that :))

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WPeMatico
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.