Filter Select results based on selection

Seeing as my comments seemed to answer the question: To get access to the URL params you want $wp_query->query_vars[‘myvar’]: http://wordpress.org/support/topic/how-to-pass-value-in-wordpress-url, e.g.: <?php global $wp_query; $node_id = 0; $args = array( ‘post_type’ => ‘jobs’, ‘category_name’ => $wp_query->query_vars[‘position_name’] ); $the_query = new WP_Query( $args ); The other parts of the question aren’t really WordPress issues, so Stack … Read more

ajax, right way to do it and make it works?

In your functions.php file you should add an action to enqueue your scripts. <?php function my_enqueue_scripts() { wp_enqueue_script( ‘load_post’, get_template_directory_uri() . ‘/js/load_post.js’, array( ‘jquery’ ), ‘1.0’, 1 ); wp_localize_script( ‘load_post’, ‘wp_ajax’, array( ‘url’ => admin_url( ‘admin-ajax.php’ ), ‘nonce’ => wp_create_nonce( ‘ajax_nonce’ ) ) ); } add_action( ‘wp_enqueue_scripts’, ‘my_enqueue_scripts’ );

Menu Limitations

It shouldn;’t be so hard. All you have to do is to use wp_get_nav_menu_items filter. This will add 10 posts to submenu of item which title is equal to ”. function insert_my_posts_to_menu( $items, $menu, $args ) { $menu_order = count($items); $child_items = array(); foreach ( $items as &$item ) { if ( $item->title != ‘<SOME … Read more

How to add date to navigation bar

It would be better to hook into the wp_nav_menu_{$menu_name}_items filter and add your date item in there: add_action( ‘init’, ‘wpse_106781_add_menu_items_hook’ ); function wpse_106781_add_menu_items_hook() { $theme_location = ‘thirdnav’; $theme_locations = get_nav_menu_locations(); /* Make sure the theme location is valid */ if ( ! isset( $theme_locations[ $theme_location ] ) ) return; /* Get the navigation menu assigned … Read more

Image media upload metabox

In your JS you have twice the call to $(‘#dd_image’)and in your HTML you have no input named dd_image, but dd_image_one and dd_image_two… And also in your HTML you have twice id=”upload_image_button”and it’s bad :-). This way when you click on the first or the second button you do the same exact call and modify … Read more

WordPress not reflecting changed of the database

I’d suggest to try using this: http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ As @s_ha_dum has said, it looks like you’ve missed something. The above script automates the process of updating all URL references within the database when changing folder/URL and is much quicker and easier. You’ve probably missed some entries as some references to the URL are stored as serialized … Read more

Page Automatically Generated from Theme?

Put this in your functions.php file: $contact_query = new WP_Query(array( ‘pagename’ => ‘contact’, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, )); if (! $contact_query->post_count) wp_insert_post(array( ‘post_name’ => ‘contact’, ‘post_title’ => ‘Contact’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’, ‘post_author’ => 1, ‘page_template’ => ‘page-contact.php’, )); unset($contact_query); What does it do? If the contact page … Read more

Latest post in a specific menu

Yes, this is possible: function latest_posts_menu($items, $args) { //To a Specific Menu if ($args->theme_location == ‘primary’) { // Parent Menu Item $items .= ‘<li id=”menu-item” class=”menu-item”> <a href=”#”>’ . __(‘Latest Posts’, ‘textdomain’) . ‘</a> <ul class=”sub-menu”>’; // Create Sub Menus foreach ( get_posts( array( ‘posts_per_page’=>10, ‘post_type’ => array(‘post’) ) ) as $post ) { // … Read more