• Resolved Pressnoob

    (@pressnoob)


    Hey everyone so I’m in a bit of a pickle. I use rounded images in my home/index page on my posts. But when people actually click on the post itself I would like it to be a larger image without the rounded corners (And drop shadow for that matter). So I was wondering if there’s a normal way to do this. I was thinking maybe creating a function that checks the page URL say, currentpage(); that returns a variable and then making something like:

    if ($pagenow = ?php the_permalink(); then go_to_alternate_link);

    And make this into a shortcode. thumb [‘blah.jpg’, ‘blah_thumb.jpg’]

    Is there a less messier way to do this? Maybe a built in function that I missed? The problem is I’m also using an infinite scroll type layout so there is already a lot of back and forth requests being made already. I don’t want the page to be sluggish.

    THank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Pressnoob

    (@pressnoob)

    Sorry I forgot to post an example:

    https://www.takemypaycheck.com/

    It’s cool because the thumbnail is not just resized or anything. It takes the user to a page that’s completely different from the thumbnail post… How do they do that?

    Thread Starter Pressnoob

    (@pressnoob)

    Bah… I figured it out.

    I was really just looking for the excerpt function. For those noobs who also might be facing a similar problem.

    -In your index or home.php replace the_content(); with the_excerpt();
    -To enable the excerpt box line go in your admin panel click “Screen Options” near the top and tick the excerpt box.
    -To remove the 55 character limit of the excerpt (or to set your own) put this in functions.php

    <?php
    function custom_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
    ?>

    To allow shortcodes to be used in excerpt put this as well:

    <?php
    add_filter('the_excerpt', 'do_shortcode');
    ?>

    And finally to remove that ugly […] add this:

    function trim_excerpt($text) {
      return rtrim($text,'[...]');
    }
    add_filter('get_the_excerpt', 'trim_excerpt');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Alternate way to post thumbnails?’ is closed to new replies.