Link From Single Post To Taxonomy Term Archive Page
Seems like a good use for get_the_term_list() https://codex.wordpress.org/Function_Reference/get_the_term_list
Seems like a good use for get_the_term_list() https://codex.wordpress.org/Function_Reference/get_the_term_list
Try adding array( $this, ‘myskills_html’ ) to the third argument. public function skillsmetabox_init() { add_meta_box( ‘myskills_meta’, ‘Proficiency’, array( $this, ‘myskills_html’ ) ); } Since this is class method, it should have the $this as well. The same way you did with add_action( ‘save_post’, array( $this, ‘save_metabox_details’ ) );
You can add anything up there with the ‘in_admin_header’ action. Example (pseudo code): add_action( ‘in_admin_header’, function() { if ( … check $post_type, $pagenow etc, to target right page only … ) { echo ‘<p>Hello editor</p>’; } } );
If you need to do this conversion in PHP, as part of whatever import process, then you can just convert the comma-separated values into an array with explode(), and then use update_post_meta(), which will automatically serialise the value for you: $value=”Morning,Daytime”; $array = explode( ‘,’, $value ); update_post_meta( $post_id, ‘hours_of_operation’, $array ); Use trim() if … Read more
Just in case anyone ever stumbles across this, I found the solution. First step was to create an archive.php page In there I would access the loop. The in functions.php I have a category rewrite filter to update the category rewrite rules to use the following example url index.php?wpdmcategory=category-name&paged=2 when I hit /category-name/page/2 Previously, it … Read more
category_name should take a string, not an array I believe post_type is not mentioned as an arg, and thus defaults to ‘post’ so try: $args = array( ‘post_type’ => ‘any’, //or use cpt slug as string, or array of strings if multiple ‘category_name’ => ‘budget’, //use ‘budget,premium’ if you want posts with budget OR premium, … Read more
Option 1: Enable the post type archives and use a post type archive template. Enable the archives; e.g. when registering the post type using register_post_type(): register_post_type( ‘shop’, [ ‘has_archive’ => ‘shop’, // the archives are accessible at example.com/shop // … ] ); Then create a custom archive template just for that post type; i.e. archive-shop.php. … Read more
IFTTT works from RSS feed, simply including your post in wordpress RSS feed can do the trick… function add_cpt_to_loop_and_feed( $query ) { if ( is_home() && $query->is_main_query() || is_feed() ) $query->set( ‘post_type’, array( ‘post’, ‘download’ ) ); return $query; }
Is this a sequence mismatch between the hooks? I would argue so, yes. acf/init gets executed by class ACF’s init method, all in the root file acf.php – this method is hooked to WordPress’ init with a priority of 5 like so add_action( ‘init’, array($this, ‘init’), 5 ); And you probably add your CPTs with … Read more
You will be rejected from the WordPress.org theme direcotry if you include these post types in the theme. The guidelines, which are available here, state: Non-design related functionality is not allowed. (See: Plugin territory examples) And one of the examples is: Custom Post Types and Shortcodes Regarding TGM, the guidelines have this to say: Themes … Read more