17 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 1+ items on Envato Market
Raj_r says

Yesterday i bought theAvenue theme for my entertainment blog bollyone.com

One Question i can see the Post Image that shows in Home Page ( On my Old Theme am Using the “Thumb” option to add link in New Custom Field in WordPress new post )

So how can i enable those thumbs in this new theme.

Check the demo here http://www.bollyone.com/category/aishwarya/page/2/?themedemo=Avenue

New Theme is not still live you can see the demo version with the above link

1950 posts Do the Needful
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
+10 more
JamiGibbs says

Hi Raj_r,

The best way to get help with a theme is to contact the theme author. They’ll be far more knowledgeable about their product than anyone else here on the general forums.

I’m going to take a guess here though: have you tried assigning a ‘Featured Image’ to your posts?

17 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 1+ items on Envato Market
Raj_r says

I tried the featured image in a post and it works smoothly.

But on my site i have above 3000 post so it was no possible for me to go and edit all of them with Featured image.

Previously am using Custom field option in post and Add thumb and image link there.

So is it possible to convert the Featured image option into Thumb.

So it can collect all the thumb link image form all the posts.

3231 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says
1950 posts Do the Needful
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
+10 more
JamiGibbs says

It’s possible Raj_r (good link by OrganicBee) but if you don’t know how to edit the theme’s code, you’ll probably need to hire a freelancer to make the change for you.

17 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 1+ items on Envato Market
Raj_r says
JamiGibbs said
It’s possible Raj_r (good link by OrganicBee) but if you don’t know how to edit the theme’s code, you’ll probably need to hire a freelancer to make the change for you.

Thanks

I have 2 functions php file

1 in theme folder Avenue/functions.php

2 one in Avenue/framework/functions.php (And this one shows in wordpress theme editor, added the code in the last, but doesn,t work.

<?php function get_related_posts($post_id, $tags = array()) {
    $query = new WP_Query();

    $post_types = get_post_types();
    unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);

    if($tags) {
        foreach($tags as $tag) {
            $tagsA[] = $tag?>term_id;
        }
    }

    $args = wp_parse_args($args, array(
        'showposts' => 4,
        'post_type' => $post_types,
        'post__not_in' => array($post_id),
        'tag__in' => $tagsA,
        'ignore_sticky_posts' => 1,
    ));

    $query = new WP_Query($args);

      return $query;
}

function kriesi_pagination($pages = '', $range = 2)
{  
     $showitems = ($range * 2)+1;  

     global $paged;
     if(empty($paged)) $paged = 1;

     if($pages == '')
     {
         global $wp_query;
         $pages = $wp_query->max_num_pages;
         if(!$pages)
         {
             $pages = 1;
         }
     }   

     if(1 != $pages)
     {
         echo "<div class="pagination">";
         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href="\".get_pagenum_link(1).\""><span class="arrows">&laquo;</span> First</a>";
         if($paged > 1 && $showitems < $pages) echo "<a href="\".get_pagenum_link($paged - 1).\""><span class="arrows">&lsaquo;</span> Previous</a>";

         for ($i=1; $i <= $pages; $i++)
         {
             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
             {
                 echo ($paged == $i)? "<span class="current">".$i."</span>":"<a href="\".get_pagenum_link($i).\"" class="inactive">".$i."</a>";
             }
         }

         if ($paged < $pages && $showitems < $pages) echo "<a href="\".get_pagenum_link($paged + 1).\"">Next <span class="arrows">&rsaquo;</span></a>";  
         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href="\".get_pagenum_link($pages).\"">Last <span class="arrows">&raquo;</span></a>";
         echo "</div>\n";
     }
}

function string_limit_words($string, $word_limit)
{
    $words = explode(' ', $string, ($word_limit + 1));

    if(count($words) > $word_limit) {
        array_pop($words);
    }

    return implode(' ', $words);
}

function postmeta_img_update() {
global $post;
// If Custom Post Meta Field for a Image/Thumnail Exists
if( get_post_meta($post->ID, "Image URL", true) ):

// Get Image Location and File Extention
$img = get_post_meta($post->ID, "Image URL", true);
$ext = substr(strrchr($img,'.'),1);

// WordPress Upload Directory to Copy to (must be CHMOD to 777)
$uploads = wp_upload_dir();
$copydir = $uploads['path']."/";

// Code to Copy Image to WordPress Upload Directory (Server Must Support file_get_content/fopen/fputs)
$data = file_get_contents($img);
$filetitle = strtolower(str_replace(array(' ', '-', '.', '(', ')', '!', '@', '#', '$', '%', '^', '&', '*', '_', '=', '+'), "-", get_the_title()));
$file = fopen($copydir . "$filetitle-$post->ID.$ext", "w+");
fputs($file, $data);
fclose($file);

// Insert Image to WordPress Media Libarby
$filepath = $uploads['path']."/$filetitle-$post->ID.$ext";

$wp_filetype = wp_check_filetype(basename($filepath), null );
$attachment = array(
     'post_mime_type' => $wp_filetype['type'],
     'post_title' => get_the_title(),
     'post_content' => 'Image for '.get_the_title(),
     'post_status' => 'inherit'
    );

wp_insert_attachment( $attachment, $filepath, $post->ID);

// Get Attachment ID for Post
global $wpdb; $attachment_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post->ID' AND post_status = 'inherit' AND post_type='attachment' ORDER BY post_date DESC LIMIT 1");
// Attached Image as Featured Thumbnail in Post
update_post_meta($post->ID, "_thumbnail_id", $attachment_id);

// Removes Custom Meta Field Image URL. This stop this function running again for the updated post.
delete_post_meta($post->ID, "Image URL");

endif;

}
add_action('the_post','postmeta_img_update');
17 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 1+ items on Envato Market
Raj_r says

Help me please :(

17 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 1+ items on Envato Market
Raj_r says

Not even the related post images are working

66 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
ThemeSector says

Avenue uses WordPress Post Thumbnails. The native functionality of WordPress.

You will have to upload the images again, edit the theme (best to hire a freelancer) or find a plugin. One that I have been recommending to my buyers is http://wordpress.org/extend/plugins/auto-post-thumbnail/

17 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 1+ items on Envato Market
Raj_r says
ThemeSector said
Avenue uses WordPress Post Thumbnails. The native functionality of WordPress. You will have to upload the images again, edit the theme (best to hire a freelancer) or find a plugin. One that I have been recommending to my buyers is http://wordpress.org/extend/plugins/auto-post-thumbnail/

Thanks For the reply.

Yes right now am using the wordpress post thumbnails. But right now they are shown from Custom Feild not from the Featured image option.

So is it possible to convert the Featured image option into Thumb.

Somethig tlike this

http://wordpress.org/support/topic/post-meta-field-images-to-featured-thumbnailimage

But it was not working for me :(

by
by
by
by
by
by