Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26429

    On this widget, it is not pulling the images from within my posts. It seems that in order for it to notice an image, it has to be a slideshow. On my blog http://www.dailyps.com, the writers just use small images. Is there a way to change this so that these images will be used on this widget?

    Also, on the comments part of this, can a default image be selected for people that do not have an image?

    #130378

    I found this code: http://www.wprecipes.com/how-to-get-the-first-image-from-the-post-and-display-it which will extract the first image from the post. I didn’t try it and there’s a good chance it won’t work but it’s worth a try. Add

    function catch_that_image() {
    global $post, $posts;
    $first_img = '';
    ob_start();
    ob_end_clean();
    $output = preg_match_all('/<img.+src=['"]([^'"]+)['"].*>/i', $post->post_content, $matches);
    $first_img = $matches [1] [0];

    if(empty($first_img)){ //Defines a default image
    return false;
    }
    return $first_img;
    }

    to the bottom of functions.php. Then open up wp-contentthemessentenceframeworkphpclass-framework-widgets.php and search for

    if(!$image && current_theme_supports( 'post-thumbnails' ))
    {
    $image = get_the_post_thumbnail( get_the_ID(), $image_size );
    }

    Replace it with

    if(!$image && current_theme_supports( 'post-thumbnails' ))
    {
    $image = get_the_post_thumbnail( get_the_ID(), $image_size );
    }

    if(empty($image))
    {
    $image = catch_that_image();
    }

    2) You can use a plugin like: http://wordpress.org/plugins/proper-avatars/

    #130379

    Sorry for this next post… This is my first blog and first time ever doing any of this stuff. I’m assuming all of this is in the .zip file that I downloaded when I got the theme; am I correct?

    Do I change this on my computer then upload it? Or can I do this somewhere on the actual theme settings?

    Again, sorry for the rookie questions! I learn quickly, I just need to get pointed in the right direction.

    Thanks,

    Alex

    #130380

    You can modify the file on your computer and upload it with ftp or install a plugin like: http://wordpress.org/plugins/solid-code-theme-editor/ to edit the theme files directly on your server. I’d suggest to use a standard text editor and ftp though.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Sentence Combo Widget’ is closed to new replies.