Tag Info

Hot answers tagged

2

You need to set ignore_sticky_posts to true in your query arguments. This way you exclude sticky posts and only focus on the post ID's array being passed to post_in 'ignore_sticky_posts' => true, EDIT If this does not make much sense, please see my answer here to similar question where I have explained it a bit better. Be sure to check it out THE ...


2

Look in your theme folder for a file called content.php. Make a copy and rename it to anything you like, such as vega.php. Adjust the code in vega.php to your liking. Change the call in index.php to get_template_part( 'vega', get_post_format() );


1

You are not providing a correct attachement ID. Replace: $image_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true); With: $image_alt = get_post_meta( $image->id, '_wp_attachment_image_alt', true); Note: I assume that $image->id is correct because you use it later in your code and you get the expected result. Unfortunatley ...


1

You should define add_image_size with fourth parameter to allow WordPress to crop your image to exact size. add_image_size ( 'single_post', 500, 200, true); Whether to crop images to specified height and width or resize Difference between soft and hard crop false - Soft proportional crop mode. true - Hard crop mode. array - Specify positioning of the ...


1

You may use the css hide one of the images for now until you figure it out. Coz nothing is clear from above code Add these lines to your style.css .entry-header figure{ display: none !important; } refresh your cache and you will the problem fixed


1

If you use the following code you may fix your problem. Give it a try.Paste this in your post.php <?php if ( current_theme_supports( 'get-the-image' ) ): $image_full=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'full'); $image_thumbnail=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'single-thumbnail'); ...


1

You can get image url with wp_get_attachment_image_src and use in href. It's most often used to get the URL (src) for an image attachment: use the first element in the returned array. So instead of your code for featured thumbnail, you should use this. <?php if ( current_theme_supports( 'get-the-image' ) ) { $fullimage = ...



Only top voted, non community-wiki answers of a minimum length are eligible