Post as frontpage – avoid duplicate content

Your best way would be to redirect to the theme’s 404 page in the event that the page being loaded matches the slug that you are referring to. Try this: function check_undesirable_page(){ global $post; if(is_page() && ($post->post_name==”YOUR-SLUG-HERE”)){ global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( ‘wp’, ‘check_undesirable_page’ ); EDIT: Also a good idea to incorporate the … Read more

Instead of using $post, how do i get the thumbnail image of the $post

To grab the img tag as a variable: get_the_post_thumbnail ( int $post_id = null, string|array $size=”post-thumbnail”, string|array $attr=”” ) or if you want to outright echo it: the_post_thumbnail ( string|array $size=”post-thumbnail”, string|array $attr=”” ) Most things like the post content, excerpt, title etc, are acquired using functions like this so that filters and hooks can … Read more

Using ACF Custom Field value in a URL with do_shortcode() [closed]

Simply you need to replace the_field(‘video’) with get_field(‘video’). Why? Because according to ACF documentation; get_field($field_name, $post_id, $format_value) Returns the value of the specified field. Whereas on the other hand the_field($field_name, $post_id) Displays the value of the specified field. (this is the same as “echo get_field($field_name)”) Hope this might help others as well.