How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286

Replace ‘call_user_func_array’ with name of the function to be called to output the page content. add_action(‘admin_menu’, ‘personalised_menu’); function personalised_menu() { add_menu_page( ‘Page Title’, ‘Blog’, ‘edit_posts’, ‘menu_slug’, ‘display_main_page’, ‘dashicons-welcome-write-blog’ ); add_submenu_page( ‘menu_slug’, ‘Add New Page’, ‘Add New’, ‘edit_posts’,’add_new_page’, ‘display_secondary_page’ ); } function display_main_page() { echo ‘Content of “Page Title”‘; } function display_secondary_page() { echo ‘Content of … Read more

Get an array wich contains the post_name of every post that has the custom post_type “pelicula”

<?php // query for your post type $post_type_query = new WP_Query( array ( ‘post_type’ => ‘pelicula’, ‘posts_per_page’ => -1 ) ); // we need the array of posts $posts_array = $post_type_query->posts; // create a list with needed information // the key equals the ID, the value is the post_title $post_title_array = wp_list_pluck( $posts_array, ‘post_title’, ‘ID’ … Read more

Array ids post to function have_post

If I understand it properly, You can use the post__in parameter to query for specific posts where the post ID is in that parameter: $ids = [ 1, 2, 3, 4, 5 ]; $query = new WP_Query( array( ‘post__in’ => $ids, // … other args, if any. ) ); // Then loop through the posts. … Read more

wp_force_remove_style’ not found

You have an action, but not the valid callback for your action. For example, You have somewhere following line: add_action( ‘some_action’, ‘wp_force_remove_style’ ); But not have “wp_force_remove_style” function defined. You have to have a function as following: function wp_force_remove_style() { // Do you stuff. }

Output from Meta Box Array

Add meta data as “flat” data to the post The actual problem is, that your meta data comes back as array (with a single entry), when calling get_post_custom( $id ); for your post. Here’s a simple function, that adds all meta data attached to a post to your post object. /** * Merges custom/meta data … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)