custom post type and a “sticky” position taxonomy
custom post type and a “sticky” position taxonomy
custom post type and a “sticky” position taxonomy
WordPress Template Hierarchy is your solution. Create a template called single-abstract.php and copy the contents from single.php (Of course you’ll need to edit that template to use your HTML). WordPress now will use that template whenever the singular version displays on frontend.
Search for custom field input of a custom post type in ajax live search
May be this thread could be useful to you: Also you could explain a bit more what’s the pourpouse of those images. Are they going to be printed in the fontend or in the admin side? Do you need them to be uploaded from the frontend or they can be retrived from the wordpress media … Read more
Limit to one post for each custom post type
It might just be the late hours, but the register_taxonomy call looks wrong. Shouldn’t the second parameter be the post type you’re registering the taxonomy for? I.e. array(‘pdsh_posts’). And yes, you need to register each of the three taxonomies separately for the post type. See the codex example, https://developer.wordpress.org/reference/functions/register_taxonomy/#comment-397 Edit Actually, its probably not what … Read more
ok – so this isn’t what I wanted but it does the trick. Adding a function to redirect when the user hits any term but one: function my_page_template_redirect() { if( is_singular( ‘custom-post-type’ ) && !(has_term(‘term’, ‘custom-taxonomy’)) ) { wp_redirect( home_url(), 301 ); exit(); } } add_action( ‘template_redirect’, ‘my_page_template_redirect’ ); Answer based on this one: Disable … Read more
I think this might be part of the problem in your past query (the second one) array( ‘key’ => ‘end_date’, ‘compare’ => ‘BETWEEN’, ‘type’ => ‘NUMERIC’, ‘value’ => array($past, $now), ), You’re using BETWEEN but I think something like < would be what you want. You don’t want to show events that have ended between … Read more
There are several ways to achieve a new front page, here it goes my favorite two. if the theme already has a front-page.php, just overwrite it with the new code. if it doesnt create a front-page.php file and copy the code wanted over there. it should work like a charm. create a template, create a … Read more
Solution: I duplicated taxonomy.php template in theme folder and named it taxonomy-news-business.php then I edited the code inside this template So the result is that now all posts in CUSTOM POST TYPE with slug news with category businesss are displayed according this template because taxonomy template hierarchy in WordPress is taxonomy-{taxonomy}-{term}.php