select custom post type on regular post
you can use CMB2 you can do this easy https://github.com/CMB2/cmb2-attached-posts take a look at this GitHub to show you how.
you can use CMB2 you can do this easy https://github.com/CMB2/cmb2-attached-posts take a look at this GitHub to show you how.
SOLVED: Silly mistake that I made was using wp_query inside the custom metabox output… face palm If you found this post googling the same issue, you need to use a different query method as it conflicts with the page. Using this: $query = get_posts( array( ‘post_type’ => ‘forums’, ‘post_status’ => ‘publish’ ) ); fixed this … Read more
i GOT THE issues , here is my answer. Now two posts are linked properly. I just need to update the metadata dynamically. add_action( ‘save_post’,’add_menu_custom_event’, 10, 3); function add_menu_custom_event( $post_id, $post, $update ) { /* * In production code, $slug should be set only once in the plugin, * preferably as a class property, rather … Read more
I frequently see Page templates like this when someone’s trying to create a custom loop – possibly inspired by the built-in functionality of creating a Page as a stub for Posts when another Page is set as the front page for the site. That’s a special case, and not what people should be doing. Instead … Read more
Custom Post Type with Subfolder in Custom Theme
WordPress API only returning HTML
I have come up with a solution. First I have assigned a slug to the custom post type: $rewrite = array( ‘slug’ => ‘something’, ‘with_front’ => false, ‘pages’ => false, ‘feeds’ => false, ); The I use a filter and a regex. function 1234_filter_custom_post_url( $url, $post ) { if ( ‘my_custom_post_type’ == get_post_type( $post ) … Read more
WordPress stores the images as attachment post type, so it is possible to add the title to each of your gallery images. For example, // $filename should be the path to a file in the upload directory. $filename=”/path/to/uploads/2013/03/filename.jpg”; // The ID of the post this attachment is for. $parent_post_id = 37; // Check the type … Read more
Page as parent for CPT and other pages
how to allow subscriber to add/edit/delete custom post type