How can I check the rewrite slug of current post type listing page

Looking to the problem from a different perspective, I’ve reached to a different solution to it. I’ve created a function to check the post type instead of checking the slug of the post type. Actually I was trying to assign different CSS Class to each post type add_action( ‘css_class_per_post_type’, ‘assign_css_class_to_each_post_type’ ); // to be called … Read more

Modify Publish Metabox location on CPT

This solution seems to work so far. add_filter(‘screen_layout_columns’, ‘one_column_on_screen_options’); function one_column_on_screen_options($columns) { $columns[‘post’] = 1; return $columns; } // Ignore user preferences stored in DB, and serve only one column layout add_filter(‘get_user_option_screen_layout_post’, ‘one_column_layout’); function one_column_layout($option) { return 1; } add_action( ‘add_meta_boxes_sliding_panel’, ‘sds_do_meta_boxes’, 0, 1 ); function sds_do_meta_boxes( $post ) { remove_meta_box( ‘submitdiv’, ‘sliding_panel’, ‘side’ ); … Read more

Custom metabox with image gallery upload that won’t attach images to post

Here is my function to save attachment in a field using acf plugin. It may helps $filename = $wp_upload_dir[‘path’].”https://wordpress.stackexchange.com/”.$img; // Check the type of file. We’ll use this as the ‘post_mime_type’. $filetype = wp_check_filetype( basename( $filename ), null ); // Prepare an array of post data for the attachment. $attachment = array( ‘guid’ => $wp_upload_dir[‘url’] … Read more