help me to display featured image of specific post by post id

You can use get_the_post_thumbnail like this: <?php $mypost = get_post(28); echo apply_filters(‘the_content’,$mypost->post_content); ?> <?php $mypost = get_post(28); echo apply_filters(‘website’,$mypost->website); echo apply_filters(‘titleback’,$mypost->titleback); echo apply_filters(‘contentback’,$mypost->contentback); echo get_the_post_thumbnail( $mypost->ID, ‘thumbnail’); ?>

Add tags to a “pending” post before publishing

The @PieterGoosen’s answer saved my life: add_action( ‘transition_post_status’, function ( $new_status, $old_status, $post ) { if( ‘publish’ == $new_status && ‘advert_tmp’ == $old_status && $post->post_type == ‘advert’ ) { $tags = get_post_meta( $post->ID, ‘advert_tags_field’, true ); $tags = explode( ‘,’, $tags ); if( !empty( $tags ) ) { wp_set_object_terms( $post->ID, $tags, ‘advert_tag’ ); delete_post_meta( $post->ID, … Read more

How to mark posts as visited

You can add a special custom field when a logged user visits any page. A way to do this without editing the template file, is to use the filter the_content add_filter(‘the_content’, ‘wpse_259159’); function wpse_259159($content){ // check the user ID $current_user = wp_get_current_user(); if ( 0 == $current_user->ID ) { // Not logged in. } else … Read more