Conditional tag only for front of custom post type

there is an is_post_type_archive() function https://developer.wordpress.org/reference/functions/is_post_type_archive/ that will tell you if you are on the https://example.com/projects/ page. In your case you would need to use it like this is_post_type_archive( “projects” ); since “projects” is your custom post type name.

How do I add custom HTML to the content of an archive page’s posts?

Try changing the priority, there could be other filters being applied afterwards, i.e: add_filter( ‘the_content’, ‘eri_course_archive_content_filter’, 999 ); If that doesn’t work, check that the_content() is actually being called in your archive template, because for example: echo get_the_content(); will not apply any filters set on the_content

WordPress different templates for same type custom post (but different slug)

In this case, since there’s a many-to-many relationship between movies and actors, I recommend making them two separate pods with a relationship between them. See the intro video at https://pods.io/ … I don’t remember where he explains relationship fields but it’s all in there. You don’t need to use PHP if you don’t want to. … Read more

Proceed to the next video of the custom post type but remain on the same post

This seems to work for now.. Added onended=”onEndVideo()” to the video element like so. <?php $mrssfeed_url = get_post_meta(get_the_id(), ‘nowthisearth_media_url’, true);?> <video onended=”onEndVideo()” id=”nowthis-video” class=”nowthis-video” style=”” width=”1280″ height=”720″ autoplay=”true” controls> <source src=”<?php echo $mrssfeed_url ?>” type=”video/mp4″> Your browser does not support the video tag. </video> Then did this for the javascript.. function onEndVideo() { document.querySelector(“a.next-post”).click(); }

Cannot get custom post

Seems like you have a missing array in tax_query instead of ‘tax_query’ => array( ‘taxonomy’ => ‘st_tour_type’ ), should be ‘tax_query’ => array( array ( ‘taxonomy’ => ‘st_tour_type’, ‘operator’ => ‘EXISTS’ ) ), When using tax query without terms/fields we must include the “operator” property. You can check WP_Query taxonomy for more information on working … Read more

register_post_type()’s rewrite slug not working

The problem is because your rewrite argument is part of the labels, but rewrite is actually same level as the labels, so just move the rewrite to after the labels and the problem will be gone. 🙂 register_post_type(‘artwork’, array( ‘public’ => true, ‘menu_icon’ => ‘dashicons-art’, ‘labels’ => array( ‘name’ => ‘Artwork’, ‘add_new_item’ => ‘Add New … Read more

Custom Post Type – Support “author” only for admins

Thanks to TomJNowell‘s help, this would be a possible working solution: $supports = array( ‘title’, ‘editor’ ); if(current_user_can(‘delete_plugins’)){ $supports[] = ‘author’; } register_post_type(‘whatever’, array( ‘labels’ => array( ‘name’ => ‘Whatever’, ‘singular_name’ => ‘Whatever’ ), ‘supports’ => $supports, ….