ThemeShaper Forums » Thematic


Post Thumbnail with Permalink

(3 posts)
  • Started 11 years ago by cannobbio
  • Latest reply from cannobbio
  • This topic is not resolved
  1. cannobbio

    I managed to get post thumbnails in my theme.

    function childtheme_content($content) {
    if ( is_home() || is_archive() || is_search() ) {
    $content= 'excerpt';}
    return $content;
    add_filter('thematic_content', 'childtheme_content');

    if ( function_exists( 'add_theme_support' ) )
    add_theme_support( 'post-thumbnails' );

    function my_post_title($title) {
    if (is_home() || is_archive() || is_search()) {
    return get_the_post_thumbnail(NULL, 'thumbnail') . $title;
    else {
    return $title;
    add_filter('thematic_postheader_posttitle', 'my_post_title');

    Can anyone help me to make that image have the permalink with their corresponding clases?

    As you can see what I'm trying to do is to have excerpts in home, archives and search pages with a post image, and the post image with a permalink.

    I'm using the Advanced Excerpt plugin, to force excerpts lenghts to be the same in posts or pages that have excerpts and post or pages that don't. It also solves stripping shortcodes, customizing the ellipsis character, it adds a custom "Read More" link, and removes all the markup you don't wan't to use (or keep it).

    Is anyone doing all this with just functions?
    I've tryed all sorts of ways found in the forum, but I really suck at php.

    Thank you!

    Posted 11 years ago #
  2. Unsure about a specific function but when setting the thumbnail to the post in admin, just set the link url to 'post url'.

    Posted 11 years ago #
  3. cannobbio

    It doesn't work that way because the image is put there by the function.
    I need to wrap this:

    return get_the_post_thumbnail(NULL, 'thumbnail') . $title;

    with the post permalink.

    I just don't know how to do that in PHP.

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.