set and unset the custom field value

While showing all the posts together in admin panel, I have a custom column ‘Featured Image’. And this column has a value YesOrNO. To set the column name : I have inside functions.php: function set_column_heading($defaults) { $defaults[‘featured_image’] = ‘Featured Image’; return $defaults; } add_filter(‘manage_posts_columns’, ‘set_column_heading’); In order to set the column value, I have : … Read more

How to make thumbnail image fit into a div where image dimentions are completely different?

I defined a div which is 200px * 200px for my thumbnails using the code below in my index.php file: <ul> <?php $my_query = new WP_Query(‘showposts=10&cat=3’); while ($my_query->have_posts()): $my_query->the_post(); $do_not_duplicate = $post->ID;?> <div id=”posts”> <div id=”post-thumbnail”> <?php the_post_thumbnail( ‘post-thumbnail’); ?> </div> <div id=”post-content”> </div> <div id=”post-tags”> <li> <a href=”https://wordpress.stackexchange.com/questions/270984/<?php the_permalink(); ?>”><?php the_title(); ?></a> </li> </div> … Read more

Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type

For a WordPress project I made a Custom Post Type in the usual manner. Also i made a custom role. I want users with that role to be able to make, edit and delete this CPT. I added the apropriate capabilities to this role. These are the caps: ‘level_1’ => true, // seems necessary to … Read more

Get image of latest post from taxonomies/categories

I have a custom post type “Artworks” with a custom taxonomy “Artists”. I have a page where I list all the entries from the “Artists” taxonomy (Artist 1, Artist 2, Artist 3, etc.). How can I get the picture from the latest post in each category (Artist 1, Artist 2, etc.)? That’s how I list … Read more