Results 21 to 30 of 34
-
18th Feb 2011, 04:40 AM #21Member
you just have to remove that "<?php" on top
-
18th Feb 2011, 04:52 AM #22OPBanned
-
18th Feb 2011, 04:56 AM #23MemberWebsite's:
scrls.co.ukUndo what you did then so the blog fix's
First off have you got "timbthumb" on your theme that you are using, like so.
ProtoWorker basically layed it out on a plate for you.
That is what i done for my blog & it works perfectly, i done mine a while ago though.
-
18th Feb 2011, 04:59 AM #24OPBanned
my timthumb. is located in
public_html/domain.og/wp-content/themes/BlueCorner
-
18th Feb 2011, 05:02 AM #25MemberWebsite's:
scrls.co.ukYeah thats right..
I don't see why it isn't working for you then, are you sure you are following the steps above correctly.
Have you tried chmodded the script to 777, i didn't have to do this but you never know with you.
-
18th Feb 2011, 05:06 AM #26OPBanned
yes or can you help me do it via teamviewer to make sure please??
Please add me
nixshare@yahoo.com
-
18th Feb 2011, 05:11 AM #27MemberWebsite's:
scrls.co.ukHave you set your "media settings" ?
Make sure you have this as follows:
Now open up index.php of your WordPress theme and inside the WordPress loop, add the following lines of code to get the path of thumbnail image of the first image in the post.
<?php
- //Get images attached to the post
- $args = array(
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'numberposts' => -1,
- 'order' => 'ASC',
- 'post_status' => null,
- 'post_parent' => $post->ID
- );
- $attachments = get_posts($args);
- if ($attachments) {
- foreach ($attachments as $attachment) {
- $img = wp_get_attachment_thumb_url( $attachment->ID );
- break;
- }
- //Display image
- }
- ?>
Now you have path of the image in $img which you can use to display the post thumbnail using img tag.
try this out also, might work for you, doesn't use the timthumb .. just another method.
Another method of foing this would be as follows:
First, paste this function on your functions.php file.
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
$first_img = "/images/default.jpg";
}
return $first_img;
}
<?php echo catch_that_image() ?>
-
18th Feb 2011, 05:23 AM #28OPBanned
-
18th Feb 2011, 11:01 AM #29Member
Hi can you let me know your index.php structure? Also please let me know the URL to your blog.
Mate, you need to add the snippet at the place where you want the resized image to be placed, not at the top of the pageNoobish act
-
18th Feb 2011, 11:05 AM #30OPBanned
yes I'm a newbie sorry for that..
also Pmed you m8.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Hiring] Wordpress blog coder and Designer
By Movienmasti in forum Marketplace (Buy, Sell and Trade)Replies: 2Last Post: 20th May 2012, 07:16 PM -
Little code Change for a Clickable Links in Wordpress (Plugin)
By Ryza in forum Web Development AreaReplies: 0Last Post: 8th Jun 2011, 03:50 AM -
[Hiring] Coder to code 2 Wordpress Template 50-100$
By alex17 in forum Completed TransactionsReplies: 4Last Post: 2nd Jun 2011, 06:33 AM -
[Hiring] Coder for a little Code Change (Add nofollow + open new tab)
By Ryza in forum Completed TransactionsReplies: 8Last Post: 11th Mar 2011, 01:48 PM -
[Hiring] Coder, for a little code change in a wordpress blog
By Ryza in forum Completed TransactionsReplies: 3Last Post: 22nd Feb 2011, 04:26 AM
themaPoster - post to forums and...
Version 5.38 released. Open older version (or...