Multiple instances of Featured Image Thumbnail As A Background On Homepage

Solution was to remove the style tag and and write the background styling right into the .featured_box div. Thank you to @ckhicks on Twitter for the solution, and thank you everyone else for trying to help out too <3 <?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), ‘full’ ); ?> <a href=”https://wordpress.stackexchange.com/questions/160701/<?php the_permalink(); ?>”><div class=”featured_box” style=”background: … Read more

Generate responsive post thumbnails of same size

Install plugin: https://wordpress.org/plugins/force-regenerate-thumbnails/ and regenerate all thumbnails. Or steps: Create new dimension for images: add_image_size (‘thumb-cropped’, 227, 133, true); // Set necessary sizes (true = cropped) Get images with the sizes in you function. get_the_post_thumbnail($post->ID); fix to: get_the_post_thumbnail($post->ID, ‘thumb-cropped’); Install plugin: https://wordpress.org/plugins/force-regenerate-thumbnails/ Inter in admin area and regenerate all thumbnails The end. Use all new … Read more

Image and shortcode not showing in excerpt

To get shortcodes to work in the excerpt you’ll have to add a filter to your functions.php file (found inside your theme folder). add_filter(‘the_excerpt’, ‘do_shortcode’); Your other question about the images not showing is hard to answer without knowing how your theme code is like. It has to do with how your designer build the … Read more

Thumbnails different sizes

You’re over-complicating your thumbnail code; all you need is this: if ( has_post_thumbnail () ) { the_post_thumnail( ‘preview-thumb’ ); } else { …. The problem with your version is that get_post_thumbnail_id() doesn’t accept a size parameter, so that information gets thrown away. Luckily, the_post_thumbnail() does everything you need without having to fetch the url and … Read more

Image upload error?

There is nothing like answering your own question. After more testing I have found that increasing the PHP memory_limit fixed the issue. Which would all make sense, the larger resolution of the image means more processing to compile the different sizes when uploading and saving the image. I increased it to 96M and problem gone.

How to change the value “uploaded to” in the media library (WordPress 4.0)

You’ll need to do 2 things. First, filter the current media columns. add_filter(‘manage_media_columns’ , ‘newMediaColumnNames’); function newMediaColumnNames( $columns ) { //remove the old column – optional unset( $columns[‘parent’] ); //add a new one to take it’s place $columns[‘new_uploaded_to’] = __(‘New Uploaded To’); return $columns; } I was not able to find a way to edit … Read more

Change logo image condition based on url

if (strpos($_SERVER[“REQUEST_URI”], “www.radarhh.com/stage/fr/”) !== 0): The $_SERVER[“REQUEST_URI”] typically doesn’t contain the domain name. And you should be checking if it is zero, since strpos returns the position of the string, or false if it’s not in the string. Try this instead: if ( strpos( $_SERVER[‘REQUEST_URI’], ‘/stage/fr/’ ) === 0 ) : Also, you have this … Read more