How to use two different pages to see the post content?
If they are separate post types you can use WP’s theme file structure. More info: https://developer.wordpress.org/themes/basics/template-hierarchy/
If they are separate post types you can use WP’s theme file structure. More info: https://developer.wordpress.org/themes/basics/template-hierarchy/
It is not exactly the answer but here it will get formatted better than in the comments section. To solve your problem I would start with the simplest possibile working set. Then line by line I would extend the solution checking if it still works after each step. You could start with: function custom_post_types() { … Read more
How can I remove “Add new” button on custom post type
This is the original answer but it is little faulty, look below for the updated You can use following approach. The my_action_updated_post_meta is executed after the post insert or update is done: // define the updated_post_meta callback function my_action_updated_post_meta( $array, $int, $int ) { global $post; // see your updated post print_r($post); // make your … Read more
Please try this modification of your code: $args = array( ‘post_type’ => ‘immobili’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘immobili_categories’, ‘field’ => ‘slug’, ‘terms’ => ‘realizzazioni’, ), ), ); // The Query $query = new WP_Query( $args );
You could do this pretty easily a couple of different ways. My preference would be with jQuery, but others could make an argument against that route and for php. Here is the way you could get it done with jQuery: $(document).ready(function(){ $( “.entry-tags a:contains(‘easy’)” ).html( “<img src=”https://image.url”>”); });
Custom Field as Custom Post type element class
function rt_custom_post() { register_post_type( ‘book’, array( ‘labels’ => array( ‘name’ => __( ‘Books’ ), ‘singular_name’ => __( ‘Book’ ), ), ‘public’ => true, ‘has_archive’ => false, //this will eliminate the archive page ‘supports’ => array(‘title’,’editor’,’thumbnail’), ‘publicly_queryable’ => true ) ); if you add : ‘has_archive’ => false, to your register post type, it will remove … Read more
Custom rewrite tags have to be added before they can be used in permalinks, otherwise WP will not be able to parse those rules. function your_init_function(){ add_rewrite_tag( ‘%category_type%’, ‘([^&]+)’ ); // register your post type…. }
Check if the array contains a category not tested live but is valid PHP <?php $myquery[‘tax_query’] = array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘category’, ‘category__not_in’ => array(‘explore’), ‘field’ => ‘slug’, ), array( ‘taxonomy’ => ‘category’, ‘terms’ => array(‘outdoor-recreation’), ‘field’ => ‘slug’, ), array( ‘taxonomy’ => ‘take_category’, ‘terms’ => array(‘outdoor-recreation’), ‘field’ => ‘slug’, ), array( … Read more