ThemeShaper Forums » Thematic

[closed]

Post image above the post title?

(14 posts)
  • Started 12 years ago by aoda
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. aoda
    Member

    First of all, thank you for this wonderful theme -- and these forums have been awesome in helping me try and figure things out.

    I'm wondering if having the post image above the post title, date, etc. is possible.

    Thank you.

    Posted 12 years ago #
  2. Hey .. are you looking for something like this?

    Cheers,

    Chris

    Posted 12 years ago #
  3. aoda
    Member

    Thanks, Chris. As you probably know, I'm very new to this. I copied the code into my style.css, but nothing changed. Just to be clear, I don't want a thumbnail image about the post title, but the full image to appear first.

    Thanks again for all your help.

    Posted 12 years ago #
  4. Ok .. please read "Using Custom Fields « WordPress Codex" first.

    In the link mentioned in my post above, the field name is "thumbnail", which means nothing at all .. this is just a field name and has nothing to do with its value .. if you enter a value representing a thumbnail file thats fine .. if it is the name of a full sized photo that's fine too .. as I said .. it's just a name, important is the value.

    The code I posted in "Introducing custom fields into Thematic" is PHP and goes into your child theme's functions.php.

    Your style.css is a CSS file and contains styling information only. For more information 'bout CSS read the HTML Dog CSS Beginner Tutorial.

    Cheers,

    Chris

    Posted 12 years ago #
  5. aoda
    Member

    Chris, thanks for clarifying for me. I copied the code into my functions.php and nothing happened. I know I must be missing something. Can you help?

    Posted 12 years ago #
  6. Don't know ..

    - have you copied the image files to wp-content/uploads?
    - have you created a custom field "thumbnail" in your post and added the name (incl. extension) of one of the copied image files?

    Cheers,

    Chris

    Posted 12 years ago #
  7. aoda
    Member

    Yes, I've done both. I also modified the code to specify the folder inside the "uploads" folder that the images are buried in. Which leads me to question (since WP organizes this by year, then month) how I would need to change this once WP creates new folders for images...

    Also just want to be sure —— since I want the image to always appear before the post title, I would need to create a value for each post? I was hoping there was a way to change this broadly, rather than for each post.

    I'm not sure if any of this is clear. But here's a link to my site —— thanks so much for your help. http://www.humblebeanblog.com/

    Posted 12 years ago #
  8. Obvious .. looking into the html source I can see that '/wp-content/uploads/2009/03' is missing the trailing slash .. next .. none of your posts contains a custom field named 'thumbnail' with a image name as value ..

    Regarding the changing subdirectories : keep the code as it was and add the subdirectories as a value so: instead of test22.jpg you enter 2009/03/test22.jpg

    Change it broadly? How should the function know which picture it should load? Only way would be to name the pictures according to the post-id and drop them into one directory.

    Cheers,

    Chris

    Posted 12 years ago #
  9. aoda
    Member

    Chris, thank you so much for your patience. I realized my error: I was entering "Thumbnail" and not all in lower case. Thanks again for your help. It worked beautifully.

    Posted 12 years ago #
  10. Sounds great :-)

    Posted 12 years ago #
  11. tunetosuraj
    Member

    @chris Well I don't really know how to use the shortcode for this. Should I put it like [thematic_postheader thumbnail="/2010/03/img.jpg"] or something else in the post?

    Posted 10 years ago #
  12. wow you sure dug up an old post. shortcodes? there is no shortcode to use for this. it is all hooks and filters..... filtering thematic_posttitle i think will be best here. you sound like you need a large introductory dose of the basics. start w/ some of the links and explanations i provided here:

    http://forums.themeshaper.com/topic/need-help-understanding-actions-vs-filters-and-changing-post-meta-and-utility#post-22638

    Posted 10 years ago #
  13. I'm also having trouble with this. I enabled the featured image function

    if (function_exists('add_theme_support')) {
        add_theme_support('post-thumbnails', array( 'post', 'page' ) );
        add_image_size('index-categories', 540, 250, true);
        add_image_size('page-single', 540, 250, true);
    }
    
    function InsertFeaturedImage($content) {
    
    global $post;
    
    $original_content = $content;
    
        if ( current_theme_supports( 'post-thumbnails' ) ) {
    
            if ((is_page()) || (is_single())) {
                $content = the_post_thumbnail('page-single');
                $content .= $original_content;
                } else {
                $content = the_post_thumbnail('index-categories');
                $content .= $original_content;
            }
    
        }
        return $content;
    }
    
    add_filter( 'the_content', 'InsertFeaturedImage' );

    But i want to move it above my entry title. any help?

    Posted 9 years ago #
  14. you don't need to add_theme_support for thumbnails as thematic has already done that. and you should probably start a new post and explain exactly what you are trying to do: where you want the thumbnails, what you've tried, why it isn't working like you'd expect, etc

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.