Showing wordpress latest post thumbnails in slider with auto increment

You can achieve this by developing custom code like following. You can find more information about WP_Query here https://codex.wordpress.org/Class_Reference/WP_Query <?php $args = array( ‘posts_per_page’ => 100, ‘meta_key’ => ‘_thumbnail_id’, ‘ignore_sticky_posts’ => 1 ); // The Query $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { … Read more

Adding users to another blog

You said you wanna register any user to other blogs when a user is created. But this get_current_user_id() doesn’t fire on user creation. You better have a look on wp-includes/user.php at line 1401 the wp_insert_user function. WordPress default registering process uses this function to insert new users. And if you wanna create the user manually … Read more

how change my menu on submenu

You can add a sub menu like below. // Call Terms_and_conditions_menu is function which load plugin menu add_action( ‘admin_menu’, ‘Terms_and_conditions_menu’ ); // Add to WordPress admin menu if( !function_exists(“Terms_and_conditions_menu”) ) { function Terms_and_conditions_menu(){ $page_title=”WordPress Extra Post Info”; $menu_title=”Terms And Conditions”; $capability = ‘manage_options’; $menu_slug = ‘terms-post-info’; $function = ‘terms_post_info_page’; $icon_url=”dashicons-media-code”; $position = 4; add_menu_page( $page_title, … Read more

Global filter not working

That’s not really how the pre_get_posts works. The original parameters you’ve sent to the function are not good. The only one required is $query. And the workaround for you will be to run your function in the pre_get_posts function to return an array of post_ID corresponding on the variation you want to include, then in … Read more

Passing ajax variable to more than one wordpress plugin function

If you want to use a global variable, you have to set it outside any local scope, above your functions. For example: if (isset($_POST[‘whatever’])) { $variable = $_POST[‘whatever’]; } This will store it in the superglobal array. Now, access it using the $_GLOBALS array: function my_action(){ $whatever = $GLOBALS[‘variable’]; } I would however have an … Read more