• Resolved menchold

    (@menchold)


    I have free theme. I did it with CSS but size of featured image on stick post is 174×131 (functions.php => ‘loop’) but I want to change for 620×264 (functions.php => ‘content’) but I don’t know how I can do it…

    Image (with CSS): Image (with CSS)

Viewing 1 replies (of 1 total)
  • Michael

    (@mh-themes)

    Hello menchold,

    you can’t do this with CSS only, you will have to modify the code for the loop in content.php and use the conditional tag “is_sticky”.

    Example:

    <div class="loop-thumb">
        <?php if (is_sticky()) { ?>
            <a href="<?php the_permalink()?>"><?php the_post_thumbnail('content'); ?></a>
        <?php } else { ?>
            <a href="<?php the_permalink()?>"><?php the_post_thumbnail('loop'); ?></a>
        <?php } ?>
    </div>

    https://codex.www.ads-software.com/Function_Reference/is_sticky

    You might have to tweak the code to fit your needs and also customize some CSS to make it look good. Please note that we can’t provide free support for theme customizations.

    I recommend anyway that you use the widgetized homepage template for your front page, instead of tweaking the code like this. And if you modify the code, you should create a child theme first:

    https://codex.www.ads-software.com/Child_Themes

    Regards
    Michael

Viewing 1 replies (of 1 total)
  • The topic ‘How change image of sticky post?’ is closed to new replies.