Tag Info

New answers tagged

0

After trying to ask help from others, I got my solution and here I am sharing that below. First there is no use of 'in_same_cat' => false, in upper code and second get_next_post(true);, get_previous_post(true); is used to show next/prev post from current post categories but if you want to show all posts in next/prev then you have to use only ...


0

Lazy Load really does not require no coding, you can use the Lazy Load plugin (just activate it). I also suggest providing different thumbnail sizes on the basis of the required dimension for the position (and you could even deliver them differently on the basis of the screen size, if you wish, to allow rensponsive themes work well). Other ideas can be ...


0

Check out get_the_post_thumbnail() $image_thumb = get_the_post_thumbnail( get_the_ID(), 'thumbnail'); Here's a more specific example: while (have_posts()) : the_post(); echo '<article class="search-entry clearfix">'; $image_thumb = get_the_post_thumbnail( get_the_ID(), 'thumbnail'); echo ( $image_thumb ) ? sprintf('<a href="%s" ...


1

I found the solution from a Wordpress forum and this is what they used. Works perfect <?php if (has_post_thumbnail( $post->ID ) ): ?> <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), '' ); $image = $image[0]; ?> <?php else : $image = get_bloginfo('stylesheet_directory') . ...


2

Since this is a plugin, it's probably going to get axed, but generally speaking in WordPress if you want to get a posts featured image and you have access to the post ID (which I'm assuming you do), you can always do this: $thumb_url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); So without looking at the plugin, it looks like you might ...


0

well, what i did finally is to use taxonomies instead of aggregation because cron based solutions are a little bit tricky with server resources and might reduce the performance: install taxonomies plugin add a code to it to attach the blogid of the post as custom field when saving the post add a function to your theme's functions.php that pulls the image ...


0

I Used Regenerate Thumbnails plugin to generate thumbnails


0

I accomplished this by first hooking into the 'current_screen' action and making a determination if my post_type was set, then adding the filter. There may be a shorter way but this works if you need to change the text only on a given post type. public function set_featured_image_filter(){ $screen = get_current_screen(); if( ...


2

First get the registered image sizes and the featured image attachment id: $sizes = get_intermediate_image_sizes(); $post_thumbnail_id = get_post_thumbnail_id(); Loop through the registered sizes and create an array: $images = array(); foreach ( $sizes as $size ) { $images[] = wp_get_attachment_image_src( $post_thumbnail_id, $size ); } Combined as ...


1

You are using wrong Comparison Operators. Use else if($author_id == "2") { instead of else if($author_id = "2") { Edit: Try adding trailing slash after get_stylesheet_directory_uri function. its missing in your code. <img src="<?php echo get_stylesheet_directory_uri() ?>/images/default-thumb.jpg" alt="" title="" width="" height="" />


0

So the quickest and easiest way to resolve this is to add and run the plugin Regenerate Thumbnails as Pieter Goosen suggested. Back up your db first!



Top 50 recent answers are included