add_submenu_page returns null

Your code is correct but just you have called wrong capability in add_submenu_page. You just need to replace this ‘manage_options’ instead of ‘manage-options’. And please check it. It’s works. Reference: https://developer.wordpress.org/reference/functions/add_submenu_page/

Redeclare function after plugin activation

Ok with helps it’s working. So theme was ok in front of wordpress but wasn’t able to load in the admin so we changed the previous condition by : if (!function_exists(‘get_field’) && !is_admin()) { function get_field() { return; } function the_field() { return; } } but same problem with activation in the admin and it … Read more

How to automatically redirect to custom admin menu after plugin activation?

You can use register_activation_hook(). Add this to your plugin, tested and works. register_activation_hook(__FILE__, ‘redirect_after_activation’); function redirect_after_activation() { add_option(‘redirect_after_activation_option’, true); } add_action(‘admin_init’, ‘activation_redirect’); function activation_redirect() { if (get_option(‘redirect_after_activation_option’, false)) { delete_option(‘redirect_after_activation_option’); exit(wp_redirect(admin_url( ‘wp-admin/admin.php?page=axl_ads’ ))); } }

posts from multiple post types in one slider

Multiple Post type in one slider Shortcode Using This Shortcode For Owl Carousel In Your Page And Add Your Custom Post Type In The Arguments of Query Put This Code in Your functions.php add_action( ‘wp_enqueue_scripts’, ‘my_child_enqueue_styles’ ); function my_child_enqueue_styles() { wp_enqueue_style(‘styleowl’,’https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/assets/owl.carousel.min.css’); wp_enqueue_style(‘style1′,’https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/assets/owl.theme.default.min.css’); wp_enqueue_script(‘pro-owl’,’https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.1/owl.carousel.min.js’,array( ‘jquery’ ), ”, false); wp_enqueue_script(‘jquery’,’https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js’,false); } add_shortcode(‘post_slider’,’custom_slider’); function custom_slider(){ $args = array( … Read more

WordPress Custom Pages that work with Plugins?

Create a Search Page Template If you do not have a page.php, you can create one based upon your Theme’s index.php template file. Note: The filename search.php is reserved as a special template name, so avoid its usage; the suggested searchpage.php just makes it easy to recognize in the list of files -At the top … Read more

How to get theme’s info from wordpress.org/themes using api.wordpress.org?

If you’re in the admin site you can use themes_api() $info = themes_api( ‘theme_information’, [ ‘slug’ => ‘twentyten’ ] ); echo esc_textarea( $info->sections[‘description’] ); but that’s plain text, not HTML. The API request it generates is https://api.wordpress.org/themes/info/1.2/?action=theme_information&request%5Bslug%5D=twentyten&request%5Blocale%5D=en_US&request%5Bwp_version%5D=5.3.2 You can see the parameters in there as multiple URL-encoded request[key] parameters.

Show icons or badges under title on product archives/category pages

So I was not able to solve my problem earlier, then I switched the plugin to “Category and Taxonomy Image” (by Aftab Hussain) and used the following code to display the icons on category/archive pages: add_action( ‘woocommerce_after_shop_loop_item’, ‘attribute_img_loop’, 20 ); function attribute_img_loop() { global $product; // Check that we got the instance of the WC_Product … Read more