Advanced custom fields – taxonomy terms images [closed]

OK had a go at this myself, I didn’t realise ACF was able to add fields to taxonomies which is really handy so I wanted to figure it out too. <?php $libargs=array( ‘hide_empty’ => 0, ‘parent’ => 0, ‘taxonomy’ => ‘library_categories’); $libcats=get_categories($libargs); foreach($libcats as $lc){ $termlink = get_term_link( $lc->slug, ‘library_categories’ ); ?> <a class=”single-library-cat” href=”https://wordpress.stackexchange.com/questions/71287/<?php … Read more

unable to upload image locally

You need to change the file permissions on your wp-content folder (and containing folders) to 755. On your setup you can do this with: find . -type d -exec sudo chmod 755 {} \; Please note that using chmod -R 755 will mark both directories and files as 755.

How do I add a featured image to a single post page?

In single.php, find <?php the_content(); ?> around line ~17. Just before that. paste following code. <?php if ( has_post_thumbnail() ):?> <div class=”featured-image-wrap”><?php the_post_thumbnail(); ?></div> <?php endif; ?> This will show featured image if assigned to the post. To change the size of image you can pass parameter to the function the_post_thumbnail(). See official documentation of … Read more

Find posts without featured image? [duplicate]

You can use this plugin https://wordpress.org/plugins/quick-featured-images/ In description it says “You can also see posts with no featured image at a glance.” But from code side, wordpress manages images, documents any media by creating an attachment post for holding the information about that media and it’s relation (if any) with other post/posts, which means you … Read more

Setup A Default Featured Image

One simple method is to filter post_thumbnail_html, to add in a default image link: <?php function wpse55748_filter_post_thumbnail_html( $html ) { // If there is no post thumbnail, // Return a default image if ( ” == $html ) { return ‘<img src=”‘ . get_template_directory_uri() . ‘/images/default-thumbnail.png” width=”150px” height=”100px” class=”image-size-name” />’; } // Else, return the … Read more

Remove the http protocol from images

The code you provided could cause issues with 3rd party URLs in hyperlinks not running https. You can fix this by including your home url, e.g: $content = str_replace( set_url_scheme( home_url(), ‘http’ ), set_url_scheme( home_url(), ‘relative’ ), $content); Next, you’re applying this when you’d like to display the content, which means you need to do … Read more