Same ACF Relationship field for multiple Post Options sub-pages?

The method to use is… In the acf_add_options_sub_page declaration, add ‘post_id’ => ‘article’ as a parameter. (post_id) This is how the field data, as entered on the Options page corresponding to my post type, will be saved. On the display end, display using $featured_posts = get_field(‘featured_posts’, ‘article’); ‘article’ and ‘report’ are both used. In my … Read more

TGM plugin error in Theme Check Plugin

Concerning your question: Can my theme be submitted for approval with these errors? I’m assuming you’re asking whether your plugin, while throwing an error upon activation using TGM library, can still be submitted and accepted to official WordPress repository. My answer would be, no, it cannot. It seems like you made your plugin work once … Read more

Adding querystring variable breaks admin URLs

You’re recieving this error because WordPress notices the post_type query argument and that sampletype is a valid registered post type, and thinks you’re on an edit page. Try using a different query arg then post_type. Note that admin.php?page=plugin-slug-posttypes-add&post_type=thisisnotaposttype and admin.php?page=plugin-slug-posttypes-add&foo=bar will both work fine.

edit-tags.php in plugin admin menu hides when is the active page

I’ve managed to solve this using Javascript to ‘open’ the menu item when on the edit tags page in the plugin. Relevant plugin PHP file $screen = get_current_screen(); // Check we’re only on the edit-tags page in the plugin if (‘edit-tags’ === $screen->base && ‘subscriber’ === $screen->post_type) { wp_enqueue_script( $this->plugin_slug . ‘-subscriber-edit-tags-script’, plugins_url(‘assets/js/subscriber-edit-tags.js’, __FILE__ ), … Read more

Add a Submenu from Another Submenu in a Custom Theme

It seems that you are adding the menu levels as separate menus: A “Primary menu” containing the items: “HOME”, “DPRK TOURS”, “INTERNATIONAL”, … etc. A “Secondary menu” containing the items: “INTERNATIONAL GROUP TOURS”, “VOLUNTEER PROGRAMS”, … etc. However, most themes support at most two such menu-levels, and some even support only one. So, if you … Read more

Redirect loop when forwarding to mobile site

You need to check that you aren’t already on the mobile site: function redirecting_to_mobile_site() { if ( $_SERVER[‘SERVER_NAME’] !== ‘m.example.com’ && wp_is_mobile() ) { wp_redirect( ‘http://m.example.com’ . $_SERVER[‘REQUEST_URI’], 301 ); exit; } } add_action( ‘template_redirect’, ‘redirecting_to_mobile_site’ ); You’ll need to clear your browser cache to properly test the fix.