How to make nested custom post type slugs work
How to make nested custom post type slugs work
How to make nested custom post type slugs work
If I’m understanding your question correctly, you want to avoid code duplication among the three CPT archive and three taxonomy template files? If the point is primarily one of avoidance of code duplication (i.e. DRY – Don’t Repeat Yourself), I would recommend creating template part files for the loop content for each CPT: content-{cpt1}.php content-{cpt2}.php … Read more
You’re defining your $kjdz_adress_meta_box in one function, and referencing it in another. Just keep it in the function where you’re trying to use it and that might fix it. Or define it elsewhere if you need it in more than one function. I don’t think a $global call will necessarily transcend a function.
Got it. It simply required echo in the call. <p>Author: <?php echo types_render_field( “author”, array( ) ) ?></p>
That’s a lot of queries! Have you considered running the query once and using something like mixitup or isotope to sort your results?
My suggestion would be create a simple list of pages by yourself and then tag on the archives you want. You can use get_post_type_archive_link() to grab the link of any archive you need. If you could explain more about what it is you need exactly I can knock up some example code for you.
The structure of this is kind of weird. But your main issue is that the wp_enqueue_scripts action runs before any calls to gps_slider() can possibly happen. Hook your script localization to the wp_footer action instead, so the slideshow data in the page already exists and has been output. Additionally you’ll have to make your slideshow … Read more
I would store as a custom field, like you say as a timestamp or ISO 8601 (YYYY-MM-DD). That way you can leverage WP_Query’s Custom Field Parameters for queries within your theme files. For instance: // Get posts where the custom field is less than the current time $foo = new WP_Query(array( // other query vars… … Read more
It’s a bit simpler to let WordPress handle generating the permastruct when you register your post type. I also recommend against using global variables, there are API functions for most of what you need to accomplish with the rewrite class. function magazine_issues_rewrite() { add_rewrite_tag( ‘%issuenumber%’, ‘([^&]+)’ ); add_rewrite_tag( ‘%issueyear%’, ‘([^&]+)’ ); // post type registration, … Read more
Meta Boxes are what you need. function add_custom_meta_box() { add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args ); } add_action( ‘add_meta_boxes’, ‘add_custom_meta_box’ ); Set the custom post type in the 4th parameter. This should get you started: Custom Meta Box in WordPress Post Pages and Custom Post Type