WP keeps looking up post thumbnail on https even though wp-config says http
WP keeps looking up post thumbnail on https even though wp-config says http
WP keeps looking up post thumbnail on https even though wp-config says http
The WooCommerce Shop page is a post type archive. It’s not outside of WP, it’s just managed within either the plugin or the theme, rather than as a “Page” or other post type. Similar to how Post Categories are handled. Since the Shop page is an archive, its loop/query identifies Products. That’s why it’s getting … Read more
Try to replace the block in the middle of the query with this code: <?php if ( has_post_thumbnail()) { the_post_thumbnail(); } else { the_title( ‘<h4>’, ‘</h4>’); } ?>
I’m not sure about your question, but the below code is more correct. $attr = array( ‘title’ => get_the_title(), ‘alt’ => ‘a nice view of the ocean’, ); echo sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/281220/%s”>%s</a>’, get_the_permalink(), get_the_post_thumbnail( null, ‘post-thumbnail’, $attr ) );
Ok guys.. I got it finally working with my below code. function wpse55748_filter_post_thumbnail_html( $html ) { // If there is no post thumbnail, // Return a default image global $post; $pID = $post->ID; $thumb = ‘large’; $imgsrc = FALSE; if (has_post_thumbnail()) { $imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($pID),$thumb); $imgsrc = $imgsrc[0]; } elseif ($postimages = get_children(“post_parent=$pID&post_type=attachment&post_mime_type=image&numberposts=0”)) { foreach($postimages … Read more
from the support forum of that plugin: Your cpt may not be registered correctly. Try adding this to your functions.php (change “event” to your post type slug): add_filter( ‘register_post_type_args’, function( $args, $post_type ) { if( ‘event’ === $post_type ) { $args[‘show_in_rest’] = true; } return $args; }, 10, 2 ); or make sure that you … Read more
The only way to build what I did was to use different WP_Queries. I ran in to a few issues because I wanted to use the same layout for viewing categories. I know this isn’t much of an answer so I did sign up on the github network and post a gist of it: full … Read more
When you are in the loop, you can access the current loop item’s index by using the current_post method. You didn’t post any code, so I’m just going for a simple demonstration. If ( have_posts() ) { while( have_posts() ){ the_post(); // Setting the global $wp_query to access the method global $wp_query; // Get the … Read more
You can do this by calling a javascript file for admin. Create a javascript file in js folder in you current theme called admin.js. inside the file add this code: jQuery(document).ready(function($) { $(‘#postimagediv .inside’).prepend(‘<p>Recommended image size 300*300px</p>’); }); Now in functions.php in your current theme folder add this code to call the javascript file exclusive … Read more
how to link post-thumbnail to original img in a lightbox?