How to manage wordpress knowledge base/wiki/posts collections

WordPress already provides a built-in mechanism for navigating collections of posts called “Archives”. Taxonomies such as “Category” naturally create a collection of posts – and thus WordPress automatically facilitates taxonomy archives. Meanwhile, pages are intended to display singular, definitive content that is usually timeless. It sounds to me as though your “Topics” should be top-level … Read more

add post type pram to wp shortcode

Do you want to be able to switch between post types? If not, seems to me you could just duplicate the same functionality as you’re using with the per_page parameter, meaning: In your shortcode function just add a data attr to the #container-async div for the post_type(s). <div id=”container-async” data-paged=”<?php echo $a[‘per_page’]; ?>” data-posttype=”<?php echo … Read more

Why the images on mi javascript are not found?

You are missing /wp-content/themes/YOUR_theme_NAME_FOLDER like this: function sliderimgchange(){ if ($(window).width() <= 600) { var sliderOne = $(‘.slideuno’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderone-mobile.jpg’), sliderTwo = $(‘.slidedos’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/slidertwo-mobile.jpg’), sliderThree = $(‘.slidetres’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderthree-mobile.jpg’); } else if ($(window).width() > 600) { var sliderOne = $(‘.slideuno’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderone.jpg’), sliderTwo = $(‘.slidedos’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/slidertwo.jpg’), sliderThree = $(‘.slidetres’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderthree.jpg’); } }

Add country flags

Best solution is to import data from 3rd party API into your database. By this you do not need to rely on any API. Your page performance will also be increased as it will reduce external request. So you need to do one time job to fetch all the data from API, stores it into … Read more

Generate all urls with https

This sounds like a bug in the plugin, and they should fix it. But if they don’t, you can always add a filter to home_url and change all http:// to https:// like so: add_filter( ‘home_url’, ‘wpse_259675_home_url’, 1000, 4 ); function wpse_259675_home_url( $url, $path, $orig_scheme, $blog_id ) { return str_replace( ‘http://’, ‘https://’, $url ); }

WordPress Plugin default option

$default_data = Array( “plugin551-setting-group” => Array( ‘checkboxoption1’ => ‘true’, ‘checkboxoption2’ => ‘true’ ) ); if ( is_admin() && isset($_GET[‘activate’] ) && $pagenow == ‘plugins.php’ ){ global $default_data; plugin551_save_settings($default_data); } function plugin551_save_settings ( $data ) { if( isset( $data[‘plugin551-setting-group’] )){ array_walk_recursive( $data[‘plugin551-setting-group’] , ‘plugin551_clean_options’); update_option( ‘plugin551-setting-group’ , $data[‘plugin551-setting-group’] ); } } function plugin551_clean_options(&$value) { $value = … Read more

How To Pass Ajax Value to PHP Query?

Create simple functions like function func_for_ajax(){ wp_localize_script( ‘ajax_custom_script’, ‘frontendajax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ))); echo “simple demo ajax”; } Than create your ajax pass in wordpress action threw this function name directly. jQuery.ajax({ type: “POST”, action: ‘func_for_ajax’, url: ‘ajaxurl’, success: function(data){ jQuery(‘#content2’).html(data); } });