title: Exclude most recent posts from specific category in wp_query()

text: I have a featured posts slider, which uses the 'featured' tag. I have a query for this which grabs the 3 most recent posts with this tag and shows them in the slider. Below this, I have a list of 10 or so most recent posts across all categories. How would I write a query to exclude the 3 most recent posts with the 'featured' tag, as these are already in the slider (don't want post duplication), but then when they drop off the slider (i.e they're now the 4th most recent 'featured' post etc), they appear in the post list? EDIT: Here is my code - I've written a shortcode so I can drop it into any page/widget/etc I want but the query for getting the 3 most recent 'featured' posts is here:               posts_per_page=3&post_type=post&tag=featured      and the query which grabs the 10 most recent posts across all categories is:               posts_per_page=10&post_type=post      Hope that's helpful :) Thanks :) EDIT #2: Used @Chip Bennet's answer, inside my short code which almost works but it only excludes one of the featured posts (most recent I think), not all 3 that are on the slider. Here is the code:               function loopShortcode($atts) {              $excludeFeaturedPosts  = array(             'tag' => 'featured',             'posts_per_page' => 3         );              $featured_posts = new WP_Query($excludeFeaturedPosts);              $featured_post_ids = array();         foreach ( $featured_posts as $featured_post ) {             $featured_post_ids[] = $featured_post->ID;         }              wp_reset_query();              // Defaults         extract(shortcode_atts(array(             "posts_per_page" => '', // query parameters are defined by the user when you add the shortcode into the page             "post_type" => ''         ), $atts));              $query_args = array(             "posts_per_page" => $posts_per_page,             "post_type" => $post_type,             "post__not_in" => $featured_post_ids         );              $listedPosts = new WP_Query($query_args);              // rest of short code content, e.g loop, output etc              return $output;         wp_reset_query();     } // end shortcode function


title: WordPress Custom URLs

text: Based on the link maioman posted, below I have revised this question: I am having trouble getting a custom post type/taxonomy to work. I want a custom post type of Episodes, and the taxonomy for the custom post type to be Episodes with terms that are generated by the user. I was able to get episodes/custom-term-name/ to work. If you go here, it shows all of the posts that are tied to this term. However if you go to a single post at episodes/custom-term-name/post-title it gives me a 404 page.               function episodes() {          $labels = array(         'name'                => _x( 'Episodes', 'Post Type General Name', 'text_domain' ),         'singular_name'       => _x( 'Episodes', 'Post Type Singular Name', 'text_domain' ),         'menu_name'           => __( 'Episodes', 'text_domain' ),         'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),         'all_items'           => __( 'All Episodes', 'text_domain' ),         'view_item'           => __( 'View Item', 'text_domain' ),         'add_new_item'        => __( 'Add New Item', 'text_domain' ),         'add_new'             => __( 'Add new episode', 'text_domain' ),         'edit_item'           => __( 'Edit Item', 'text_domain' ),         'update_item'         => __( 'Update Item', 'text_domain' ),         'search_items'        => __( 'Search Item', 'text_domain' ),         'not_found'           => __( 'Not found', 'text_domain' ),         'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' )     );     $rewrite = array(         'slug'                => 'episodes/%episode_cat%',         'with_front'          => false,         'pages'               => true,         'feeds'               => true     );     $args = array(         'label'               => __( 'episodes', 'text_domain' ),         'description'         => __( 'All episodes', 'text_domain' ),         'labels'              => $labels,         'supports'            => array('title' ),         'hierarchical'        => true,         'public'              => true,         'show_ui'             => true,         'show_in_menu'        => true,         'show_in_nav_menus'   => true,         'show_in_admin_bar'   => true,         'menu_position'       => 5,         'can_export'          => true,         'has_archive'         => true,         'exclude_from_search' => false,         'publicly_queryable'  => true,         'rewrite'             => $rewrite,         'capability_type'     => 'page',         'query_var'           => true,         '_builtin'            => false     );     register_post_type( 'episodes_listing', $args );           }          add_action( 'init', 'episodes', 0 );          function episodes_taxomony() {          $labels = array(         'name'                       => _x( 'Episodes Categories', 'Taxonomy General Name', 'text_domain' ),         'singular_name'              => _x( 'Episodes', 'Taxonomy Singular Name', 'text_domain' ),         'menu_name'                  => __( 'Episode Categories', 'text_domain' ),         'all_items'                  => __( 'All Items', 'text_domain' ),         'parent_item'                => __( 'Parent Item', 'text_domain' ),         'parent_item_colon'          => __( 'Parent Item:', 'text_domain' ),         'new_item_name'              => __( 'New Item Name', 'text_domain' ),         'add_new_item'               => __( 'Add new episode', 'text_domain' ),         'edit_item'                  => __( 'Edit Item', 'text_domain' ),         'update_item'                => __( 'Update Item', 'text_domain' ),         'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),         'search_items'               => __( 'Search Items', 'text_domain' ),         'add_or_remove_items'        => __( 'Add or remove items', 'text_domain' ),         'choose_from_most_used'      => __( 'Choose from the most used items', 'text_domain' ),         'not_found'                  => __( 'Not Found', 'text_domain' )     );     $rewrite = array(         'slug'                       => 'episodes',         'with_front'                 => false,         'hierarchical'               => true          );     $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,         'query_var'                  => true,         'rewrite'                    => $rewrite     );     register_taxonomy( 'episodes_category', array('episodes_listing'), $args );          }               add_action( 'init', 'episodes_taxomony', 0 );          function filter_post_type_link($link, $post)     {     if ($post->post_type != 'episodes_listing')         return $link;          if ($cats = get_the_terms($post->ID, 'episodes_category')) {              //echo 'This is the '. $link;         $link = str_replace('%episode_cat%', array_pop($cats)->slug, $link);     return $link;     }     }     add_filter('post_type_link', 'filter_post_type_link', 10, 2);      In attempts to solve the above issue, I then added in               add_filter('rewrite_rules_array', 'mmp_rewrite_rules');      function mmp_rewrite_rules($rules) {       $newRules  = array();       $newRules['episodes/(.+)/(.+)/(.+)/(.+)/?$'] = 'index.php?custom_post_type_name=$matches[3]'; // my custom structure will always have the post name as the 5th uri segment     $newRules['episodes/(.+)/?$']                = 'index.php?taxonomy_name=$matches[1]';           return array_merge($newRules, $rules);     }      But now /episodes/custom-term-name brings me to homepage /episodes/custom- term-name/post-title brings me to homepage So, nothing works. I've tried changing the $matches array number. Note: in my WP reading settings, I have it set to a static page. This static page is what is showing when I call the mmp_rewrite_rules function.


title: Interested in redirection techniques for one-page themes

text: One page themes have become increasingly popular this year, and I'm just working on my first. Although the site's navigation doesn't offer any direct links to the individual pages that make up my one-page presentation, I know it's always possible that someone will try to access them directly, or that they may appear in search engine results. So I'm interested in your ideas on best practices for forcing users back to where I want them. Example, my one-page site is comprised of About, Gallery and Contact. These are built as pages so that the user can easily update them, but they are pulled into one single page for display, and are accessed via anchor IDs. So `mysite.com/#about` etc. But if someone types `mysite.com/about`, I want to force them back to the main page and the anchor point rather than having a single page view of that content. (maybe I'm wrong about this, and if you think so, tell me why) I suppose the easy answer is just to do a rewrite rule to precede any reference to a direct page with the hashtag. But imagine that down the road I'd like to add a blog section that is not contained on the page but that opens a new one? So far my Google searches haven't turned up much discussion on the subject. Maybe it's my search terms that are amiss - so I'd love to hear your ideas, and if you've read any good articles that discuss this, please pass them along!


title: Plugins folder broken-No website functionality

text: After some plugin updates caused me to receive a database error, I was unable to access my dashboard. I changed the name of the plugins folder in FTP and it came back online. I then deleted my plugins from the server so that I could individually re- upload the backed up plugins to see which had caused the issue. However, whilst in FTP my plugins seem to upload fine, they do not display on the server, and when I try to upload new plugins on the server, i get this error. "Could not create directory. /home/sites/tbdowenholland.com/public_html/wp-content/plugins/wp-super-cache/ Plugin install failed." This basically means that I have lost all functionalities on the website. It has been suggested that it is a permissions issue. My Public HTML, WP- Content are set to 755 and Plugins to 777. These by knowledge are general settings so I cannot see where a permission error would lie. Any ideas? I'm getting pretty panicky since I installed a back up that did not fix the issue!


title: Change the search results header from plugin

text:
Hi I'm writing a plugin to include custom search results. I'm not really allowed to edit any theme pages, but the search results page in twentyfourteen's search.php seem hardcoded to me:
<?php printf( __( 'Search Results for: %s', 'twentyfourteen' ), get_search_query() ); ?>
                 <?php if (function_exists("getGlossarySearchResults")) { echo getGlossarySearchResults(); }  ?>                   I have to display the results before the normal search results. So is there any way modify the results output header from code?


title: Sort Custom Taxonomy Terms in admin by custom order

text: This question was discussed on here and I believe here as well, but I was wondering if anyone knew of any updates to this since then? To clarify, I currently have a custom taxonomy called 'Days of Week' so I only use seven terms (Monday, Tuesday, Wednesday etc.) but under `hiearchical=>true`, WordPress lists them in an alphabetical order instead.   1. Friday   2. Monday   3. Saturday   4. Sunday   5. Thursday   6. Tuesday   7. Wednesday Normally this wouldn't be an issue, but given that some users of the site might find it confusing, I thought I'd ask to see if anyone had any ideas? Thanks in advance!


title: ACF Plugin - Dropdown menu of Posts based on Date Picker range

text: I am building a website with a Custom Post Type, "Events". I would like to use the Advanced Custom Fields (ACF) Plugin to provide custom fields for this post type, 2 of which will be ACF Date Picker Fields - for a start date and end date. I am wondering if it is possible to show a drop down menu (to the front end user) of all of the dates for which their is a post entered? This would include the start dates, end dates, and any dates in between. The end goal being that a clicked date, in the drop down, would load any posts with that date attached to them. For example:   * **Event Post 1**     * starts: Thursday, May 22     * ends: Sunday, May 25   * **Event Post 2**     * starts: Friday, May 23     * ends: Sunday, May 25   * **Movie Post 3**     * starts: Sunday, May 25     * ends: Monday, May 26 The drop down menu would show:   * Thursday, May 22   * Friday, May 23   * Saturday, May 24   * Sunday, May 25   * Monday, May 26 And if **Saturday, May 23** was clicked, in the drop down menu, it would return:   * Event Post 1   * Event Post 2 Any help would be greatly appreciated. I don't really know where to start, aside from assuming this is a probably a job for the query posts function.


title: Display page of custom posts?

text:
I have a custom post type, "design_asset". I am displaying them on a page template, with the loop               <?php     rewind_posts();     $paged = ( get_query_var( 'paged' ) ) ? get_query_var('paged') : 1;     $args = array( 'post_type' => 'design_asset', 'posts_per_page' => 100, 'orderby' => 'title', 'order' => 'ASC'  );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();     ?>

             <?php the_post_thumbnail( 'thumbnail', array('class' => 'img-responsive') ); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

<?php the_excerpt(); ?>

     <?php    endwhile;   ?>      Also on this page, I am listing the categories with `wp_list_categories` When you click a category in this list, it goes to archive.php and displays the category there, thanks to this post's reply, e.g.`/category/components/` I don't fully understand why Wordpress uses `archive.php` instead of `category.php`, but let's go with it for now. Now, I am trying to re-purpose this loop on `archive.php`. I moved it into `loop-assetThumbs.php` and call it with `<?php get_template_part('loop', 'assetThumbs'); ?>` Of course, it calls ALL of the posts or the post type, I can't figure out how to display only the "active" category in the URL, `/category/components/` How do I modify the loop to do this? Or is there a better way to display categories of custom post types via `wp_list_categories`? Note: I'm also not sure why it's showing 2 empty iterations of the loop here. ![enter image description here](http://i.stack.imgur.com/nUqh6.png)


title: How to display page excerpt with readmore link inside an enhanced widget?

text: I'm trying to display an excerpt of a page inside an enhanced widget. I have tried the following but it doesn't work:               <?php     $id = 2550;     $post = get_post($id);     $content = apply_filters('the_content', $post->post_excerpt);     return  $content;     ?>


title: how to disable inner links in wordpress

text: i have used jquery accordion menu plugin for site navigation in my wordpress website. in that i like to disable secondary level links for specific main links. i have disabled third level links by > display:none; properties in css, same as i need tricks for hide the secondary level links in navigation for particular main links. if any one have ideas kindly hell me...


title: WP Infinite loop

text: It is not working.               add_action( 'save_post', 'jdev_save_custom_meta_box', 13, 2 );          function jdev_save_custom_meta_box(){              global $post;              // Get our form field         if( $_POST ) :              if ( ! wp_is_post_revision( $post->ID ) ) {                  // Update post meta                  $authorTitle = esc_attr($_POST['authorTitle']);                  $authorID = esc_attr( $_POST['book_author_field'] );                  $sectionTitle = esc_attr($_POST['sectionTitle']);                  $sectionID = esc_attr( $_POST['section'] );                       if(strlen($authorTitle) > 0) {                      /*$authors = query_posts(array(                         'post_type' => 'book_author',                         'showposts' => -1,                         's' => $authorTitle                      ));*/                           if(!empty($authorID)) {                          update_post_meta($post->ID, 'book_author_field', $authorID);                      } else {                          remove_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          $insertPostID = wp_insert_post(array(                              'post_status' => 'publish',                              'post_type' => 'book_author',                              'post_title' => $authorTitle,                              'post_content' => ''                          ));                          add_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          update_post_meta($post->ID, 'book_author_field', $insertPostID);                      }                       } else {                     delete_post_meta($post->ID, 'book_author_field');                  }                       if(strlen($sectionTitle) > 0) {                      /*$sections = query_posts(array(                         'post_type' => 'section',                         'showposts' => -1,                         's' => $sectionTitle                      ));*/                           if(!empty($sectionID)) {                          update_post_meta($post->ID, 'section', $sectionID);                      } else {                          remove_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          $insertPostID = wp_insert_post(array(                              'post_status' => 'publish',                              'post_type' => 'section',                              'post_title' => $sectionTitle,                              'post_content' => ''                          ));                          add_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          update_post_meta($post->ID, 'section', $insertPostID);                      }                       } else {                     delete_post_meta($post->ID, 'section');                  }              }              endif;          }


title: How to change a certain text or term of WordPress into a custom into the whole site?

text: In my WordPess site for client, I used Posts as Products, Comments as Customer Review, Subscribers as Registered Customers and so on. For client's I used Admin Menu Editor to edit the `wp-admin` menu item's titles, i.e.:   * Posts > Products,   * Add New > Add New Product;   * Pages > Web Pages etc. But scenario is:   When someone clicks on the menu "Products", the page appears with "Posts". That's a bit fishy! :( If it is possible I want to make a change in the visualization into the whole site that makes the _word_ "Post" into "Product", "Page" into "Web Page" etc. and relative plurals (i.e. "Posts" into "Products" etc.). - perhaps a kind of filtering... **Awareness:** But I want no conflict with the WordPress keyword "Post" (the post type), or the WordPress keyword "Contributor" (the user role) etc.


title: How to get meta box values - WP tuts tutorial

text: I did these tree tutorials to create custom metaboxes.   * wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/   * wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-2-advanced-fields/   * wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-3-extra-fields/ but i don't know how to call values from individual fields. I used this php script               $meta = get_post_meta($post->ID, $field['id'], true);     echo $meta;      but id doesn't work. Does someone know what I do wrong. here is my function.php http://www.4shared.com/file/8jmKqGFY/functions.html? and here is my index.php http://www.4shared.com/file/iAWwZim7/index.html?


title: How to point a public URL to internal (hidden) server with all links following.

text: I know that you all will be mad with a simple question like this, but I was unable to find a clear answer, therefore I risk to bother :) Yes, I have read Changing_The_Site_URL, but could not find what I need... **In simple terms:** I would like to have a wordpress installation on a bitnami server, sitting on my local (linux) machine, which would be linked transparently for the user to the company intranet (personal) website. **In detail:** What I have running is a bitnami installation on _http://mymachine:8080/wordpress_. I can place a .htaccess on the intranet website (but not much, e.g. no wordpress itself): say _http://intranet/user_. I would like the user to type in the intranet address (http://intranet/user) and get to the wordpress on mymachine:8080/wordpress. **Now to the trouble:** I have set up a HTTP 301 redirection and that works, however, the address in the browser and all the wordpress addresses (RSS,etc) point to the mymachine address. This is not what I want, as I need to be able to replace the local machine and the user should not see any change. I have tried setting the "WP_HOME"/"WP_SITEURL" of the wordpress and a making a 301 redirect in the intranet .htaccess, but the site is then either not visible or it still points to the mymachine. Is there something more I should set up? Thanks a lot!


title: Post types - Normal Post - Image

text: I use the ios app to administer my blog. On occasion I also post life pictures up. Question is that when I post an image up from my iPhone the type (image) is shown in the list of post titles. I can't see where this is set? When I go into edit the above post or even create a new post. Is this down to the current theme I am using or am I missing something? Thanks


title: Cannot edit posts after moving WP site

text: Just moved a 3.8.1 site to a new hosting service. Copied all files (checking all permissions afterword) as well as a complete copy of the db. Uploaded db on new server, and updated the config file with new credentials. URL did not change. WP loads and displays ok, but when we try to add or edit a post, /wp- admin/post.php returns an unformatted page that says: > Thank you for creating with WordPress. > > Version 3.8.1 > > [animation]Saving revision... Your latest changes were saved as a revision. > > All Posts There's a little "working" animation in from of "Saving..." and the page never updates from there. Any ideas?


title: Only default permalink is working

text: I'm getting **trouble** with **another permalink setting then the default permalink setting**. I want to use the post name of a page/article but when I activate "the post name", all of my pages, except the home page, is not working. (all 404-pages). **Steps taken:**   1. Clean install   2. clean twenty x theme I think it is again a **_server issue_** like in my other post: `http://wordpress.stackexchange.com/questions/84151/unable-to-search-install- plugins-via-loged-in-admin` Does somebody knows what I can do about this problem. Btw, I'm not working in the root directory on my server. I copy the **wordpress folder** into the HTTPdocs folder on my server.


title: Custom height/width for thickbox in WP Backend

text: I use thickbox in the WP backend for preview or other content. On own pages in the backend works my script very fine and a can use custom width and height for the thickbox. below my code:                                 Now to my problem and question. I will use a thickbox on the page wp- admin/plugins.php and here dont work the script. WP set the height and width always to the core-values and this is to small for my request. Maybe other readers have an idea or a solution. Many thanks!


title: Why is home (a lot) slower than other pages?

text: I'm trying to tune a wordpress website which suffers slow loading times, and I found out that the home page seems to take a lot more time to load. It's not due to content because I'm just considering the time it takes for the base request to end (viewable via firebug in firefox). Also I tried copying the index.php code in a custom page, and the same exact code loads in about 1 sec while the main home loads in about 7. I noticed that single pages loaded faster, and at first I thought it was due to the difference in content, but after this test I'm not sure what's causing this. Is there much stuff that wordpress does behind the scenes only for the main index? Is there any other way to explain this situation and, more importantly, fix it so that the home page loads faster? **UPDATE -- DIRTY SOLUTION** After a lot of blind tries, I created a new page called home which uses `index.php` as custom template (not a copy, the same file). I redirected any call to the base path to it (via wordpress' internal rewrite) and I have the same homepage as before, just loaded in 1/6th of the time. While I'm happy with the result, I'd really like to understand what's going on. **ANOTHER UPDATE** So the point seems to be that I cannot use a dynamic (in wordpress' sense) page with this site, it only works fine with a custom "static" page where I insert content via various functions, the normal Loop makes the home either very slow (with high memory limit) or just blank (low memory limit, script fails). As suggested in this question, I created a static home linked to a custom page and it works fine. I also created a blog page (again with a custom template) which also works fine (where "fine" means it shows my empty test page containing just one word and no code) **unless** I specify it as "Posts page" in admin -> Reading settings. In other words it looks like as soon as wordpress sees a dynamic page (the one that's supposed to hold The main Loop) it does something very heavy which eats up a lot of ram. Still looking for the cause of this, I can work around it but I'd really like to understand what the problem is. Edit: added bounty More info: I tried disabling all plugins, wordpress is updated to the latest version. **FURTHER EDIT: TABLE INDEXES** wp_posts:               PRIMARY KEY  (`ID`),     KEY `type_status_date` (`post_type`,`post_status`(1),`post_date`,`ID`),     KEY `post_status_date_gmt` (`post_status`(1),`post_date_gmt`),     KEY `post_date` (`post_date`),     KEY `post_date_gmt` (`post_date_gmt`),     KEY `post_parent` (`post_parent`),     KEY `post_name` (`post_name`),     KEY `post_status` (`post_status`),     KEY `post_author` (`post_author`),     FULLTEXT KEY `post_related` (`post_name`,`post_content`),     FULLTEXT KEY `post_content` (`post_content`,`post_title`),      wp_term_relationships:               PRIMARY KEY  (`object_id`,`term_taxonomy_id`),     KEY `term_taxonomy_id` (`term_taxonomy_id`)      wp_term_taxonomy:               PRIMARY KEY  (`term_taxonomy_id`),     UNIQUE KEY `term_id_taxonomy` (`term_id`,`taxonomy`),     KEY `taxonomy` (`taxonomy`)


title: How can I save repeatable fields with one value inside an array?

text:
**Introduce** I am currently working on a slider plugin to learn a lot of PHP and WordPress. I have create some repeatable field with javascript. **Some functional details:**   * When the user is clicking on a button, the last row will cloned and all values will reset.    * Add an increase to the javascript code for create unique ids for my input names and id's.   * Add an unique id for my rows that are cloned. **The problem:** I wrote this topic, because I have some issues with saving values from one variable in an array. When I save the post or page, the first field will overwritten. This is because I loop through one image and one caption, not through the `$_POST` variable. **Question:** My question now is how I can resolve this problem? I have also looked at the source code that @brasofilo has recommended at Github - Gist. Brasofilo has only used one meta, but I would like to use a multidimensional array to create my fields. And save the values in one row in the database as an array. I know that I can make use of several other plugins, but as I said before I would like to learn a lot of WordPress and PHP scripting language. **Script PHP:** > Here you can see my used code for now, as I said before, it only saves one > image and one caption.               <?php          // Add meta box support     // This registers a function to be called when the WordPress admin interface is visited     add_action("admin_init", "dsslider_manager_add_meta");     function dsslider_manager_add_meta(){              // Create this cool new meta box for Portfolio Options         add_meta_box("dsslider-meta", "Brandbox Options", "dsslider_manager_meta_options", "brandbox-slider", "normal", "high");     }          // Create the fields array     $prefix = 'dsmeta_';     $custom_meta_fields = array(         array(             'label' => 'Image',             'desc' => '',             'id' => $prefix . 'image',             'type' => 'image',             'repeatable' => true,         ),         array(             'label' => 'Image caption',             'desc' => '',             'id' => $prefix . 'image_caption',             'type' => 'text',             'repeatable' => true,         )     );          // Callback unctions for setting up Brandbox Options     function dsslider_manager_meta_options(){              global $custom_meta_fields, $post;         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )             // (integer) (optional) The post ID whose custom fields will be retrieved.              // Default: Current post             return $post_id;          echo '
';              // Markup for table head         echo '
';         echo '
';                   // Use nonce for verification         echo '<input type="hidden" name="dsmeta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';              // Begin a table row         echo '
';         echo '1	';              foreach ($custom_meta_fields as $field) {             // Get value of this field if it exists for this post             $meta = get_post_meta($post->ID, $field['id'], true);             $type = $field['type'];                  // Each $meta in an table data             echo '';                  // Check if value repeatable is set             if ($field['repeatable']) {                      switch ($type) {                     // Image case                     case 'image':                              $image = get_template_directory_uri() . '/assets/images/default.jpg'; // Default image for the preview                         echo '' . $image . '';                              // If $meta == (equal to) true                         if ($meta) {                             $image = wp_get_attachment_image_src($meta, 'thumbnail');                             $image = $image[0]; // Get the first key of the array - url                         } // End if                              echo '<input type="hidden" name="' . $field['id'] . '" class="upload_image" value="' . $meta . '" />'; // Save the image ID                         echo ''; // Preview uploaded image                         echo '<input type="button" class="button add-image" value="Add image" rel="' . get_the_ID() . '" />'; // Add image                         echo 'Remove image'; // Delete image                          break;                          // Text case                     case 'text':                         echo '<input type="text" name="' . $field['id'] . '[]' . '" id="' . $field['id'] . '" value="' . $meta . '" size="30" /> ';                     break;                      } // End switch statement                  } // End if                  echo '	';              } // End foreach loop              echo '-	';         echo '
'; // End .row                   echo '
'; // End tbody         echo '
'; // End tbody              echo '

';         echo 'Add New Slide';         echo '

';          echo '
'; // End .dsslider_manager_extras     }          // Save the data     add_action('save_post', 'dsslider_manager_save_extras');     function dsslider_manager_save_extras($post_id) {              global $custom_meta_fields;              // Check autosave function         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $post_id;         } // End if statement              // Check permissions         if ('page' == 'post_type') {             if (!current_user_can('edit_page', $post_id)) {                 return $post_id;             }             elseif (!current_user_can('edit_post', $post_id)) {                 return $post_id;             }         } // End if statement              // Loop through fields and save the data           foreach ($custom_meta_fields as $field) {             if (isset($_POST[$field['id']])) {                 $old = get_post_meta($post_id, $field['id'], true);                 $new = $_POST[$field['id']];                      if ($new && $new != $old) {                     update_post_meta($post_id, $field['id'], $new);                 }                 elseif ('' == $new && $old) {                     delete_post_meta($post_id, $field['id'], $old);                 }             } // End if statement         } // End foreach loop     }


title: Display posts links from a category group by year

text:
I want to display posts links from a category group by year. Group by year becouse by default wordpress repeat the date for each post. I try use a code but I got all post in current year. How can I do it? Example I want to do: 2010   * post link 20    * post link 19    * post link 18   * ...    * post link 8 2009   * post link 7    * post link 6    * ... The code:               <?php     query_posts(array('nopaging' => 1, /* desabilitar a paginacao pata obter todos os pots. O padrao e ordenado pela data */));     $prev_year = null;          query_posts('cat=27');          if ( have_posts() ) {        while ( have_posts() ) {           $this_year = get_the_date('Y');           if ($prev_year != $this_year) {               // Year boundary               if (!is_null($prev_year)) {                  // A list is already open, close it first                  echo '
';               }               echo '
'. $this_year . '
';        echo '

';                   echo '
';               }           echo '
';                // Imprimi o link do post.       the_post(); ?>
       <h2 id="post-<?php the_ID(); ?>">       <a href="<?php the_permalink(the_title()) ?>"><?php the_title(); ?>

            <?php                 echo '
';           $prev_year = $this_year;             }        echo '
';          }          ?>


title: How to show a featured image as current?

text:
On the right rail here: http://www.julianamaeberger.com/soma/sample- testimonial-3/ I am showing a random post "Testimonial". Below that I am showing all featured images for the category "Testimonial" so that you can flip through the images and choose where you want to go next. I want to highlight the image that is related to the content above, but can't figure out how to do it. This is my first time building templates, so I may be going about it the wrong way. Any help in the right direction would be much appreciated. Here is the code for the right rail:

Testimonials
          <?php      $postslist = get_posts('category_name=testimonial&numberposts=1&orderby=rand');      foreach ($postslist as $post) :          setup_postdata($post);      ?>          <?php the_content(); ?>          <?php endforeach; ?>

               <?php      $postslist = get_posts('category_name=testimonial&numberposts=-1&order=DES');      foreach ($postslist as $post) :          setup_postdata($post);      ?>
                  <?php the_post_thumbnail( 'nav' ); ?>
               <?php endforeach; ?>


title: How to create and set a separate template file for articles in Genesis framework? (Wordpress)

text: I am working in a website which uses Genesis framework (Wordpress). I would like to have different menus for Homepage and articles, how do i create a template in Genesis and use it accordingly? Any suggestions would be helpful. Thanks, Balan


title: Remove Personal Options section from Profile

text: I want to hide/remove the Personal Options in the **Your Profile** (`wp- admin/profile.php`) admin page. I am aware that solutions for this exist, but I they use jQuery to do hide this section. This works, but when a user has JavaScript disabled in their browser, it will show up again. Therefore it is not a proper way to remove Personal Options. Is there a way to remove the Personal Options section from the HTML source of the page? This means no jQuery or CSS hacks, or core file modification.


title: WP Query Wordpress Post Type with the same Taxonomy name

text: This is what I have:   * Custom Post type "Books" with Taxononies/Categories "Genre" and "Author"   * Another Custom Post Type "Authors" which have all author pictures and bios. This is what I want to do:   * On the single "Book" page, have a sidebar with the books "Author" picture and bio. I know how to get the "Author" Taxonomy of a "Book" post, but the information I need is from the "Author" Custom Post Type with the same name. The only thing i can think of is that the slug for both would be the same (i.e. if the books author was "John Smith", the taxonomy would be "john-smith" and the post that I need to query from my "Authors" Custom Post Type would also be "john- smith"). I just don't know how to go about getting it or if there is another way of doing it. I think it should be something like this:                  $bookauthor = wp_get_post_terms($post->ID, 'author', array("fields" => "slug"));        $custom_query = new WP_Query(array(        'post_type' => 'authors',        'name' => $bookauthor      or this:                  $bookauthor = wp_get_post_terms($post->ID, 'author');        $bookauthorslug = $bookauthor[0]->slug;        $custom_query = new WP_Query(array(        'post_type' => 'author',        'name' => $bookauthorslug      But neither works.


title: Changing 'rewrite' argument after custom post type is registered

text: I'm am attempting to change the rewrite argument after it has been defined and passed as an argument for 'register_post_type' in a plugin. My issue is that I am utilizing a plugin that defines a custom post type. I can manually edit the rewrite argument in the plugin; however, doing so will mean that I have to do this every time the plugin updates. I was wondering if there is a way that I can change this with some code in another plugin or functions.php file. I was thinking there might be a function that would allow me to alter these arguments or a way in which I could unregister and reregister the custom post type. Any ideas?


title: White screen when saving changes

text: I just migrated a WordPress Multisite and Database locally and have successfully setup everything using MAMP Pro. The website and back-end load great and the subdomains work as expected once added the the hosts file. I am having a strange issue however when I try to make any updates to the back-end. For instance: When going to a page, making updates and then clicking the "update" button, it submits the update but then displays just a white screen. Seems like when I navigate back to that page the update has been added to the database but I can't figure out why only a white page is being displayed instead of redirecting back to the updated page. I've spent hours trying to figure this out with no success. Below are the error messages I receive: Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp-includes/wp- db.php on line 1142 Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/functions.php on line2905 Notice: automatic_feed_links is deprecated since version 3.0! Use add_theme_support( 'automatic-feed-links' ) instead. in /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/functions.php on line 2900 Warning: Cannot modify header information - headers already sent by (output started at /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/wp-db.php:1142) in/Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- admin/post.php on line 222 Warning: Cannot modify header information - headers already sent by (output started at /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/wp-db.php:1142) in/Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/pluggable.php on line 875


title: Any way to sync mailing list members with a WP role?

text: I was able to do this in Drupal, where people could be added to a mailing list (ie Mailchimp, etc) when registering for a site. I'd like to figure out how to do this in WordPress. I'd like to offer a free course on a site for people who sign up for my mailing list. I'm thinking it's less likely that I can sync a mailing list to WP - perhaps there's a way to require subscription to a mailing list when someone registers?


title: Populate a ACF Select Dropdown from Custom Post Type

text: Is it possible to populate an Advanced Custom Fields (ACF) Select Dropdown - options - with all the posts within a specific Custom Post Type (PCT)? Thanks in advance, Ian.


title: How to make a posts page display only intros of posts?

text:
My blog, the Posts page here: http://richardclunan.com/blog - displays full blog posts. I'd like it to display only the intros to the posts, and users click into a post to read the full post -- because users will then be able to more easily scroll through the posts to decide which ones to read. How do I make the page richardclunan.com/blog display only post intros? ......... Edit: I found a 'category.php' file in my 'twentyeleven' folder. But not in 'twentyeleven-child'. So I guess it's the one in 'twentyeleven'. I couldn't find:               the_content();      But I found the following 7 lines of code in different places -- each has the the word 'content' in -- is it any of these lines I need to change?:
          <?php twentyeleven_content_nav( 'nav-above' ); ?>          get_template_part( 'content', get_post_format() );          <?php twentyeleven_content_nav( 'nav-below' ); ?>


title: Create special WordPress slideshow with "jquery.cycle.all.js"

text:
i want to create my own slideshow without using any slider plugins hear is my code -- in the footer ---                                 in my front-page.php

the title 1
                 <img src="<?php bloginfo( 'template_url' );?>/slideimage/myimage1.jpg">

the title 2
                 <img src="<?php bloginfo( 'template_url' );?>/slideimage/myimage2.jpg">

      -- in css file ----               #slideshow {         width: 232px;         height: 232px;     }     #navSlider {         z-index: 50;         position:absolute;         width:19px;         top:0;         right:-5px;     }     #navSlider a {         display:block;         height:31px;         margin: 0 0px;         padding: 3px 6px;         border: 1px solid #ccc;         background: #cff;         text-decoration: none     }     #navSlider a.activeSlide {         background: #aaf;         padding:9px 0 0 0;         text-align:center;     }     #navSlider a:focus {         outline: none;     }     #textBack {         background-color:#000;         /*color:#FFF;*/         opacity: 0.4;         height:30px;         position:absolute;         right:0;         bottom:0;         width:232px;         /*text-align:center;*/     }     #textSlide {         color:#fff;         height:26px;         position:absolute;         bottom:0;         right:10px;         font-size:18px;         /* margin:auto;*/         /* width:232px;*/         /* text-align:center;*/     }     .pics {         height: 232px;         width: 232px;         padding: 0;         margin: 0;     }     .pics img {         padding: 15px;         border: 1px solid #ccc;         background-color: #eee;         width: 200px;         height: 200px;         top: 0;         left: 0     }     .slideContent {         margin: 30px auto;         width: 244px;         height: 234px;         position:relative;         top: 0;         left: 0;         background-color:#069;     }      i create this and actually it works alone very nice but i don't know why it won't work in wordpress and is there any matter if there is another slider? please help


title: struggling with syntax for the_post_thumbnail();

text: i want to display the alt text for a featured image. I've been using the the_post_thumbnail(); function to display the image like this:               if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.         the_post_thumbnail('medium');     }       Question: How do I display the Alt attribute for this image?


title: wordpress help needed. How to display both home.php and index.php?

text: Hey guys i recently created a theme. I want to show home.php when a visitor visit home page but all my blog posts are listed in index.php file. Can someone suggest me how to display index.php i tried http://www.mysiteurl.com/index.php but it redirecting me to http://www.mysiteurl.com/home.php Please advise me. Thanks


title: How to grab facebook page feed?

text: Hey all, i'm using the plugin wp-Lifestream in its 0.99.9.6 version (the 0.99.9.8-BETAdoesnt work for me) and i was wondering if it was possible to associate a fb page feed rather than a profile feed. So far i didnt find any answer to that. Thanks in advance.


title: Sort By Custom Field - Strange Problem

text: I have a site where I'm posting some of the post at Features with a meta key name "Listing Type" and meta value "Featured". Now the problem is when I use: `query_posts($query_string . '&meta_key=listing_type&orderby=Featured');` ...only the Featured post showing. All I just want to show is the featured posts and then the rest of the post by the date order with the pagination too..


title: Suggestions for Dressing up blog for the holidays

text: I was wondering what you guys are doing to dress up your blogs ? any plugins that add some cool effects like snow flakes, maybe greeting popup, footer, music, header rotation, list of new years resolution, wishlist widget display .... I was wondering what you doing to dress up your blog around holidays, maybe we can compile a nice list together - but god forbid - do them all together in one blog :P thanks for suggestions.


title: term_description help

text:
i have a piece of code which is helped to display the description of custom taxonomies but i want to put `<h1>` tag for the title of description, but that description box doesn't takes html tags, so how can i implement html tags to my description here is my code

<?php                  if ( is_tax( 'location' ) ) {                     echo term_description();                 }                 elseif (is_tax('mba_courses')){                     echo term_description();                 }                 elseif (is_tax('duration')){                     echo term_description();                 }                 ?>


title: Prevent access or auto-delete readme.html, license.txt, wp-config-sample.php

text: Just a quick question that might help a tad bit with security. I noticed that the readme.html file has the version number listed. It reappears after each upgrade and so do the licence.txt, and wp-config-sample.php. Is there a easy way to have WordPress auto remove these files after an upgrade? I already block the version number from showing in the meta tags, rss feeds, atom, etc. I know this type of security isn't exactly _that_ much helpful, but just thought it might be a tiny start. I heard that people can simply check the version of jQuery that is included in WP-includes and cross reference which version of WP shipped it.


title: CSS for Created Menu "Active Selected" not working, everything else is!

text:
I have created a Menu (for the nav bar) it is placed in a copy of the header.php file in my child theme right below:                <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary','container' => '' ) ); ?>      It works fine EXCEPT the CSS for the Active Selected menu item is not working for everything but "Home". This changes the background for "Home" when selected but none of the other top menu items.               #access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, #access    ul li.current-menu-item > a, #access li.selected > a, #access ul li.current-menu-parent > a, #access ul li.current_page_item, #access ul li.current-menu-item, #access li.selected {     background-color: #1E0D51 !important;     }      All the CSS does show up for Hover. I have spent hours on this and can not figure out what the problem is. Any insights or ideas are gratefully appreciated. Thanks Tim Place in header.php after `<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary','container' => '' ) ); ?>`
                  <?php if ( is_user_logged_in() ) { ?>
 <a href="<?php echo                                               bp_loggedin_user_domain() ?>activity/just-me/">My Wall

 <a href="<?php echo bp_loggedin_user_domain() ?       >activity/friends/">My Friends' Activities

 <a href="<?php echo bp_loggedin_user_domain() ?    >profile/edit/group/1">Edit My Profile

 All Members

 All Groups

 <a href="<?php echo bp_loggedin_user_domain() ?>groups/">My Groups

 All Events

 Calendar View

 <a href="<?php echo bp_loggedin_user_domain() ?>events/my-events/">My Events

 <a href="<?php echo bp_loggedin_user_domain() ?>events/my-events/">Create an Event

          <?php ;} ?>


title: Create XML files on post edit screen

text: Ok, that's a weird question, I know.. I'm so confortable with WP that I don't want to use any other application to generate XML (KML - _Editors note: These are Google Earth files._ ) files. I want to use a custom post type with nothing else just a bunch of custom fields and meta boxes. I have the XML schema (a custom single.php) set up: certain custom field values goes in between the right XML tags and in theory I have an XML that I'm able to create, modify and delete with WP. The problem is that it is still a php/html file and not an xml, and the browser uses it as a html/php file and tries to interpret it as html even though xml is declared at the top. Is there a libary or a way to grab the html output of these files and somehow convert it to XML? Thanks. **UPDATE 1:** That's how I get a placemark's name (it gives you the name) but without the tags:               <?php if(get_field('marker_style')): ?>         <?php while(the_repeater_field('marker_style')): ?>             <?php echo '<name>' the_sub_field('marker_style_id') '</name>' ;?>         <?php endwhile; ?>     <?php endif; ?>      **Update 2** : With the help a tutorial I came up with this code: http://pastebin.com/zGJHm19t But it's not working. It looks that I can't store my field values in variables and use them on the page in this context. You may think it's because of the plugin I use for custom fields, but that's not the case: if I put a simple `$title = the_title()` and then I try to echo the `$title` I get nothing. On line 39-42 the original tutorial gave the values themselves and the XML got populated with them beautifully. The logic here is that I store the values in variables and use the vars here, but as I mentioned, for some reason I don't see right now, the variables are empty.


title: odd behaviours from template tags

text:
Some of my template tags are playing up, and they have left me confused. On one site, that has been live for over a year without any of these issues, on all the pages that have custom query loops, `the_content()` was repeating the first entry. I replaced that line with `echo get_the_cotent($post->ID)`, which I thought was totally equivalent, and it solved the problem. Now, I have a very similar issue with another site. Trying to fetch and display content from child pages, I have this code block:               global $post;     $my_wp_query = new WP_Query();     $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));     $children = get_page_children($post->ID,$all_wp_pages);     foreach($children as $child){              ?>

<?php the_title($child->ID); ?>

           <?php     }      but this just repeats the title of the parent page. However, if I replace `the_title` with `echo get_the_title(` is works as expected. I am only _assuming_ these are comparable issues, the certainly have similar symptoms and solutions.


title: Why is my comment feed broken?

text: Here is my site. According to the WordPress codex, my comments feed should be http://oldmankit.com/comments/feed/. Indeed, every post has that link in its header. However, it's broken. If you click on that link, you'll see that loading it returns a completely blank page. My first question is, can anyone help me work out why it's broken? Second, is there a good reason to keep the comments feed? Obviously the posts feed is important for a blog, but a _comments_ feed?


title: Out of Memory when Uploading an Image

text: Sometimes when I upload a picture (either with flash or browser uploader), I get a message like (this was with a 1.46MB jpg):               Fatal error: Out of memory (allocated 69206016) (tried to allocate 4000 bytes) in /home/ab64489/public_html/wp-includes/media.php on line 254      I am on a shared host, but the max upload size is 64MB. I've tried uploading other files (I made a zip of some random files, with the archive totaling ~58.1MB, and it uploads and crunches with no problem, so it's not the file size). It also seems that the upload works fine, but when it tries to crunch, then it encounters the error. I've seen similar problems here and on other sites with no real solutions. What could be the cause of this issue?


title: Javascript 2 elements dependent onclick .toggle

text: Hi I have two JavaScript elements for logging into and create an account. They both overlap each-other when the div id is clicked and I need them to hide when the other id is clicked and vice versa.               <script type="text/javascript">     jQuery(document).ready(function(){         jQuery('#sign-in').live('click', function(event) {                      jQuery('#login-content').toggle();         });     });     jQuery(document).ready(function(){         jQuery('#create-account').live('click', function(event) {                      jQuery('#create-content').toggle();         });     });     </script>


title: Query specific posts per user selections from dropdown menus

text: This may be a little different than most people do. I'm trying to show certain posts that are determined by 4 different "categories." I have a large database table full of "products" (I'm using the WP Products plugin, but I'm willing to change plugins). When a person comes to the site, they'll have 4 drop down menus to chose a specific category in each menu, and then query the results determined by those 4 categories. I've been looking into `query_posts` or `$wpdb` to implement this. What is the best route to take in this situation?


title: How to rotate the header image per day?

text: I'd like to have my header banner change every day, chosen (e.g. randomly) from a list/folder of images. So far I only found plugins that select a random banner per post or per page view, neither is what I want. Do you know of a plugin, or any other way? Edit: Example. I'm adding a folder to my wordpress installation. This folder contains some header images. Every 24 hours, an random image is chosen from this folder and becomes the header image for 24 hours, until another random image is chosen. Actually, I don't care how exactly the image is chosen - I'm fine with rotating through all images in the folder as well. The only thing I care about is that the chosen image stays there for 24 hours. Basically it's the same as if I were picking a new header image manually every day.


title: Show individual author rank from query of cumulative post view count for all authors

text:
I originally was going to post a question on how I would go about ranking a list of authors by the amount of post views from all of their posts combined. But I luckily found a solution here: List users with the most total posts view This is the code I'm using from that page, except I tweaked it a little to fetch post views from a plugin I use:               <?php global $wpdb;     $topuser = array();          // query all posts by each user     $users = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY ID");      foreach ( $users as $user ) {                $query = get_posts( array('author' => $user->ID,  'posts_per_page' => '10000000000'));         $counter = 0;              // get each post of a user         foreach ( $query as $post ){             $views = absint( get_post_views('normal') );             $counter += $views;         }         $topuser[] = array( 'id' => $user->ID, 'views' => $counter);         wp_reset_query();     }          // function to sort array based on views count     function sortViews($a, $b) {         return $b['views'] - $a['views'];     }     usort($topuser, 'sortViews'); // sort the array     $output = array_slice($topuser, 0, 10); // slice the array by limit 3          // output the result: user, total postview count, latest post     foreach ($output as $user){         $profile = get_userdata($user['id']);         $query = get_posts( array('author' => $user['id'], 'numberposts' => 1 ));              echo '
' . $profile->user_nicename .' ('. $user['views'] .')
';                     foreach ( $query as $post ){             echo 'post_name . '">' . $post->post_title . '';             echo get_post_meta($post->ID, get_post_views('normal'), true);         }     } ?>      Now I would like to take this solution a step further towards my vision when first coming up with the idea. I want to show the specific rank (position in the list) of each user on their buddypress profile page. I would paste this code in member-header.php Example: It would say something like "User Rank: 15", meaning that this user shows up as the 15th result when executing the above query (of course I would change the number from 10 to more which is why that would be possible). Hope you guys can help out. Thanks in advance :)


title: Whenever I got to my new pages (http://www.cwmags.com/news) it requests login?

text: I have two news pages on different domain names (different content) using the same template. http://www.cwmags.co.uk/news and http://www.cwmags.com. I have check .htaccess (301 redirects), CHMOD permissions and on both sites they are identical (apart from difference in domain name). Authentication Required Log In required. Clicking cancel is sufficient to access the web pages. Any suggestions on where to look?


title: How to respond with WP_Ajax_Response();

text:
I'm using WP_Ajax_Response(); to respond to some ajax and output it to a div, everything works great. But how exactly do I respond if I want to output some php in to a div? A wordpress loop for example. I assume can't just do `$response = include 'loopHandle.php';` and then `$("body.blog #content").html(this.data);` I've seen some methods that make a call directly to your file and then use wp_load(); but I've heard that's something we should stay away from. I also know that an AJAX response must be in JSON or XML, so how do I get php into my div? **Example** On this click event:               $link_url = esc_url(wp_nonce_url( admin_url('admin-ajax.php?&action=dynamic_date&my_date='.$date), "dynamic_date_nonce")); ?>
<a href='<?php echo $link_url; ?>' id='sort-month'>     <?php _e($fmonth,'sort-month'); ?>
      I send over my action, nonce and date key-pairs. I then capture those key- pairs using something like:               var s = {};     s.response = 'ajax-response';     s.type = "GET";     s.url = sortbydate.ajax_url;     s.data = $.extend(s.data, { action: url.action, _ajax_nonce: url._wpnonce, my_date: url.my_date });     s.global = false;     s.timeout = 30000;     s.success = function(r) {     res = wpAjax.parseAjaxResponse(r,this.response);     $.each( res.responses, function() {     switch(this.what) {     case "fulldate":     $("body.blog #content").html(this.data);      The important variable here is the my_date key-pair. The action then kicks off this function in my functions.php.               function dynamic_date() {     check_ajax_referer('dynamic_date_nonce');     $fdate = $_GET['my_date'];     $response = new WP_Ajax_Response();     $response->add(array(     'what' => 'fulldate',     'data' => $fdate)); //get and send the data you want to front end.     $response->send();     } //end action jackson      Which outputs "2012-9" or whatever date I click on. That's great, works fine for test purposes, but now I want to use that date by exploding it into an an array and use those variables in a wordpress loop. Currently I have the loop in a file called loopHandle.php, but it's not making use of the date variables as if my understanding is correct I can't access them from loopHandle.php? If I could, then I'd just use `$fdate = $_GET['my_date'];` in loopHandle.php and finish my loop. I'm still left with the conundrum of loading loopHandle.php into my div though. The one method I assume is the way to go about it is to form the loop in my functions.php, somehow convert it into JSON or XML and out put it on my page.


title: Get price and title from Simple Shopping Cart Plugin

text: **Plugin:**   WordPress Simple Paypal Shopping Cart **Implementation Used:**   HTML in theme page template (page.php) Example: echo print_wp_cart_button_for_product('Product Name',Price); So if I wanted to sell a blue widget for $9.99 the code would be:               echo print_wp_cart_button_for_product('Blue Widget',9.99);      **Problem:**   When using the code above the plugin works fine... however, when I try to populate the product name and price it does not work. I am using the WP custom field for the price as such:               $price=get_post_meta($post->ID, 'Price', true);      Then I populate the shopping cart code as such:               echo print_wp_cart_button_for_product('the_title()',$price);      When products are added to the cart it shows the product name as "the_title()" and the price as "$0.00" The title and price display anywhere on the page I place them accept for in the cart code for some reason.


title: Load plugin selectively for pages or posts, etc

text: It's possible select which plugin load by page or post, because i have 35 plugins and many of these no necessary in many pages or posts and only for some pages, how can do this? I've tested beta plugin for this but it doesn't work right and I want to know if exists code in wordpress to deactivate plugin in some pages or posts that I can use to create my plugin.


title: How to sanitize user input?

text: What is the correct way sanitizing form data before submitting to the database? I have the following text input:               <form method="post" action="options.php">         <?php wp_nonce_field('update-options'); ?>          <input style="width:100%" type="text" name="data[title]" id="title" value="<?php $title = get_option('data_test'); echo $title['title']; ?>" /></p>              <input type="hidden" name="action" value="update"/>         <input type="hidden" name="page_options" value="lu_ban_data"/>         <input style="float:left;margin-top: 10px; margin-bottom: 10px; vertical-align: middle; clear: both;" class="button-primary" type="submit" value="<?php _e('save changes') ?>" />     </form>      I tried doing `echo sanitize_text_field($title['title']);`, but it only sanitizes the data upon requesting it from the db, the data inside the db still contains unwanted characters. This is why I want to sanitize before submitting it.


title: Grouping of CPTs and taxonomies into menu groups in admin

text: I have a group of custom post types such as "CPT A", "CPT B" and "CPT C". I display the admin page for each of these as subpages under a common Admin page.               add_menu_page('Console',         'Console',         'plugin_console',         'plugin',         array ( $this, 'page_main' ),         "http://example.com/favicon.ico",         6         );      There are also custom taxonomies for the CPTs, and some of them are shared. What I'm to do is, in the admin pane add submenu page off the main one that links to the taxonomies in edit-tags.php.               add_submenu_page('plugin',         'Taxonomy',         'Taxonomy',         'manage_options',         'plugin-taxonomy',         array( $this, 'page_taxonomy' )         );      The problem I encounter is that the list table doesn't fill. Any suggestions on a good/better approach are most welcome. Just as a follow up, I want a menu that looks something like:               -Console     --CPT A     --CPT B     --CPT C     --Taxonomy 1     --Taxonomy 2


title: Variable not staying set

text: This is most likely just a PHP problem, and it's probably a pretty simple answer, but I just can't seem to get my brain to function this morning. This is what I'm trying to do:                $job_file = $cfs->get('job_file'); // job_file is a URL           if ($job_file = NULL) {          echo "NOT AVAILABLE";      } else {          echo '' . get_the_title() . '';      }      It will display the URL of the current page instead of the `$job_file` variable. What am I missing?


title: Admin bad not appearing in front end and cant get it back

text: I tried everything i found on the net: checking whether wr_header and wp_footer exist in my template (they do), checking my css (no rule is blocking it), checking whether the option is activated on my profile (it is), etc. but whatever i do i cant get it back. There is only a blank space up there. Is there any effective way to find out what is causing this? Its driving me crazy. Thanks.


title: cannot grab post meta from extended Walker_Category class properly

text: Trying to show some custom post meta inside an extended Walker_Category class. I am very inexperienced with Object Oriented Design so this issue is quite difficult for me to solve I am essentially trying to check the boxes of the categories that the user has already entered if they happen to edit a post with saved data here is the code so far in the extended class:                   <?php         class MyCategoryWalker extends Walker_Category{                   public $post_cb;                   //pass through the saved checkbox choices         function __construct($custom_meta){             $this->post_cb = $custom_meta;         }                   //get the array of checkbox choices and convert it into a simple string format          function get_cat_rp_list(){                  $the_cat_list;             foreach($this->post_cb as $cat_list){                 $the_cat_list .= $cat_list.', ';             }             $the_cat_list = rtrim($the_cat_list, ',');                  return $the_cat_list;              }                   //actually builds the checkbox list         public function start_el(&$output, $term, $depth, $args){              echo self::get_cat_rp_list();              $args = wp_parse_args(array(           'name'    => 'my_category_input',           'checked' => array(self::get_cat_rp_list()), //will input the string of checkboxes saved                ), $args);              extract($args);              $checked = checked(in_array($term->term_id, $checked));              ob_start(); ?>                 <li>           <input type="checkbox" <?php print $checked; ?> id="category-<?php print $term->term_id; ?>" name="<?php print $name; ?>[]" value="<?php print $term->term_id; ?>" />           <label for="category-<?php print $term->term_id; ?>">             <?php print esc_attr($term->name); ?>           </label>                     <?php // closing LI is added inside end_el              $output .= ob_get_clean();       }     }      so that was in my class, For testing purposes I have added the "`echo self::get_cat_rp_list();`" in the `start_el()` method. On the particular post I have, there are only two categories stored in the post. However it echos out the two categories about 30 times (the same amount of total categories I have on this site actually) here is my code to show the check list on the post:               $custom_meta = get_post_meta($post->ID, '_custom-meta-box', true);          $newWalker = new MyCategoryWalker();          wp_list_categories(array(       'walker'   => $newWalker,       'name'     => 'my_category_input',       // name of the input     ));      here is the code that saves/updates the checbox selection (which DOES work):               function save_pref_meta_box()     {         global $post;         // Get our form field         if(isset( $_POST['my_category_input'] ))         {             $custom = $_POST['my_category_input'];             $old_meta = get_post_meta($post->ID, '_custom-meta-box', true);             // Update post meta             if(!empty($old_meta)){                 update_post_meta($post->ID, '_custom-meta-box', $custom);             } else {                 add_post_meta($post->ID, '_custom-meta-box', $custom, true);             }         }     }


title: media_sideload_image returning File is empty

text: I've tried everything I could find on the internet, but my media_sideload_image is still only giving the error `File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.` I've checked my PHP.ini file and file uploads is on. It gives this error on every image url I give it. I'm programming on localhost using xampp. The code :               function check_images($content, $post_id){             if(!empty($content))             {                 $doc = new DOMDocument();                 $doc->loadHTML($content);                 $tags = $doc->getElementsByTagName("img");                 if( $tags->length > 0 )                 {                     foreach( $tags as $tag )                     {                         require_once(ABSPATH . 'wp-admin/includes/media.php');                         require_once(ABSPATH . 'wp-admin/includes/file.php');                         require_once(ABSPATH . 'wp-admin/includes/image.php');                         $val = $tag->getAttribute( 'src' );                         $url = $val;                         $upload = media_sideload_image(urldecode(rawurlencode($url)), $post_id);                         if(is_wp_error($upload)){                             echo $upload->get_error_message();                         }                      }                  }              }     }       I don't really know what to try next to get this problem solved, any help is appreciated! The purpose of this functions is to import all images from `<img>` tags inside a given string to the Wordpress Media Library. If you have any other way to do this, instead of using `media_sideload_image`, then feel free to share.


title: I want to edit the search function

text: I'm changing some parts of WordPress, like adding posts or comments, to use procedures in the database instead of using inline database calls to see if the performance enhances. I've been looking the search function now, but I can't find the code for it, the select string more importantly. Anyone who can help me locate where the code for the search function is (like searching for posts or comments not the archive)? Thanks in advance.


title: What is proper way to change or edit specific theme options?

text: I have installed WP property real home theme and now want to add some extra fields in it. My questions are   1. Is there any plugin which add some extra fields to this particular theme.   2. Do i have only chance to read more about documentation of this theme(I have already read that).   3. Do i need to do manually in code and database to achieve this. Please provide suggestions. Thank you. ![I want to add red fields in real home theme](http://i.stack.imgur.com/YJwzP.jpg)


title: Using jQuery DataTables and yadcf

text: I want to display a sortable/filterable table of data using the jQuery yadcf plugin, that runs with DataTables. First thing I did is the DataTables integration, that can be seen on this page This first step works fine, so I went on to the next step. I then set up another page with exactly the same HTML/PHP and Datatables code, but adding the enqueue of the yadcf script+css, I can see several issues:   * column 0: the search works only on the first line (the link) of each row, though with DataTables alone both lines are searched   * using the filter of any column displays the expected result, but the controls immediately disappear, so it is not possible to add another filter, or clear the existing one.   * same behaviour when one clicks on any "clear filter" button   * some filter types are not recognized: `range_number_slider` is not displayed properly and `select2` provokes an error as `select2` is not a defined function; but I've no idea how to integrate the missing functions.   * all the controls / messages and such remain in english, and I don't know how /where to translate them   * column 0 "autocomplete" results in an ugly display, as the helper message is inserted at the beginning of 1st row, propelling the following columns further on the right. Currently, my js file is the following:               jQuery(function() {         jQuery(document).ready(function() {             'use_strict';                  var oTable;                  oTable = jQuery('#hebergements').DataTable({                 "columns": [                     null,                     null,                     null,                     null,                     null,                     { "bFilter": false, "bSort": false},                     { "bFilter": false, "bSort": false},                     { "bFilter": false, "bSort": false},                     { "bFilter": false, "bSort": false},                 ],                 "language": {                     "processing": "Préparation des données ...",                     "lengthMenu": "_MENU_ hébergements par page",                     "zeroRecords": "Désolé, aucun hébergement avec ces critères",                     "info": "_PAGE_ / _PAGES_",                     "infoEmpty": "Aucun enregistrement disponible",                     "infoFiltered": "<span>- (filtre à partir de _MAX_ hébergements)</span>",                     "search": "recherche",                     "paginate": {                         "first":    "premier",                         "previous": "précédent",                         "next":     "suivant",                         "last":     "dernier"                     }                 },                 "sScrollX": "100%",                 "sScrollXInner": "200%",                 "bJQueryUI": true,                 "bstateSave": true             });                  yadcf.init(oTable, [                 { column_number: 0,                     column_data_type: "html",                     html_data_type: "text",                     filter_type: "auto_complete"                 },                 { column_number: 1,                      column_data_type: "html",                     html_data_type: "text"                 },                 { column_number: 2,                      column_data_type: "html",                     html_data_type: "text"                 },                 { column_number: 3,                      column_data_type: "html",                     html_data_type: "text"                 },                 { column_number: 4,                     filter_type: "range_number_slider"                 }             ]);              } );     });      As these scripts will be used in an only page of the site, the enqueues have been put in the functions file:               function specific_scripts() {         if ( !is_admin() )              if (is_page( array(932, 934 ) ) ) {                 wp_enqueue_script('datatable', get_template_directory_uri() . '/js/jquery.dataTables.js', array('jquery'));                 wp_enqueue_script('liste-hebergements', get_template_directory_uri() . '/js/liste-hebergements.js', array('jquery', 'datatable'));                 wp_enqueue_style('liste-hebergements-style', get_template_directory_uri() . '/css/jquery.dataTables.css');                 wp_enqueue_style('liste-hebergements-style2', get_template_directory_uri() . '/css/jquery.dataTables_themeroller.css');                      if (is_page(934)) {                     wp_enqueue_script('yadcf', get_template_directory_uri() . '/js/jquery.dataTables.yadcf.js', array('datatable', 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-slider'));                     wp_enqueue_style('liste-hebergements-style3', get_template_directory_uri() . '/css/jquery.dataTables.yadcf.css');                 }             }         }     }     add_action( 'wp_print_scripts', 'specific_scripts');      At this stage, I'm stuck and don't know how to proceed further. Thanks for helping.


title: Filter index page plugin

text: I am looking for a wordpress plugin that allows my users to customize which posts are appearing on the home page. The users should have a settings page where they can select which categories and tags they´d like to see posts from. Do you know if anything like that has been developed? Free or premium.


title: How to use WP default post list tables in a plugin?

text: I'm developping a plugin to manage a base of users and I'd like to show them in the same type of table used in other parts of the WP admin (post lists, user lists, etc.), I'd like to have the same look and the if possible the column sorting too.


title: how to change user roles for users who doesn't have any. (about 8000 users)

text: We have about 8000 users who doesn't have any roles. we need to change them to "contributor". How can I change them to "contributor"? Should I do on database? if so, which fields I need to update? Thanks,


title: What are the recommended database permissions for WordPress?

text: I just got WP running on my own server. I am not trying to lock things down more. What permissions should the db user have to my WP db?


title: Looking for WordPress Slideshow Gallery Plugin

text: I'm looking to see if there is already a plugin that does a gallery slide show like Huffington Post does where it shows either one image or video then you click next to see the next one. There is no need for a rating system. I'm hoping there is so I don't have to figure out how to make one :) http://www.huffingtonpost.com/lee-brenner/viral-videos-2010_b_801501.html Other examples: http://bleacherreport.com/articles/437878-larissa-riquelme-and-the-25-hottest- superfan-photoshoots/page/1 http://www.businessinsider.com/super-bowl-commercials-super-bowl- xlv-2011-2#volkswagen--the-force-1 **FOUND A SOLUTION USING NEXTGEN:** Actually someone found this post and they found the solution :) http://gregrickaby.com/2010/07/add-an-anchor-to-nextgen- gallery-image-browser.html


title: How can I add function calls to my plugin's options.php default submit routine?

text: I'm combining two of my plugins into one. I'd like to make the activation routine of the second plugin a checkbox selection in the settings panel of the new plugin. However, I'm unsure how to execute functions when the options are submitted. How can I do this? The my-plugin-options.php is basically this...               <form method="post" action="options.php">     <?php wp_nonce_field('update-options'); ?>     //options form goes here     <input type="hidden" name="action" value="update" />     <input type="hidden" name="page_options" value="check1, check2, check3, etc" />     <p class="submit">     <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />     </p>     </form>      And its called from my main plugin file with this...               function my_settings_admin() {     include_once dirname(__FILE__) . '/my-plugin-options.php';     }           add_options_page( 'My Plugin Settings',          'My Plugin Settings',          'manage_options',          'my-plugin-options.php',          'my_settings_admin',          $my_plugin_dir.'/favicon.png',          'top');


title: similar to Editor can create any new user except administrator

text: I have set up a wp multi-site with custom roles. One of the roles can add users. I need a solution to only show two roles available to the limited role on add user and leave all user types available to administrator. This code snipped works great for removing Administrator mode, but I don't understand enough of it to know if I could expand it to dis-clude other roles as well. Any help appreciated.


title: Woocommerce: Changing the variations select default value?

text: At my site i want to change the default value of the selecter that appears, when different variations exists. If anyone can give me a clue of how and where this is done, it would be highly appreciated!


title: Get a variable from object in array

text: I'm trying to `echo` `get_the_category($id)[0]->slug` and this works on localhost but not on the server. The error is > Parse error: syntax error, unexpected '['.... Is there a workaround?


title: How to create custom home page via plugin?

text: I want to code a plug-in that creates new custom home page. Note that I have never coded any plug-in before. 1) After activation of plug-in user needs to go to the options of the plug-in and set up that current home page will be replaced by the one that this plug- in generates ( I hope I can code this bit somehow in the future ) 2) **Plug-in generates custom home page that displays only**   * title and body of the latest post   * number of comments Could someone help me how to code the **2)** ? Currently I have one php file that is very simple plug-in. I can activate / deactivate it but I don't know how to code the home page. I'll be using WP 3.6


title: Change the contents of a dropdown through the admin panel?

text: I have a custom post type "Events". In Events, I have a custom field for "Place" which is a dropdown list. Is there a way to edit the contents of the dropdown list through the admin panel or is changing the code itself the only way?


title: WordPress Mulitisite - Unable to create directory

text: On one of my multisites I get the following error message when trying to upload any media: "Unable to create directory http://www.domain.com/wp- content/blogs.dir/18/files/2013/08. Is its parent directory writable by the server?" Firstly, the directory already exists as I see it when SSHing into the site. Secondly, I even recursively set the entire blogs.dir folders to 777. But I still get this error. This is the only site of 14 on my multisite install that gives me this error. Any ideas?


title: Some images not found 404 in localhost

text: I just transferred a WordPress installation from the domain to my localhost. I did all the usual steps: copy files, export DB and replace `domain.com` with `localhost`, update `wp-config.php` and refresh permalinks. All pages and custom rewrite rules work, but some images are giving a 404. When I check those images on the actual domain it all works fine, but something doesn't look right; if I check the url of the image it points to this path:               http://domain.com/wp-content/uploads/2013/08/IMG_0425-185x185.jpg      But this file doesn't exist! I looked in the uploads folder through FTP and the file isn't there, only `IMG_0425-185x185-150x150.jpg` exists. Note that `185x185` is part of the original filename but `150x150` is added by WP. In localhost the image doesn't show up (404), which makes sense. Why is the image showing up on the domain when it doesn't even exist? Is WordPress resolving the image to the generated thumbnail somehow? Why isn't it working on the localhost if this is the case? **Edit:** This is what makes no sense. How is this possible? Maybe the cache has something to do?   As you can see no trace of `IMG_0425-185x185.jpg` in the folder (??) but `IMG_0425-185x185-150x150.jpg` exists. ![enter image description here](http://i.imgur.com/gxp5iOQ.jpg)


title: Is it possible to use wp_localize_script to create global JS variables without a specific script handle?

text: Can we somehow use wp_localize_script() to create global js variables without a specific script handle which can be accessed from all the js files, even if the js scripts are not enqueued properly by using wp_enqueue_script ? This is the code I am using which creates varibale for 'ajaxscript' handle, so I cant access the object 'ajaxobject' in a js file which is being included in the header.php directly by `<script src="xxx" .... />`               wp_register_script( 'ajaxscript', get_bloginfo( 'template_url' ) . '/js/ajaxscript.js', array(), $version );     wp_enqueue_script( 'ajaxscript' );     wp_localize_script( 'ajaxscript', 'ajaxobject',         array(              'ajaxurl'   => admin_url( 'admin-ajax.php' ),             'ajaxnonce' => wp_create_nonce( 'itr_ajax_nonce' )         )     );


title: Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying

text:
I am registering sidebars and sidebar widgets. The theme currently supports two sidebars. Primary and Secondary. `add_action('widgets_init', array($this, 'add_sidebars'), 10, 2);`               public function add_sidebars(){         register_sidebar(array(             'name' => 'Primary Sidebar',             'id' => 'mbe-sidebar-primary-sidebar',             'description' => '',             'class' => 'mbe-sidebar',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
'         ));         register_sidebar(array(             'name' => 'Secondary Sidebar',             'id' => 'mbe-sidebar-secondary-sidebar',             'description' => '',             'class' => 'mbe-sidebar',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
'         ));         $this->add_sidebar_widgets();     }      Then I add all the preset widgets (post objects from a post type) as an available sidebar widget.               private function add_sidebar_widgets(){         global $mbe_content;         $widgets = $mbe_content->get_content('archive', 'mbe-sidebar-widgets');         if(!$widgets){             return;         }         foreach($widgets as $widget){             wp_register_sidebar_widget(                 'mbe-sidebar-widget-'.$widget['post_name'],                 $widget['post_title'],                 array($this, 'display_widget'),                 array(                     'description' => 'Sidebar Widget'                 ),                 ''             );         }     }          public function display_widget($args, $params){         echo 'widget';     }      I have also set those sidebar widgets as active widgets in the primary sidebar. Now for example, at a theme level, If I wanted to just use a dynamic sidebar...               if(is_active_sidebar('mbe-sidebar-primary-sidebar')){         dynamic_sidebar('mbe-sidebar-primary-sidebar');     } else{         echo 'NO PRIMARY WIDGETS!'.PHP_EOL;     }      It show's "widget" from my widgets, but that's where the output for my widgets will occur. So that doesn't matter. The point is, the dynamic sidebar is working, and I can see my widget outputter. A question I'm having is, how come if I add a simple default WordPress widget to the sidebar, it doesn't output anything on the sidebar? It's like it doesn't even exist or something. **How can I get my widgets to output on the sidebar, while still allowing the default sidebar widgets provided by WordPress to output on the sidebar as well?** I originally thought it was my `function display_widget()` So I tried getting all widgets, looping through them, then calling `the_widget()` on each of their widget ID's, but then I'm getting errors about that widget not being found, blah blah.


title: nothing comes up when i go to my website.com/wp-admin? Which files should I look for?

text: My hosting company (godaddy) tells me that someone has hacked my wordpress admin login and have put garbage on filesystem. My website is down. and nothing comes up when i try to get my files using mywebsite.com/wp-admin (which I use to manage my files). I am not an expert and had got the site done from outside agency.


title: Wordpress function like is_category for subcategory? is_subcategory?

text: Is there a function in WordPress that will check if the page you are on is a sub-category archive page? Like the way is_category checks if it's a category page?


title: Image URLs stopped working due to Permalinks?

text: I've been changing my Permalinks and changing my site the the "www" version (Which I think has broken my image and video links). All my images are "red x" now, both inside the library and the posts themselves. I have been looking in my cpanel and all the file paths are correct, but if I try to view them through WP or even just copy the url and try it within my browser, it appears broken. Is there a way to fix this at all? Other than reload everything back up. :-( To update: I just re-uploaded an image and it was saved as header1.png, so WP can see that there is another image in there. It's strange because all the paths seem to match in my library to where they are stored within cpanel. I feel that because I cahnged the permalink structure to %category%/%postname% that that is affecting the image structure which is wp- content/uploads/%year%/%month%/%imagename% by the looks of it.


title: How do I print a term list but alter the link text?

text:
I have a long list of taxonomy terms that all look like City-ST-Zip, ie: Phoenix-AZ-85043 or San-Diego-CA-92037 How do I print the list of terms so that the link URL remains intact but the link text is just the city name? ie:
Phoenix
      Also - A lot of cities have multiple zip codes, but I don't want to show a city name more than once.


title: Should i delete the posts created by a plugin on uninstall?

text: I created a plugin which is based on a Custom Post Type. When someone uninstalls this plugin, should i delete the posts under this post type or i should just leave them untouched?


title: How to strip non-alphanumeric characters, convert spaces to dashes, uppercase to lowercase in this context

text: I am using the Advanced Custom Fields plugin, which is very good. I am trying to take the output of one of the fields I created and give it the "permalink treatment", that is strip out non-alphanumeric characters like slashes, convert uppercase to lowercase, and convert spaces to dashes. Specifically I am wanting to do this with the checkbox field. I want to do this, because I want to use the outputted values as css class names. Its output is called by this bit of PHP (modified slightly from the documented use, see example #4):               <?php          $values = get_field('field_name');     if($values)     {          foreach($values as $value)     {         echo ' ' . $value;     }          }          ?>      Which returns all of the checkbox values (5 - 10 in this case) separated by a space. I successfully got the values showing up as class names, but now I need a way to format them to actually work as class names. How could I tweak this to work? I found this bit that seems to work for a sinlge string:               function stripJunk($string){             $string = str_replace(" ","-", trim($string));                  $string = preg_replace("/[^a-zA-Z0-9-]/","", $string);         $string = strtolower($string);         return $string;}      but in my case it's an array, and I don't know how to work with that. I'm pretty worthless when it comes to PHP, except for being able to tweak things a little bit without breaking it.


title: How to declare/provide file path in JQuery which is emeeded in the Wordpress theme

text: How to give the source location path in the jquery code, where my file is in **cah-new/wp-content/themes/theme_name/includes/func.php** and i have to give that path in the jquery code               $.get(\"func.php\", {      kindly help me, thanks in advance


title: At what priority does add_filter overwrite core functions?

text: I'm writing a plugin that adds some extra thumbnails, checkboxes, etc to the end of a post. I'm trying to figure out how to use add_filter properly. Basically, I've got `add_filter('the_content', 'do_some_magic_at_the_end');` And there is a corresponding do_some_magic_at_the_end function that takes $content and appends some stuff to it. I want this filter to be added after all other filters. I don't want it overwriting any other filter. The docs says default priority is 10, so I assume it is simply being added to a chain of filters that get run on the_content. If I set the priority to 1, will it overwrite any core functions?


title: Help with Wp + Mixitup code

text:
I'm using MixItUp and having this issue. I'm calling the filters like this:               <?php     $categories=  get_categories('child_of=14&hide_empty=0');     foreach ($categories as $category)         echo '
category_nicename.'">'.$category->cat_name.'
';     ?>      it works fine, all categories are showing with their respective data filter, just as expected. However, when I try to output the content for those categories, I get nothing at all, not even errors, just blank. This is the code I'm using:               <li class="mix <?php foreach(get_the_category() as $category) { echo $category->slug . ' ';} ?>">     <?php the_post_thumbnail('prod_th'); ?>
      Just in case, teh code works fine in pure HTML5, so I guess I'm doing something wrong in PHP or maybe forgetting something Any idea on what am I doing wrong? Thanx in advance :) Fore reference, I'm using this: http://kune.fr/javascript/tutoriel-integreez- mixitup-a-wordpress/


title: Compare Two Custom Post Types Using The Same Custom Taxonomy

text: I have two post types, _courses_ and _testimonials_ , sharing the same taxonomies. What I am looking to accomplish is to check whether a course is in the same category as a testimonial. Then display if it is, keeping in mind they could have more than one category each. I am currently able to check which categories they are in using `get_the_term_list()` but can't figure out how to go about comparing them to one another. What I need is to be able to check is if the categories checked off in pm_course(post-type) is the same as course_testimonials(post-type). If they have the same category then I want to display the testimonial, if not I want to do nothing. Really a basic if else statement but I can't seem to find a way to see if the checked categories are the same in both.


title: optimise SQL wordpress call

text: I have this code :               $querystr = "     SELECT *     FROM {$wpdb->prefix}posts     INNER JOIN {$wpdb->prefix}postmeta m1       ON ( {$wpdb->prefix}posts.ID = m1.post_id )     INNER JOIN {$wpdb->prefix}postmeta m2       ON ( {$wpdb->prefix}posts.ID = m2.post_id )     WHERE     {$wpdb->prefix}posts.post_type = 'produits'     OR {$wpdb->prefix}posts.post_type = 'coupsdecoeur'     AND {$wpdb->prefix}posts.post_status = 'publish'     GROUP BY {$wpdb->prefix}posts.ID     ORDER BY {$wpdb->prefix}posts.post_date     DESC;     ";      when loading page containing this so slooooooowwwww, is there a trick to optimize this ? I just need the post title and a meta value called "wpcf-lien". Thanks a lot.


title: Can I use a Custom Field as the Featured Image URL?

text:
Each post of my blog has a Custom Field which is the URL of a photo on Flickr. How can I use it as the Featured Image? Please note I'm asking this question because I'm migrating to a theme that makes use of the Featured Image to display thumbnails on the blog’s home page, but I would avoid enter them all by hand for all the 300+ old posts. **EDIT:**   * I'd prefer to avoid to change the theme's code, to avoid complications during future updates. But I can use child themes.   * The theme I'm using uses the `get_post_thumbnail_id()` function to obtain the featured image attached to the post:              <?php if ( has_post_thumbnail() ) :     $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );     ?>
         <a class="swipebox" href="<?php echo $full_image_url[0]; ?>" title="<?php printf( esc_attr__('Permalink to image of %s', 'envirra'), the_title_attribute('echo=0') ); ?>" rel="bookmark">             <?php the_post_thumbnail( 'vw_large' ); ?>


title: How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?

text: I have a blog at www.exeideas.com where I am sharing codes snippet too. I am new to WordPress and migrated from Blogger. So now my all codes shared in posts stop working. When I check my codes then found that all was fin but just Apostrophe, Quotation and, Dash are changes that is causing to stop my codes. I am sharing below what I am getting and what I want.   1. I am getting `’` and want `'`.   2. I am getting `”` and want `"`.   3. I am getting `‘` and want `'`.   4. I am getting `–` and want `-`. Now tell me what to do to fix this out. My code box CSS is given below. `#execodediv0 {width:99%;max-height:300px;border:3px solid black;overflow:auto;font: 12px Arial!important;word-wrap:break-word;}`


title: Group comments in the admin section

text: Is there any way to re-arrange the comments in the admin panel of WP? I'd list to nest them in the same way as it is happening in the front-end, thus having the opportunity to see the comment I have replied immediately above my answer. I did look for a plug-in, but apparently there is anything? I would be happy also for a quick dirty patch to be coded, but I don't have any idea where I can start looking this into. The only pertinent topic I found is this, but doesn't really enter into details. Thanks