Adding Default Settings to Theme My Login plugin

The data wasn’t fully unserialized and properly made as a multidimensional array wp_parse_args() used unnecessarily. get_option() used unnecessarily. function nls_tml_default_settings() { $nlstml = array( ‘enable_css’ => 1, ‘login_type’ => ‘default’, ‘active_modules’ => array( ‘custom-passwords/custom-passwords.php’, ‘custom-user-links/custom-user-links.php’, ‘recaptcha/recaptcha.php’, ‘security/security.php’, ‘themed-profiles/themed-profiles.php’, ‘user-moderation/user-moderation.php’, ), ‘version’ => ‘6.4.10’, ); update_option( ‘theme_my_login’, $nlstml ); $nlsrecap = array( ‘public_key’ => ‘sitekey’, ‘private_key’ … Read more

WooCommerce Related Products by Attribute

Disable default Related Products and try this (Add custom code to the functions.php) add_action( ‘woocommerce_after_single_product_summary’, ‘custom_output_product_collection’, 12 ); function custom_output_product_collection(){ ## — YOUR SETTINGS — ## $attribute = “attribute_slug”; // <== HERE define your attribute slug $limit = “5”; // <== Number of products to be displayed $cols = “5”; // <== Number of columns … Read more

Slider loading issue

This is standard behavior with javascript that is deferred or loaded in the footer. All the slides load in, and don’t get told to “be sliders” until the whole page has loaded. You can hide them with CSS first: #section-slider .single-slide-wrap { display: none; } And you can have the first slide be shown if … Read more

Why is $_REQUEST an empty array in admin-ajax.php?

Here’s the problem: var formData = new FormData(); formData.append( “userfile”, $(this)[0].files[0] ); formData.append( “action”, “vibesoft_files_upload” ); formData.append( “_wpnonce”, vbsoft.nonce_upload ); console.log( formData ); $.ajax({ type: “post”, url: vbsoft.ajax_url, data: formData, Specifically: var formData = new FormData(); Nowhere in the jQuery documentation does it say that data accepts a FormData object for the data parameter: data … Read more

How to add just one specific page to widget without plugin?

Follow this step for Only one page add custom sidebar Step 1: Put this code in your theme function.php file. Register custom sidebar and your custom add_action. function wpdocs_theme_slug_widgets_init() { register_sidebar( array( ‘name’ => __( ‘Custom Sidebar’, ‘textdomain’ ), ‘id’ => ‘sidebar-10’, ‘description’ => __( ‘Widgets in this area will be shown on all posts … Read more