Modify permalink of CPT archive to support two taxonomies
Modify permalink of CPT archive to support two taxonomies
Modify permalink of CPT archive to support two taxonomies
How to display posts from IMPress for IDX Broker on home page? [closed]
An script/Plugin for automatic page creation per term
Can’t add custom post type archive page to menu
How to add categories to a custom post type using wp_insert_post($new_post);
I have no idea what a ‘block number’ is, but when themes output the date for a post they will use either the_date() or the_time() (or both). You can replace the output using the filters the_date() or the_time(): add_filter( ‘the_date’, function( $the_date, $format ) { $block_number=”whatever a block number is”; return $block_number; }, 10, 2 … Read more
You can do that using a subpattern or capturing group like ([a-z]) in your rewrite rule’s regex (i.e. regular expression pattern, which is the 1st parameter for add_rewrite_rule()), and then use $matches[<n>] in your query (the 2nd parameter for add_rewrite_rule()), where <n> is a number (1 or above) and it’s the subpattern’s position number. Why … Read more
The registration code was called inside the is_admin(). Moving the code outside solved the issue. /*if(is_admin()) {*/ $this->sconfig= [‘post_type’=> ‘event’, ‘slug’=>’events’]; add_action(‘init’, array($this, ‘register_event_posttype’)); /*}*/
Yes, it’s not hard to do that. Just register your post type and enable rewriting for that post type, i.e. set rewrite to true. Once registered, modify its permalink structure like so: global $wp_rewrite; $wp_rewrite->extra_permastructs[‘<post type>’][‘struct’] = ‘<your structure here>’; Use the post_type_link filter to replace rewrite tags like %post_id% in the permalink URL. If … Read more
I believe that the only sensible place to rename a menu item is the add_menu_classes filter hook. It has a different destiny, but I can’t see any other place. Hook passes an array of first-level menu items as a parameter to the function. The array elements look like this: $menu = [ 5 => Array … Read more