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

Display site language setting in source code

Is it possible to display <!– plugin version 123 (Fr) –> if the language is French? Yes, it is possible and you can use get_bloginfo( ‘language’ ) which returns a language tag like en-US for English (US). So if you just want to retrieve the first 2-or-3 character code (e.g. en for en-US and en-UK) … Read more

How can I support plugins in a custom theme?

Underscores.me Framework has integrated support for Jetpack’s Infinite Scroll feature – you could just install the Automattic JetPack plugin and ensure that the Infinite Scroll feature is enabled. Lines 155-156 of the default underscores.me framework add Jetpack support if it’s installed: /** * Load Jetpack compatibility file. */ if ( defined( ‘JETPACK__VERSION’ ) ) { … Read more

Send email to multiple addresses on Contact Form 7, but exclude personal details on all but one

Contact Form 7 lets you set up multiple outgoing emails. Set the outgoing message for the ‘everyone-except-one’, and a 2nd outgoing message for ‘just-the-one’. And use the BCC feature to keep everyone’s email confidential. Info on how to do that is on the CF7 site and support forums…..which is where you should ask for support … Read more