Get first menu item of custom menu

Ok, real stupid while writing this post I was thinking about first looping of the menu items and then storing them in an array for later use. With the example on the following page I can manage that: http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items // Get the nav menu based on $menu_name (same as ‘theme_location’ or ‘menu’ arg to wp_nav_menu) … Read more

Updating Style From WP Options Setting Page

I think you have to solve this with jQuery. If checked -> addClass, if not -> removeClass. Here’s how to enqueue your JS file: add_action(‘admin_menu’, ‘fwds_plugin_settings’); function fwds_plugin_settings() { $hook = add_menu_page( ‘Price Display’, ‘Price Display’, ‘add_users’, ‘fwds_settings’, ‘fwds_display_settings’ ); add_action( “admin_print_scripts-$hook”, ‘fwds_print_scripts’ ); } function fwds_print_scripts() { wp_register_script( ‘my-fx’ , plugin_dir_url( __FILE__ ) . … Read more

Meta_query not filtering posts

I think you don’t have to use meta_query. Simply use the code like shown below: $args = array( ‘post_type’ => ‘property’, ‘meta_key’ => ‘rental_type’, ‘meta_value’ => ‘Vacation’ ‘posts_per_page’ => $properties_per_page, ‘paged’ => $paged ); Also you got to get the value of $properties_per_page before this query.

Error on using __FILE__ for add_menu_page() Function

Your code should work (not how you expect but it should work), and probably the error was in something that you didn’t post. However… __FILE__ is a constant: you don’t have to use quotes when write it. Remove them like so: add_menu_page(‘Item Display’,’Item Display’,’administrator’, __FILE__, function(){ }); If you use the quotes, ‘__FILE__’ became a … Read more

What query to append the 10 next posts?

You need the $paged param and pass it with the ajax call. $queryLoadPosts = new WP_Query(array( ‘post_type’ => ‘track’, ‘posts_per_page’ => 4, ‘paged’ => (isset($_REQUEST[‘paged’]) && intval($_REQUEST[‘paged’])) ? $_REQUEST[‘paged’] : 1 )); First time you click the button the paged param must be 2, second time 3, and so on… so you need to store … Read more

confirm my booking with phone number

I understand your problem but in your question your going from submission of a form to querying data you expect in the database then displaying it. That covers a lot of steps. My first question is have you confirmed that your submitted form values are being stored as you expect? We need to rule out … Read more

Query sql for truncate post_content in wp_posts table

Backup your db Remeber to backup your db Import the backup in another database, change wp-config.php to use this new database and see if everithing is ok. (Importing is successfull? Site appear without any change?) WordPress uses a prefix for table names. The default is ‘wp_’ but clever guys change it with something else. (The … Read more