Set featured image as hero image on each page

You need to look at how your theme is rendering the hero image. Then, before it does so, add an if block which checks for a featured image. If a featured image exists, replace the hero image with it. Your code will look something like this. if ( has_post_thumbnail() ) { // render hero image … Read more

allow user to create a draft post but not publish wordpress

Use wp_insert_post_data filter. Then check the user role. If user have specific role set-up post status. ( I don’t test below script) add_filter( ‘wp_insert_post_data’, ‘filter_handler’, ’99’); function filter_handler( $data ) { $user = wp_get_current_user(); $userRole = $user->roles ? $user->roles[0] : false; if ( $userRole === ‘author’) { $data[‘post_status’] = ‘pending’; } return $data; }

Trying to show the category of a post in the post display

Use the_category(); on your template. It also supports $separator parameter so you can use your desired separator. Example: <?php the_category( ‘, ‘ ); ?> will separte categories with commas. By the look of your theme folder structure, you should add <?php the_category( ‘, ‘ ); ?> on child-theme=>template-parts=>content-excerpt.php. Add it to line 22. If you … Read more

How do I remove all links from all my posts at once?

This code is a filter, as shown by the initial add_filter call. This type of code can either be placed in a custom plugin, or a child theme or custom theme’s functions.php file. (You don’t want to place it in an existing functions.php file because whenever you update the theme, it will get lost.) It … Read more

Post not using taxonomy template

The post won’t use those templates because those aren’t intended for posts. They’re intended for the archive pages for those terms/categories/tags. What’s more, it doesn’t make sense for it to work that way as it introduces ambiguity. Case in point, if I have category-red.php and category-blue.php, which template gets loaded if I visit a post … Read more