Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-22-2013, 07:58 AM   #1
tonyparra
Confirmed User
 
tonyparra's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-22-2013, 08:54 AM   #2
tonyparra
Confirmed User
 
tonyparra's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
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
tonyparra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-22-2013, 09:27 AM   #3
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
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.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-22-2013, 10:25 PM   #4
tonyparra
Confirmed User
 
tonyparra's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
Quote:
Originally Posted by fris View Post
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
tonyparra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-22-2013, 10:33 PM   #5
tonyparra
Confirmed User
 
tonyparra's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
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
tonyparra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-22-2013, 11:17 PM   #6
scouser
marketer.
 
Industry Role:
Join Date: Aug 2006
Location: bcn
Posts: 2,280
does calling

get_the_image()

not work? just do

<? echo get_the_image(); ?> from within the loop. does that not output ur pic?
scouser is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-22-2013, 11:24 PM   #7
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
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..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-22-2013, 11:37 PM   #8
buzzard
Confirmed User
 
buzzard's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: Midwest
Posts: 1,276
Make a csv file for your images and then import the csv,
you could also do an auto featured image import
__________________
buzzard is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2013, 01:21 AM   #9
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,384
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
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2013, 09:26 AM   #10
tonyparra
Confirmed User
 
tonyparra's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
Quote:
Originally Posted by Colmike7 View Post
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
tonyparra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2013, 09:57 AM   #11
tonyparra
Confirmed User
 
tonyparra's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
Quote:
Originally Posted by CyberSEO View Post
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
tonyparra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2013, 02:36 PM   #12
tfs
Confirmed User
 
Join Date: Dec 2005
Location: Toronto
Posts: 624
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 at 02:37 PM..
tfs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2013, 01:57 AM   #13
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,384
Quote:
Originally Posted by tonyparra View Post
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
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.