Link two different post using there post_id in post meta

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

Insert a hash into the url of custom posts to make them function as anchors

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

Multi Photo Upload with Caption on Front End for Custom Post Type

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