Activity Stream
48,167 MEMBERS
64717 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34
  1.     
    #21
    Member
    you just have to remove that "<?php" on top

  2.     
    #22
    Banned
    after deleting what u said and adding the code..

    here's the effect..


    complete broke my blog..

    Please help.

  3.   Sponsored Links

  4.     
    #23
    Member
    Website's:
    scrls.co.uk
    Undo 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.

  5.     
    #24
    Banned
    my timthumb. is located in

    public_html/domain.og/wp-content/themes/BlueCorner

  6.     
    #25
    Member
    Website's:
    scrls.co.uk
    Yeah 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.

  7.     
    #26
    Banned
    yes or can you help me do it via teamviewer to make sure please??

    Please add me

    nixshare@yahoo.com

  8.     
    #27
    Member
    Website's:
    scrls.co.uk
    Have 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
    1. //Get images attached to the post
    2. $args = array(
    3. 'post_type' => 'attachment',
    4. 'post_mime_type' => 'image',
    5. 'numberposts' => -1,
    6. 'order' => 'ASC',
    7. 'post_status' => null,
    8. 'post_parent' => $post->ID
    9. );
    10. $attachments = get_posts($args);
    11. if ($attachments) {
    12. foreach ($attachments as $attachment) {
    13. $img = wp_get_attachment_thumb_url( $attachment->ID );
    14. break;
    15. }
    16. //Display image
    17. }
    18. ?>
    Code Explanation: Firstly we fetch the images attached to the post in the order they were added to the post and if images are there we fetch the path to the thumbnail image of the first image in the post using wp_get_attachment_thumb_url function.
    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;
    }
    Once done, you can simply call the function within the loop to display the first image from the post:
    <?php echo catch_that_image() ?>

  9.     
    #28
    Banned
    Inside the Post Ive got my image..



    but in homepage..



    still same..no thumbnail.

    brazzo can you please do it for me I would be willing to pay for all the trouble Ive cause you..

    Please.

  10.     
    #29
    Member
    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 page Noobish act


  11.     
    #30
    Banned
    yes I'm a newbie sorry for that..

    also Pmed you m8.

Page 3 of 4 FirstFirst 1234 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Hiring] Wordpress blog coder and Designer
    By Movienmasti in forum Marketplace (Buy, Sell and Trade)
    Replies: 2
    Last Post: 20th May 2012, 07:16 PM
  2. Replies: 0
    Last Post: 8th Jun 2011, 03:50 AM
  3. [Hiring] Coder to code 2 Wordpress Template 50-100$
    By alex17 in forum Completed Transactions
    Replies: 4
    Last Post: 2nd Jun 2011, 06:33 AM
  4. [Hiring] Coder for a little Code Change (Add nofollow + open new tab)
    By Ryza in forum Completed Transactions
    Replies: 8
    Last Post: 11th Mar 2011, 01:48 PM
  5. [Hiring] Coder, for a little code change in a wordpress blog
    By Ryza in forum Completed Transactions
    Replies: 3
    Last Post: 22nd Feb 2011, 04:26 AM

Tags for this Thread

BE SOCIAL