Wordpress Help: How to convert thumbnail custom field to featured image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tonyparra
    Confirmed User
    • Jul 2008
    • 4568

    #1

    Wordpress Help: How to convert thumbnail custom field to featured image

    I hate when i buy a cool looking wp theme only to find out that the author made it impossible to edit. I recently purchased the cooolzine theme at themeforest and its a great looking theme, however I want to use it on a site that used to use custom fields for the thumbnail, and the theme seems to only work with the featured thumb. Usually when i find an issue like that with a theme i edit it to either use a php statement that uses the featured thumb or a image script like timthumb, or i like to use the get_the_image plugin by justin tadlock. However this theme calls the thumb in a way that i dont understand, so i wonder is there a plugin or script i could run to link images stored on the server in a custom field to the post thumbnail feature. Here a sample of the code if anyone want to take a whack. Also if you can code this reasonably fast hit me up let me know how much and how soon.

    Code:
    <div class="box article '.$cat[$firstcat]->slug.' '.$tagclass.'">
    <div class="text">';
    
    	if (!empty($image)){
    	
    
    
    		$extralen = 0;
    		
    		$ret .= '
    			<div class="thumb">
    				<img src="'.$src[0].'" alt="'.$post->post_title.'" title="'.$post->post_title.'" />
    
    				<a href="'.get_permalink($post->ID).'">'.__('read more').'</a>
    			</div><!--thumb-->
    		';
    		
    	} // has images
    
    
    	if ($tlen >= 1 && $tlen <= 20) {
    		$headrows = 1;
    		$alen = 160 + $extralen;
    	}
    	
    	if ($tlen > 20 && $tlen <= 40) {
    		$headrows = 2;
    		$alen = 115 + $extralen;
    	}
    	
    	if ($tlen > 40 && $tlen <= 66) {
    		$headrows = 3;
    		$alen = 100 + $extralen;
    	}
    	
    	if ($tlen > 66 && $tlen <= 88) {
    		$headrows = 4;
    		$alen = 55 + $extralen;
    	}
    	
    	if ($tlen > 88) {
    		$alen = 55 + $extralen;
    	}
    													
        $pattern = get_shortcode_regex();
    	$clean = strip_tags(preg_replace('/'.$pattern.'/s', '$1$6', $post->post_content));
    	
    	$cut = substr($clean,0,$alen);
    
    
    
    $ret .= '<div class="meta"><a class="cat-'.$cat[$firstcat]->slug.'" href="'.get_category_link($cat[$firstcat]->cat_ID).'">'.$cat[$firstcat]-
    
    >name.'</a></div><!--meta-->
    	<h2 class="hyphenate"><a href="'.get_permalink($post->ID).'">'.$post->post_title.'</a></h2>
    	<a href="'.get_permalink($post->ID).'">
    		<span class="hyphenate">
    		'.$cut.' &rsaquo;
    		</span>
    	</a>
    </div><!--text-->

    High Performance Vps $10 Linode
    Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot
  • tonyparra
    Confirmed User
    • Jul 2008
    • 4568

    #2
    Note to self: dont ever buy another wordpress theme if it aint free it aint for me

    High Performance Vps $10 Linode
    Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

    Comment

    • fris
      I have to go potty
      • Aug 2002
      • 55730

      #3
      might be a plugin to convert them (import), how many posts we talking about here?
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      My Latest Theme

      Comment

      • tonyparra
        Confirmed User
        • Jul 2008
        • 4568

        #4
        Originally posted by fris
        might be a plugin to convert them (import), how many posts we talking about here?
        Its only like 50 ive tried a couple different plugins to no avail.

        High Performance Vps $10 Linode
        Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

        Comment

        • tonyparra
          Confirmed User
          • Jul 2008
          • 4568

          #5
          This plugin: http://wordpress.org/extend/plugins/get-the-image/ works great but i cant figuire how to intergrate it into this theme, my php is not that advanced i contacted the theme author for ideas and they told me to hire a coder ...

          High Performance Vps $10 Linode
          Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

          Comment

          • scouser
            marketer.
            • Aug 2006
            • 2280

            #6
            does calling

            get_the_image()

            not work? just do

            <? echo get_the_image(); ?> from within the loop. does that not output ur pic?

            Comment

            • Colmike9
              (>^_^)b
              • Dec 2011
              • 7217

              #7
              Someone asked the author that question before and he said:
              "Hey,

              either change the way cooolzine displays the posts: lib/functions/cooolzine.php - cooolzine_toparticle() - cooolzine_boxarticle()

              or have a look a the functionality of the post2media plugin which does the picture attachment.

              Cheers"

              Does this help?
              Join the BEST cam affiliate program on the internet!
              I've referred over $1.7mil in spending this past year, you should join in.
              I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

              Comment

              • buzzard
                Confirmed User
                • Aug 2002
                • 1276

                #8
                Make a csv file for your images and then import the csv,
                you could also do an auto featured image import

                Comment

                • just a punk
                  So fuckin' bored
                  • Jun 2003
                  • 32385

                  #9
                  With CyberSEO you can do it as easy as this:
                  1. go to CyberSEO->Tools;
                  2. insert the following code into the "PHP Code <?php .. ?>" box:
                    Code:
                    $thumb = get_post_meta($post->ID, "YOUR_THUMBNAIL_CUSTOM_FIELD_NAME", true);
                    cseo_attach_post_thumbnail($post->ID, $thumb, $post->post_title);
                  3. click "Apply These Modifications To All Existing Posts".


                  Obey the Cowgod

                  Comment

                  • tonyparra
                    Confirmed User
                    • Jul 2008
                    • 4568

                    #10
                    Originally posted by Colmike7
                    Someone asked the author that question before and he said:
                    "Hey,

                    either change the way cooolzine displays the posts: lib/functions/cooolzine.php - cooolzine_toparticle() - cooolzine_boxarticle()

                    or have a look a the functionality of the post2media plugin which does the picture attachment.

                    Cheers"

                    Does this help?
                    It does i didnt see that comment, I tried to insert get_the_image in the loop, lol i guess you may have saw my snarky comments too, maybe i was a bit rude to the guy but i was irritated by that point. But Since i like the design so much i think i will just attempt to change the entire way the loop works and make it more like regular wp.

                    High Performance Vps $10 Linode
                    Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

                    Comment

                    • tonyparra
                      Confirmed User
                      • Jul 2008
                      • 4568

                      #11
                      Originally posted by CyberSEO
                      With CyberSEO you can do it as easy as this:
                      1. go to CyberSEO->Tools;
                      2. insert the following code into the "PHP Code <?php .. ?>" box:
                        Code:
                        $thumb = get_post_meta($post->ID, "YOUR_THUMBNAIL_CUSTOM_FIELD_NAME", true);
                        cseo_attach_post_thumbnail($post->ID, $thumb, $post->post_title);
                      3. click "Apply These Modifications To All Existing Posts".


                      man i keep forgetting about this tools section on cyberseo, considering the site i get most traffic on uses cyberseo, i should it on everything for something like this at least

                      High Performance Vps $10 Linode
                      Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

                      Comment

                      • tfs
                        Confirmed User
                        • Dec 2005
                        • 624

                        #12
                        This is placeholder so I don't forget...

                        I've been using Wordpress since 2005 and - up until recently - I had been using TimThumb and/or custom fields to generate thumbnails.

                        With the "new" Wordpress, I switched all my themes to show "Featured Images" and - of course - all my thumbnails disappeared.

                        I have a script/function that will pull any image from any post and display it as a featured image or thumbnail on your homepage (if the post has an image, that is). It also has bootstrap capability that pulls images and posts to your front page like Facebook ot Pinterest and makes your homepage an never ending wall of posts.

                        I have been meaning to seperate the funcionalitly for awile. Maybe I will give it a shot this weekend.

                        It works like this theme (Ipin?), but a lot better: http://www.feedmeamateurs.com/
                        Last edited by tfs; 02-23-2013, 12:37 PM.

                        Comment

                        • just a punk
                          So fuckin' bored
                          • Jun 2003
                          • 32385

                          #13
                          Originally posted by tonyparra
                          man i keep forgetting about this tools section on cyberseo, considering the site i get most traffic on uses cyberseo, i should it on everything for something like this at least
                          You're welcome
                          Obey the Cowgod

                          Comment

                          Working...