Viewing 14 replies - 16 through 29 (of 29 total)
  • Why are we doing thing in the media settings ? I mean, if you want to make use of that setting, there will be no need to use add_image_size, this is mentioned in my very first post.

    So, do you want to make use of media setting ? or you want to register new image size in function ?

    and did you mark that post as sticky ? There is no sticky class in the post section still.

    Thread Starter bettyjohnson

    (@bettyjohnson)

    I thought it was going to show in the media uploader?

    Ok, lets focus on the new add_image_size.
    I have marked the current post as sticky!

    Thread Starter bettyjohnson

    (@bettyjohnson)

    The image shows as 257×300 and the text is still on the right hand side of the image instead of underneath.

    I haven’t done anything in style.css to .sticky yet….

    In the functions.php, could you change this

    add_image_size( 'front-feature', 600, 300 );

    to this

    add_image_size( 'front-feature', 600, 300, true );

    and go configure the Regen plugin again ( just for this one image for now ), the “true” is to make sure that the image is cropped exactly, I forgot about it earlier.

    Thread Starter bettyjohnson

    (@bettyjohnson)

    ok, looks good so far, since I want the entire image to show as sticky I changed the size to 600×700.

    How do I set the text to show below the image?

    .post.sticky .thumbnail,
    .post.sticky .post-content { float:none; width:600px; display:block; }
    .post.sticky .post-content { margin-top:20px; }
    Thread Starter bettyjohnson

    (@bettyjohnson)

    Awesome, it looks great.
    Thank you so much for helping me. I sure learned something new.

    Thread Starter bettyjohnson

    (@bettyjohnson)

    Ah, one more thing before we close this topic.

    Is there a way I can code my functions.php so it sets the post to regular view, as soon as I publish a new post?

    Maybe there is a way, but that I don’t know how.

    Try posting a new topic under How-To and Troubleshooting or Plugins and Hacks. There will be more chance to get answer for this.

    Thread Starter bettyjohnson

    (@bettyjohnson)

    ok, thanks

    What I would do is to set a variable to true before the loop like this

    <?php $first = true; ?>
    	<?php if ( have_posts() ) : ?>
    		<?php while ( have_posts() ) : the_post(); ?>

    and use it in the if check along with the sticky, then reset it to false right after the call to image like this

    <?php
    	if ( ( $first ) || is_sticky ( $post->ID ) ) {
    		the_post_thumbnail('front-feature', array( 'title' => get_the_title() ));
    	} else {
    		the_post_thumbnail((array(150,150)), array( 'title' => get_the_title() ));
    	}
    ?>
    <?php $first = false; ?>

    and in the stylesheet, make use of :first-child to share the same properties with whatever .sticky is having.

    #content div.post:first-child .thumbnail,
    #content div.post:first-child .post-content { float:none; width:600px; display:block; }
    #content div.post:first-child .post-content { margin-top:20px; }

    Then I get this featured first (latest) post that respects sticky option too.

    Thread Starter bettyjohnson

    (@bettyjohnson)

    Hi paulwpxp,

    I have to get your help one more time! I had to move my hosting and also changed my domain, after installing and uploading all files, everything seems fine except the featured post image, the image is not showing as 600×1000 as I set it previously.

    Could you please take another look: https://oheverythinghandmade.com

    Thanks
    Betty

    From a look at the html source, the image in the featured section is 150×150. This implies that there is no image size with the name of front-feature.

    Could you verify that index.php (or whatever template that you did make that changes) and functions.php in used are the same as before.

    Thread Starter bettyjohnson

    (@bettyjohnson)

    Yes, you are right. The post-detail.php file had a code for the image incl. that I totally missed. Thank you for pointing that out to me.

Viewing 14 replies - 16 through 29 (of 29 total)
  • The topic ‘How to create a featured post?’ is closed to new replies.