Could someone please help me to add category id with in this query so this will return posts from a certain category?

Please follow proper wordpress method not follow someone’s code or copy paste code. /* * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters * Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp- includes/query.php */ $args = array( //////Category Parameters – Show posts associated with certain categories. //http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters //all categories parameter ‘cat’ => 5,//(int) – use category id. ‘category_name’ => ‘staff, news’, //(string) – Display posts that have … Read more

How to avoid creating first submenu page that is same as menu page?

You can set slug of a subpage to be the same as slug of parent page. For example: public function onixion_admin_menu_option() { add_menu_page(‘onixion’, ‘Onixion’, ‘manage_options’, ‘onixion-admin-menu’, array(&$this, ‘onixion_main_page’ ), ‘dashicons-chart-area’, ‘200’ ); add_submenu_page( ‘onixion-admin-menu’, ‘scripts’, ‘Scripts’, ‘manage_options’, ‘onixion-admin-menu’, // <– here we set the same slug as for parent page array(&$this, ‘onixion_scripts_page’ ) ); add_submenu_page( … Read more

Issue with post request to admin-post.php

(Revised answer) I have changed my action to yours but it still doesn’t work. Here is my repo for this plugin if you want to see. I’m at a loss at the moment: github.com/SeanDez/frequentVisitorCoupons So I tried and tested your plugin, and noticed that you’ve got two “actions” (i.e. action fields) on the same form. … Read more

multiple functions with same filter

There’s nothing technically wrong with this. It will work, but it’s very important to make sure the usage of the filter is consistent everywhere it’s used, otherwise you could experience issues. My suggestion would be to abstract the powers check into a separate function, and use the filter there. For example, the filter could be … Read more