title: Nested WP_Query breaking loop

text: I'm using `WP_Query` to get all pages without subpages. For each page I'm using again `WP_Query` to get all child pages of the current page inside the first loop. This all works fine and I'm getting the expected result. But when now using a third `WP_Query` on one of the sub pages, the second level loop breaks. I already tried the functions `wp_reset_query()` and `wp_reset_postdata()` but they didn't do the trick. Also I tried to save the `global $wp_query` and `global $post` and reset them after the loop, but this didn't help too. How do I implement nested queries in WP? **Edit** As requested (and how it would have been correct) here is my code. I also realized that my problem does not apply only to the third, but also to the second loop.               $all_pages = new WP_Query(array('post_type' => 'page', 'post_status' => 'publish', 'post_parent' => 0));          while($all_pages->have_posts()) {         $all_pages->the_post();         include(get_page_template());     }          wp_reset_postdata();      In the page templates I'm using the following code to get child pages:               // child page content rendered here, depending on template          if($post->post_parent == 0) {         $child_pages = new WP_Query(array('post_type' => 'page', 'post_status' => 'publish', 'page_parent' => $post->post_parent));              while($child_pages->have_posts()) {             $child_pages->the_post();             include(get_page_template());         }              wp_reset_postdata();     }      I can execute WP_Queries on the child pages. But when then using `the_post();` the `$child_page` loop stops executing.


title: Random Default Avatar Function

text: UPDATE! After a little help from the wordpress.org forums, I made some progress with this code:               // Custom Default Avatar          if ( !function_exists('fb_addgravatar') ) {     function fb_addgravatar( $avatar_defaults ) {     $myavatar = get_bloginfo('template_directory') . '/images/avatars/avatar_' . (string) rand(1,5) . '.png';     $avatar_defaults[$myavatar] = 'Users';     return $avatar_defaults; }     add_filter( 'avatar_defaults', 'fb_addgravatar' ); }      Adding that to my functions.php file will allow me to choose my custom avatar "Users" in the Discussions panel, and it WILL show up for commenters who do not have there own Avatar. However, so far it is using the same image for all commenters. Ideally, I would like to go to discussions, choose "Users" at the bottom of the Avatar list, and have a random image for each commenter who does not have their own. I'll be using small record covers. So you would see a comment section with say, 5 different record covers mixed in with people who have an actual Avatar. I had this working 3 or so years ago, but it is not proving so easy this time. Again, all help is GREATLY appreciated.


title: How to duplicate the media upload insert media tab?

text: I'm currently trying to add custom functionality to the media uploader from my plugin... I basically need to be able to duplicate the functionality that is used to run the `Insert Media` tab on my own custom tab. I was able to find how to make a custom tab using the following code:               // Add new submenu to media upload screen     add_filter( 'media_upload_tabs', 'DSkills_media_upload_tabs' );          function DSkills_media_upload_tabs( $tabs ) {         $tabs['flickr_uploads'] = "Flickr Uploads";         return $tabs;     }          // Include necessary files so this works     wp_enqueue_script( 'media-upload' );          // Construct the custom media upload form     function upload_flickr_uploads_tab() { ?>              <!-- Content to include -->         <div class="flickr-uploads">              </div>          <?php }          // Activate and insert the iframe     add_action( 'media_upload_flickr_uploads', 'upload_flickr_menu_handle' );          function upload_flickr_menu_handle() {              return wp_iframe( 'upload_flickr_uploads_tab' );     }      But, even after spending hours researching the subject I still was unable to find a solution. I need the solution to be mainly in `php / jQuery`. Any and all help or even suggestions on where to look for a solution is greatly appreciated!


title: Adding Custom Javascript to Skeleton Child Theme

text: I'm trying to register & enqueue ImageMapster in my Skeleton Child Theme on the main.php page to make an image map with hovering image effects. I added this code to the "Header Functions" section of my child theme's functions.php file:               add_action( 'wp_enqueue_scripts', 'load_custom_js' );     function load_custom_js() {         wp_register_script( 'jquery.imagemapster.js',          get_template_directory_uri() . '/javascripts/jquery.imagemapster.js',          array('jquery'), '1.2.6', false );              if ( is_page('Main') ) {         wp_enqueue_script( 'jquery.imagemapster.js',          get_template_directory_uri() . '/javascripts/jquery.imagemapster.js',          array('jquery'), '1.2.6', false );         }     }       Now my site has ceased to work. The javascript file is located in the parent theme directory, so is it correct to use get_template_directory_uri instead of get_stylesheet_directory_uri? Does each theme have a particular place where one should add custom functions or am I correct in adding it under "Header Functions"? Any help would be appreciated.


title: WordPress AJAX Pagination with query_posts

text: I have a list checkbox categories, which when checked, use WordPress's admin- ajax.php to filter posts to the selected category. All is working great, however, I am struggling to get the updated pagination. I'm using query_posts as follows:               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;          $args= array     (      'post_type'=>'course',         'paged'=>$paged,         'posts_per_page'=>3,       'tax_query' => array(          array(         'taxonomy' => 'subject',         'field' => 'slug',         'terms' => $tags_from_group         )         )          );          $posts=query_posts( $args);      I then pass the $posts back as data, but I don't know how to access the updated pagination.. I was thinking something along these lines:                $pagedposts=array();      $pagedposts['posts']=$posts;      $pagedposts['pagination']=???      So $pagedposts['pagination'] would be the data needed to update the old pagi after the ajax call is successful.. I found someone else had this problem here, but there is no solution there...


title: Wordpress Admin Tables in Post View

text: I'm trying to add my custom Wordpress table (similar to the links table) into the "New Post" view of a custom post type. I hope that makes sense.


title: Create a permalink for a post's attachments

text: I'm trying to create a custom permalink structure. I'd like to have a custom page which displays each post's image attachments, using the following structure: _www.mysite.com/hello-world/images_ If anyone visited this URL, it would serve up a page of images that are attached to hello-world. It's kind of like having a subpage I guess, but I'd want it for posts (not pages) and I'd want it to be automatic. I have a template .php coded-up for this purpose; it will grab all attached images and display them. I'm just looking for a way that people can get to it via the above URL structure. I'm not sure how to go about doing this ie. if there's an easy way in Wordpress, or if I need to look into Rewrite rules in my .htaccess. Any thoughts would be appreciated, thanks -


title: Fancybox 1.3.4 : how to disable effect on gallery?

text: A plugin I have installed use fancybox 1.3.4. Yeah I know, pretty old... On galleries, between images, the fancybox applies a kind of transition effect. I cannot disable it. Here is ma javascript code :               jQuery(document).ready(function($) {             $("a.fancy").fancybox({                 "width" : 900,                 "height" : 600,                 "autoScale" : true,                 "openEffect" : "none",                 "closeEffect" : "none",                 "nextEffect" : "none",                 "prevEffect" : "none",                 "transitionIn" : 'none',                 "transitionOut" : 'none',                 "titleShow" : false,                 "openEasing" : 'none',                 "closeEasing" : 'none',                 "nextEasing" : 'none',                 "prevEasing" : 'none'             });      Any help would be much appreciated !!!


title: Max Posts and Memory Limit

text: So I have a custom post type which uses ACF Metaboxes that contains over 750 posts and grwoing. I got the infamous white screen of death because it seems like PHP has exhaused it's memory limit querying all these posts and data. I set my PHP.INI file's max execution time and memory limit to `-1` and increased my WP's memory limit in config to `define('WP_MEMORY_LIMIT', '4096M');` yet I'm still receiving a white screen of death in the admin when trying to view the custom post type. Any ideas on how to fix/increase memory? Thanks


title: Twenty Fourteen responsive CSS

text: I today install on wordpress new responsive theme ''Twenty Fourteen'', I try to edit css, try to change bg color of header menu, I can't found in css where i change bg color, I before do this a million times on old not responsive css, how i edit responsive css ? Thanks.


title: Date when the custom field was added

text: I have a couple of custom fields setup and working fine, is there any way to show the date when the custom field was created within the post template? I tried searching around, but no luck. For example:               name: test1 - value: result1     -------- created 10/02/09     name: test2 - value: result2     -------- created 15/03/10      Thank you.


title: How to redirect new WordPress user to previous page after registering

text: When a user registers for a WordPress site, they are redirected to the login page after completing the registration form. Is there a way to redirect them to the previous page before filling out the registration form? Please note that I'm not looking for a custom/static page because the user will be coming from various pages and that's the page I want them to return to - not the same page for every case. Thanks!


title: tax_query operator issue. IN works, AND never returns any results

text:
This is a bit complicated. I have a wp_query that is almost working perfectly, but I have one issue. I think there is something here that I'm just not seeing. All of my code is an included php file in index.php. I have three custom taxonomies and a form that is sending POST variables to the same page when submitted. Here's a simplified version of the form.               <form name="filter" method="POST">
Topics

Compliance <input name="topics[]" value="compliance" type="checkbox">

Regions

Americas <input name="regions[]" value="americas" type="checkbox">

                                    <input type="hidden" name="filter" value="yes">           <input type="submit" value="Filter">     </form>      The form seems to submit all of the values just fine. Then, after checking if the form has been submitted, I run this code:               // Get arrays from posts     $topics = $_POST['topics'];     $industries = $_POST['industries'];     $regions = $_POST['regions'];          // This part builds arguments for the filtered query.     // It will only build the array if they are set     if (isset($topics)) {       $array1 = array(                 'taxonomy' => 'topics',                 'field' => 'slug',                 'terms' => $topics,                 'operator' => 'IN'             );     }     else {$array1=NULL;}          if (isset($industries)) {       $array2 = array(                 'taxonomy' => 'industries',                 'field' => 'slug',                 'terms' => $industries,                 'operator' => 'IN'             );     }     else {$array2=NULL;}          if (isset($regions)) {       $array3 = array(                 'taxonomy' => 'regions',                 'field' => 'slug',                 'terms' => $regions,                 'operator' => 'IN'             );     }     else {$array3=NULL;}      Then from those three arrays, I build the query.                   // Build the Query         $args = array(         'post_type' => 'post',         'tax_query' => array(             'relation' => 'AND',             $array1,              $array2,             $array3         )     );     $the_query = new WP_Query( $args );      Then, of course, I run my loop. Now, since the 'relation' argument in the query is set to 'AND', if one taxonomy term is submitted from each of the three taxonomies (or just from two of them), then only posts that have all of those terms will be returned. I want to make this work the same way within a taxonomy. So if you submit two terms from one taxonomy, it will only return posts that have both of those terms set. So I should be able to just change 'operator' in my array from 'IN' to 'AND'. However, when I do that, I never get any results. Even if I submit two terms that I know should have a result. What am I missing? Is there something else I need to do to make the 'AND' operator work? Thanks!


title: Compare revisions on pending posts doesn't work for authors and lower

text: I'm using map meta cap to allow extra permissions (edit/publish/edit_others/read_private/edit_private) if the user and post share a category. Comparing revisions doesn't work beyond the first comparison for a pending post if the user type is author or lower. The same user can view all the compare revisions if the post is either published, or if their role is changed to at least Editor, meaning they can only view edit because of map meta cap. The user has the ability to view one set, and if I get the changed url from a user who can see all the revisions, I can view that set, but am unable to switch between using the javascript slider/buttons. It just says "Sorry, something went wrong. The requested comparison could not be loaded." I'm wondering if there is a capability I need to change in order to have my custom role be able to view all the revisions, javascript I need to change to take into account the map meta cap, or if there is something else going on.


title: Execute Jquery when a specific page in my plugin is loading

text: I am building a plugin and I would like to be able to hide the wordpress admin side menu and top bar when a specific page is shown(or menu item clicked)? Should I call the jquery directly as a script on the plugin page's code, or is there a way I can execute the jquery when the page is loading, or menu item is clicked from a hooked function with ajax or something similar? Here is the jquery I wan't to run:               $("#wpadminbar, #adminmenuwrap").hide();


title: Add access control origin header information across multisite

text: I want to add the below snippet to my wordpress installation.               <?php header("Access-Control-Allow-Origin: *");?>      I don't want to add it in every template header as there are many of them and I have 60 networks with 2-3 sites in each network. In what file should I add this snippet so that it has effect across the entire wordpress installation?


title: Some Pemalink problems, probably caused by wrong .htaccess configuration?

text: I have import on my local webserver a backup of a website made using WordPress but I am finding some difficulties with **PermaLink** configuration The main problem is that if I use the permalink setted as Article Name I can see the homepage but if I click on the articles links into the homepage (to see the article) I always obtain the following message error: > Not Found > > The requested URL /wordpress35/2012/10/11/se-milano-avesse-il-mare-anzi-no- > la-montagna-di-campiglio/ was not found on this server. If I instead I use the Default settings for permalink (`http://localhost/wordpress35/?p=123`) I have no problem and I can access to the articles in my website I think that this is a **.htaccess** problem. Can you help me to create an **.htaccess** file that solve this problem? This is my actual **.htaccess** file content:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>     # END WordPress      I need to use the URL format described as: `http://localhost/wordpress35/my- article-name`


title: How many MySQL queries per visit I should normally have?

text: Hi, I have 170 MySQL queries per visit. Is that OK? Thanks. ![enter image description here](http://i.stack.imgur.com/XGkko.png)


title: Remove or Edit <dc:creator>in Feeds

text: Would like to remove or edit it to be a static value without editing core Wordpress files. Preferably as a function.


title: How do I combine these 2 queries

text:
I want to combine the 2 following queries so that ongoing promotions (query 1) shows before the rest of the promotions (query 2) but all together no more than 5 results show. Thanks. Query #1 Ongoing Promotions               <?php         global $post;         $args = array(             'post_type' => 'promotions',             'numberposts' => 5,             'meta_key' => 'sp_ongoingPromotion',             'meta_value' => 1         );         $supplierCommunications = get_posts( $args );         foreach( $supplierCommunications as $post ) :   setup_postdata($post);     ?>
         <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                      <?php                 echo "Ongoing Promotion";             ?>
     <?php endforeach; ?>     <?php wp_reset_postdata(); ?>      Query #2 Current Promotions                           <?php                     global $post;                     $args = array(                         'post_type' => 'promotions',                         'numberposts' => 5,                         'meta_key' => 'sp_endDate',                         'meta_value' => date("Y/m/d"),                         'meta_compare' => '>=',                         'orderby' => 'meta_value',                         'order' => 'ASC'                     );                     $supplierCommunications = get_posts( $args );                     foreach( $supplierCommunications as $post ) :   setup_postdata($post);                 ?>
                     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                                              <?php                             $meta = get_post_meta(get_the_ID(), 'sp_endDate', true);                             if('' != $meta) {                                 $formattedDate = new DateTime($meta);                                 echo "Expires: ".$formattedDate->format('F d, Y');                             }                         ?>
                 <?php endforeach; ?>                 <?php wp_reset_postdata(); ?>


title: add_filter with retrieve_password_message() not working in plugin, but works in functions.php

text: I'm trying to use retrieve_password_message to change the lost password email. The problem is that when I use it in a theme's functions.php, it works great, but when I put it into my (activated, working properly in other ways) plugin, it doesn't work. Does anyone know why? I have the priority set as 1.


title: How to Convert Custom Fields from Text to Array?

text: I want to convert my old post data containing custom fields that are stored in a text format like : `name , url $ name, url $ name, url` etc. I want convert that data and store the new data as an array in a new custom field.   Does anyone know how this can be done? I want to store that data so that I can use the data with this Gist: Repeatable Custom Fields in a Metabox (Author: Helen Hou-Sandi)


title: reset the users roles - is there a way to do this?

text: any way would be acceptable for me, even hacking the DB. I have messed up the roles with MEMBERS plugin, and i need a way of reseting the roles somehow. i can't seem to find a proper way. basically, I need to flush all roles, capabilities, and custom post type at once. it wouldn't cause any trouble with the one's who are written to the functions.php file, as i understand, - right?


title: Merge two WordPress installations into one, and keep posts separated?

text: I have two Wordpress installations that I would like to make into one installation, but still keep the posts (and their meta-data) separated. Both installations currently share the same database. I would like to be able to loop through both blogs, but each on their own page. I have extracted both databases using the built in export function in WordPress and am now sitting with two .xml files containing the posts from each database. Now I would like to import these posts into a new clean WordPress installation, BUT how can I keep the separated? I don't want them to get mixed up, because then I can't show them on their own page.. I am thinking about using a custom loop using WP_Query. Thanks, I hope you understand what it is I want.


title: Custom post type, custom taxonomy, query posts only from taxonomy (children of)

text: I have a custom post type (portfolio-type) with a custom hierarchical taxonomy (portfolio-category) Now I would like to query only posts from potrfolio-type, so i do:               $paged = 1;     if ( get_query_var('paged') ) $paged = get_query_var('paged');     if ( get_query_var('page') ) $paged = get_query_var('page');     query_posts( '&post_type=portfolio-type&paged=' . $paged );      And till here, everything works great. Now, I would like to query only posts, that are in any, of children custom taxonomy "categories" of a custom taxonomy category with given ID. So I tried:               $paged = 1;     if ( get_query_var('paged') ) $paged = get_query_var('paged');     if ( get_query_var('page') ) $paged = get_query_var('page');     $query_args = array(         'post_type' => 'portfolio-type',         'cat' => $CAT_ID,         'paged' => $paged,       );     query_posts( $query_args );      Failed (no results), but I understand Why. those posts are not in standard category, but in custom taxonomy's category, so looking at wp Codex, this is what I came with:               $query_args = array(         'post_type' => 'portfolio-type',         'paged' => $paged,         'tax_query' => array(             'taxonomy' => 'portfolio-category',             'field' => 'id',             'terms' => $CAT_ID         )     );      Failed again, but this time all custom posts from portfolio-type post_type displays (tax_query doesnt work, whatever ID i put there result is all the same) What am I missing?


title: NextGen Gallery quality, down-sizing and speed issues

text: I've done quite a bit of testing.   1. When uploading 4000px wide images, quality comes out terrible, jagged edges. Have experienced this in other situations, so I uploaded 1280 and 1936px wide originals with much better result.    2. Regardless of image quality setting in Options>Image tab, the 720px wide large photos are 300K, 400K, huge; as I said, NO change with different image quality settings.    3. At a ridiculously low setting of 20%, the image quality is no worse. Does this setting even work?    4. The built-in Thickbox lightbox functionality is very slow, even with some 60K images I pre-sized and uploaded. Takes 4 seconds minimum to display image. A second pass through, with the images in cache is much quicker. But the delay is not much different on first pass with a 60K or 400K image.    5. The built-in WordPress upload with 3 image re-sizes is a very good result but not accessible from nextGen.    6. Others need to use this, so it needs to be an easy tool.


title: How to show all posts by author on buddypress profile with navigation

text:
I'm using Buddypress for wordpress and I'm trying to show a loop on the profile page of a user. I use infinite scroll to load more pages but the link to page 2 doesn't point to a group of posts and instead takes me to a blank page template but I do get this link.               "http://mysite.com/exampleuser/page/2"      Any ideas on how to make this page correctly? The following snippet is placed in the `profile-loop.php`.               <?php       global $bp;       global $paged;       global $wp_query;       $temp = $wp_query;       $wp_query = null;       $user_id = $bp->displayed_user->id;       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;       $args = array(             'posts_per_page' => 16,             'cat' => -1,             'post_type' => array(                  'post',                 'fod_videos',                 'fod_music',                 'fod_articles',                 'fod_albums'                ),             'author' => $user_id,             'paged' => $paged         );       $wp_query = new WP_Query($args);       while ( $wp_query->have_posts() ) :   $wp_query->the_post();          get_template_part( 'loop', 'contents' );       endwhile;       echo '
';         next_posts_link('Next');       echo '
';       $wp_query = null; $wp_query = $temp;      ?>


title: Will the use of a child theme create problems with commercial parent theme's options?

text: My client has a commercial theme full of options running on his site. I need to apply changes in the header.php and style.css. I plan to create a child theme so he can continue update his theme in the future without losing these changes. Is it possible that using a child theme on top of a commercial theme that has many options can create problems like making some options stop working properly?


title: 1 post, 2 templates

text: I want to be able to render post in two different styles (2 templates). For example, let's say I have the post ID 133, I would like two URLS to access it and so it renders where different template would apply.   * lorem.com/render1/133   * lorem.com/render2/1333 for example... or it could be something like:   * lorem.com/post/133   * and lorem.com/post/133?template=2 How would you do it?


title: is there a better way of combining this?

text:
Hoping someone can point me in the direction of writing this in a more succinct way. I'm working on my website, and want to display a total of 5 posts from the category 'general wonderings'. The first post has different styling from the other 4. Please see code below, Now, 2 problems... they way I've written it means that there is a duplicate post and secondly - surely there's a better way of combining this into one, rather than the way I've written it? Any help would be greatly appreciated. Thank you
           <?php     $args = array( 'category_name' => 'General Wonderings', 'posts_per_page' => 1 );     $lastposts = get_posts( $args );     foreach($lastposts as $post) : setup_postdata($post); ?>

<a href="<?php the_permalink(); ?>">               <?php the_title(); ?>

               <?php the_date(); ?>

               <?php the_excerpt(); ?>

<a href="<?php the_permalink(); ?>">Read more

           <?php endforeach; ?>

           <?php     $args = array( 'category_name' => 'General Wonderings', 'posts_per_page' => 4 );     $lastposts = get_posts( $args );     foreach($lastposts as $post) : setup_postdata($post); ?>

<a href="<?php the_permalink(); ?>">               <?php the_title(); ?>
               <?php echo substr($post->post_excerpt, 0,30); ?>...
               <?php the_date(); ?>

           <?php endforeach; ?>


title: How to read the contents of single post through RSS feed

text: I am able to fetch the contents of my WordPress site RSS feed through this tutorial on my mobile website. How can I get the contents of a single post through RSS?


title: Template messed up on viewing posts

text: Take a look at this post: http://mikewills.me/blog/links-for-2011-02-24/ My images are broke and CSS links are broke. I know the problem is with the permalink, but why would it be broke? I have the same problem with the Twenty Ten theme and the new Twenty Ten Five theme.


title: Document.body.scrollTop in Wordpress

text:
I have a script that loads jQuery when an element comes into the viewport, as discovered by Javascript (without a library), and it looks like this: **viewport.js:**               var height = 0;     if( typeof( window.innerWidth ) == 'number' ) {         //Non-IE         height = window.innerHeight;     } else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {         //IE 6+ in 'standards compliant mode'         height = document.documentElement.clientHeight;     } else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {         //IE 4 compatible         height = document.body.clientHeight;     }          function gingah_comments_onLoad() {         var element = document.getElementById("comments");         var current = height+document.body.scrollTop;         var target = element.offsetTop;         console.log(current);         console.log(target);         if (current >= target) {             if (typeof jQuery == 'undefined') {                 $.defer("http://localhost/wp/wp-includes/js/jquery/jquery.js", {                 }).done(console.log('loaded jQuery'));                 window.onscroll = null;             }         }     }     window.onscroll = gingah_comments_onLoad;      **And the html used:**
Top

Comment1

           The DeferJS.min.js refers to a minified version of the following: https://github.com/BorisMoore/DeferJS/raw/master/DeferJS.js However, when I try to implement this in Wordpress (3.1), having used wp_enqueue_script for both viewport.js and DeferJS.min.js, the scrollTop appears to not work at all. When the HTML and JS above is combined, it will log the values to the console, making it very clear when _#comments_ came into the viewport. But when replicating the process in Wordpress, the _current_ var does not count upwards when scrolling down, but stays static. And, according to Firebug, viewport.js, DeferJS.min.js and l10n.js (Wordpress 3.1 localization) are the only scripts loaded. Also, Quirksmode lists the scrollTop method as available in practically all browsers. What could be the cause of this malfunction in document.body.scrollTop?


title: Does WP delete deprecated plugin/theme files on plugin/theme upgrade?

text: Let's say theme 1.0 is installed with 30 files in it. Then two weeks later theme is upgraded to theme 2.0 which contains only 10 files. Do those older 20 files get automatically deleted after upgrade? What I wanted to do is to place a file inside the theme directory, trough which the user can customize the theme. This file would be created after the theme is installed trough the theme settings. But if WP does delete files that do not exist in the official theme package, then this file would be deleted as well...


title: Advanced custom fields - pulling data in from another page

text: Hello I am using advanced custom fields and I am trying to pull data from multiple pages and display it on another I set up a relationship field called "data", and then on page X where the relationship field is displayed I have chosen page Y where I want to pull the data from               <?php if( get_field('data') ): ?>          <?php the_field('special_offer'); ?> <!--// get content from page Y -->     <?php endif; ?>      I can't get this to work though and Im presuming the above is wrong, does anyone know how I could do this please? Hopefully I have explained it clearly Cheers               <?php if( $related_pages = get_field( 'special_offer_relationship' ) ): ?>              <?php foreach( $related_pages as $page ): ?>             <?php echo get_the_title( $page->ID ); ?>             <?php echo get_the_excerpt( $page->ID ); ?>        <?php endforeach; ?>          <?php endif; ?>


title: In Loop Output Place Custom Field Content In Between Paragraphs

text: I'd like to place the contents of a custom field or variable in between the second and third paragraphs in the loop on a page template. Is there a way to do this? So for example, on a client's website I would like them to use the post editor to write out their page content, and keep things simple for them by giving them the ability to write out a call to action in a custom field that diplays between two paragraphs of               the_content();      using either a plugin or a PHP snippet or filter in functions.php. Thanks very much.


title: the_content is always surrounded by paragraphs (how to disable or remove them)?

text: `the_content` is always surrounded by paragraphs, it doesn't matter if I'm in HTML view and there's nothing there. Does WordPress have a function to remove them? IS there any way?


title: woocommerce buy button

text: My site is a affiliate and I want woocommerce buy button to open up website in a new tab. As i go through the code i see its functions like do_action, calling functions. don't know where are the function based. I checked functions file too but cannot find it. How can i break it down, that which components of woocommerce is being called and editing that function like i want to open the external website in another window.


title: post_content sanitization / transformation process

text: What kind of transformation does the post_content go thru when wp_insert_post inserts a post_content into wp_posts programmatically? I'd like to be aware of this before I process 50000 recs into wp_posts?


title: Search Bar in Thesis Wordpress Site

text: A friend of mine installed all the Thesis documentation for my new website. I am fairly proficient in HTML and CSS, but I need help with one issue. She tried adding a search bar in my main menu structure--which you will notice is totally random. I added a search widget instead. Where or how do I delete the incorrect search bar (it's in the top right corner of my site)? I can't figure out where it is coded into the site or how to remove it. The site is: www.ladidacreative.com


title: Update a post's info when clicking on a javascript button

text:
I have a series of posts about various locations. I need people to verify if the location informaton is correct. The question is asked with two buttons for options. If "no" is clicked, they are taken to the edit page. If "yes" is clicked, the person's name is updated as the last person to verify the listing and the page is refreshed. My problem is that the person's name is updated whether or not they click on "yes". The wp_update_post is being run whther they click on the butin or not. Here is my code:
Yes
           What am I doing wrong?


title: Customize Search Results for Custom Post Type

text: Is there a way to use a custom PHP template for search results of a custom post type. I know that you can have specific archive and category templates for custom post types. For example, archive-custom.php. But, the same doesn't work for search.php. Any suggestions?


title: Editing "Kahi's Highlight Used Categories" plugin code - highlighting parent and child category in post page

text: I´m trying to highlight (using css), the child and parent categories in use in the selected post. So I´ve found this plugin "Kahi's Highlight Used Categories". Plugin´s website: http://kahi.cz/wordpress/highlight-used-categories-plugin/ What it does... It adds a 'used-cat' class and 'used-cat-parent' class to stylize, to the sub- category and main category respectively. The problem is: My website (http://www.mpn.p.ht/wp_br2/), has three main categories "Masculino", (means male), "Feminino", (means female), and "Infantil", (means infant). The sub-categories are the same for all the three main categories. So, let´s say, we are at the post page with main category "Masculino", and sub-category "Acessórios", (means acessories)... The plugin, seems to add 'used-cat' to all "Acessórios" (sub-category), found also in "Feminino" , and in "Infantil". I would like the plugin to add the class 'used-cat', only to the sub-category of the selected post. Not to all sub-categories found with the same name, through the categories list. Here´s the plugin code:               <?php     /*     Plugin Name: Kahi's Highligh Used Categories     Plugin URI: http://www.kahi.cz/wordpress/highlight-used-categories-plugin     Description: In the list of categories, adds classes used-cat and      used-cat-parents to particular list-items (when browsing a post).          Version: 1.0     Author: Peter Kahoun and Dirk Jaster     Author URI: http://www.kahi.cz/wordpress/     */          class KHUC {          function wp_list_categories ($text) {              global $post;              if (is_singular()) {                  $categories = wp_get_post_categories($post->ID);                  foreach ($categories as $category_id) {                      $category = get_category($category_id);                 $category_parent = get_category($category->category_parent);                      $text = preg_replace(                     "/class=\"(.*)\"><a ([^<>]*)>$category->name<\/a>/",                      ' class="$1 used-cat">' . $category->name .         '',                      $text);                      $text = preg_replace(                     "/class=\"(.*)\"><a ([^<>]*)>$category_parent-     >name<\/a>/",                      ' class="$1 used-cat-parent">' .      $category_parent->name . '',                      $text);                  }              }              return $text;          }          }          add_filter('wp_list_categories', array('KHUC','wp_list_categories'));      Does anyone know, what changes in the plugin code should I make, so I get only the sub-category in use to get the 'used-cat' class?


title: Combine query_posts() and get_posts() into single query

text:
I am creating a site which uses normal posts for a blog and the a custom post type for events(generated by the events plugin). I have successfuly used different queries to grab both but I want to combine them into one query. Have tried various things with no luck. Here is query for blog:               <?php $mainFeatures = array( 'numberposts' => -1, 'order'=> 'DESC', 'orderby' => 'post_date');      $postslist = get_posts( $mainFeatures );      foreach ($postslist as $post) :  setup_postdata($post); ?>                             <?php endforeach; ?>      Here is query for events:                <?php query_posts(array('post_type'=>array(TribeEvents::POSTTYPE), 'numberposts' => -1,'order' => 'ASC')); ?>      <?php while (have_posts()) : the_post(); ?>                 <?php endwhile;?>      Have tried this but again only gets the events:                <?php $tryone = query_posts(array('post_type'=>post, 'posts_per_page'=> 18)); ?>      <?php $trytwo = query_posts(array('post_type'=>array(TribeEvents::POSTTYPE))); ?>      <?php $all_posts = array_merge( $tryone, $trytwo ); ?>           <?php query_posts($all_posts); ?>      <?php while (have_posts()) : the_post(); ?>
stuff
      <?php endwhile;?>


title: 404 error on all pages but custom post types are working OK

text: I am getting 404 errors on all pages however I have multiple custom post types et up and these are working correctly. I have tried all the usual fixes like htaccess file, flushing the rewrite links but to no avail. I seem to be able to get pages working but have broken custom types or custom types working but no pages. Any ideas gratefully accepted!


title: What is the proper filter to add html to a post / page title?

text: I want to use Myanmar Unicode text on my blog. Unfortunatly, pseudo-Unicode Myanmar fonts are common. So, I am writing a plugin that will suround all Myanmar phrases with HTML span tags, and use css to select the proper font. Everything works fine for content, comments, etc. However, after adding HTML using the the_title hook, that HTML gets escaped, and then included in the title attribute of the link tag in the recent posts section. In addition, I'm seeing the raw HTML tags in the post name on my admin post screen. How should I go about solving this problem? I prefer to do everything from within my plugin, not change the theme files or something. Here is my code:               add_filter( 'the_title', 'addThemSpans');     function addThemSpans($theTitle) {       // functionality to add span tags to $theTitle so that a title that looks like this...         // LatinTextHere ကကကကက MoreLatinText       // becomes this...         // LatinTextHere ကကကကက MoreLatinText         // in the final output.       return $theModifiedTitle;     }      As it is now, the title attribute for the link in the recent posts sidebar widget is set to:               LatinTextHere <span class='myText'>ကကကကက</span>ကကကကက MoreLatinText      Which is not right.


title: Allow multiple contributors to one post

text: I have been asked how easy it would be to have multiple contributors being able to submit content that would be brought into one post. The rub is that they wouldn't be allowed to see the main post or edit the post, this would be reserved for the site admins - their role would be mainly around adding their piece of the post into the mix and that would be it. I know this isn't standard functionality, but I don't even know where I would begin looking for a plugin - I could roll my own but if this is a solved problem then I would rather utilise that fact. So I guess my main question is _Is this a common power-user feature and what name does it go by?_ This is essentially to replace the current system that involves people emailing in content that gets copied and pasted into the post.


title: Wordpress REST endpoint with JSON for Mobile App integration

text: Is there some REST API that Wordpress supports, out of the box or through any plugin that exposes the same information exposed through the normal pages? (I.e. latest posts, filtering by categories etc.) There seems to be a JSON API plugin but it seems to be very old and not maintained. There also seems to be some plugin called Jetpack but not sure if it provides what I am looking for (seems more dedicated to content management rather than exposing it publicly). I am trying to integrate a Mobile App with a Wordpress Blog, and I need to find the best way to transfer the information to the application in terms of performance and also displaying it right. (Any ideas appreciated)


title: Loading style.css and Jquery using HTTPS

text: We have several environments and we have just started using wordpress (Dev, QA, Pre-prod, prod etc...). We don't have https enabled in the lower environments and everything is working smoothly. In our prod environments the site redirects all traffic to https. The first issue seems to only be with chrome. Chrome refuses to load anything on the page that isn't https. I am unsure how to get WordPress to load jquery or styles.css (from my theme) over https ( more information below). The second issue also with HTTPS is we cannot log into wordpress in the environments that use HTTPS. When the login screen loads (sitename.com/wp- admin) you get redirected to wp-login as expected but upon entering your username / password the page just refreshes. No errors (checked console / firebug and httpfox and couldn't find any errors). I know we are doing something wrong with https in general because we are having many problems in the environments that support it. I have done a bunch of googling and haven't really come up with much on using HTTPS and wordpress surprisingly. Aside from answers to the questions of how to load jquery via HTTPS and how can we log into the https wordpress instances, are there any good links on how to work with HTTPS in wordpress. Almost everything I have found points to using the plugin WordPress HTTPS and we are going to try that but I am not sure if it will solve all of our issues. Note* In my functions.php I am using Enqueue to load JS and CSS files the proper way, and I am using relative pathing on those loads //sitename.com/bla/bla which works fine. I am loading jquery using: in my header.php and styles.css is loaded automatically as part of my theme loading using , so I don't know how to configure either to load via HTTPS or if that is even the correct approach to fixing these issues. (jQuery is loading from our local file system not a CDN). Any help would be greatly appreciated. Thanks in advance.


title: How to display class name in this shortcode post query

text:
I need help with this as it's my first project of my new job & I'm stuck at this point. I'm retrieving custom post types portfolio using this code as a shortlist:               extract( shortcode_atts( array( 'limit' => -1, 'type' => 'post'), $atts ) );          $paged = get_query_var('paged') ? get_query_var('paged') : 1;            query_posts(  array (          'posts_per_page' => $limit,          'post_type' => $type,          'order' => 'ASC',          'orderby' =>'menu_order',          'paged' => $paged ) );          $list = ' ';             while ( have_posts() ) { the_post();              $list .= '
'          . '
'          . '
' . get_the_title() . '
'          .'
' . get_the_excerpt() . '
'         . '' . 'View »' . ''         . '
'         . '' . get_the_post_thumbnail($page->ID, 'listing-thumb')  . ''         . '
';     }          return      '
'      . $list      . '
' . get_next_posts_link( __( '← Older posts' ) ) . '
'     . '
' . get_previous_posts_link( __( 'Newer posts →' ) ) . '
'     . '
' .     wp_reset_query();          }     add_shortcode( 'feed', 'section_feed_shortcode' );      I want to display the custom taxonomy "name" at the following point of code:               $list .= '
'       Is it possible to do. If yes, then featured image as well. Thanks!


title: What are the package and subpackage comment for?

text: This is included in themes and plugins.               /*      * @package WordPress      * @subpackage Twenty_Ten      * @since Twenty Ten 1.0      */      What are they for? I've read that they are standard and so on, but what is the practical use for it?


title: db query for retrieving comments without any reply

text: what is a query for selecting a list of comment id's that have not had a reply yet so I can use it to iterate though each comment id and echo out the post it is on and the excerpt of the comment along with the author name, url and how many comments?


title: List Recent Post Titles from Custom Taxonomies?

text: I'm managing a movie related site.. I'm using yoast's simple taxonomies plugin to classify my content with Artists, Genre (action, horror, comedy, drama etc..), Director, Writer etc... On a specific page (template), I want to pull last 5 posts with only their titles from custom taxonomies.. how can I pull last 5 titles from Action, Comedy or Horror taxonomies as list? I will try to get an output like http://tutsplus.com/ Thanks


title: Posted date format not reflected

text: WP3.6, Twenty Thirteen theme No matter which `Date Format` I choose, the date on actual posts are shown like this:               %A %B %e%q, %Y      Note that the actual texts look like this; not even the date values (eg. 9/01/2013). Looking at `content-link.php`, date might be displayed by the following that I suspect is not returning a right value?                       <?php twentythirteen_entry_date(); ?>      What's wrong? Thank you.


title: Any Good WordPress Themes Compatible With The BBPress Plugin?

text: Does anyone know of any good wordpress themes that are compatible with the bbpress _plugin_? I'm looking for something with a good layout, preferably a magazine/news type theme. Thanks :)


title: Slidedeck Pro Wordpress Image Size

text: I was using Slidedeck pro wordpress (dynamic slider), and set it to pull in the first image from the post's gallery as the image. However, it keeps resizing the image down to 270px when I really need to have the image at 500px. Does anyone know how to remedy this? I did find a template file with the resizing ratio. However, I am not even sure what to change to achieve the 500px width I need.               // Correct image aspect ratio to fit within skin's image constraints     if( !empty( $image ) ){         if( !empty( $image['width'] ) ){             if( $image['width'] > 270 ){                 $w_ratio = 270 / $image['width'];                 $image['width'] = floor( $w_ratio * $image['width'] );                 if( isset( $image['height'] ) ) {                     $image['height'] = floor( $w_ratio * $image['height'] );                 }             }         }         if( !empty( $image['height'] ) ){             if( $image['height'] > 250 ){                 $h_ratio = 250 / $image['height'];                 $image['width'] = floor( $h_ratio * $image['width'] );                 $image['height'] = floor( $h_ratio * $image['height'] );             }         }     }      I did try changing 270 to 500 earlier to no avail.


title: Can't display shortcode in WP_Query loop

text: I want to display all posts from my CPT `brand`. My WP_Query loop works well but the shortcode I want to use within it doesn't work. This shortcode comes with some plugin called `Download Attachments`, but I suspect the problem is not plugin-related. Here's the code of my loop:               $query_brands = new WP_Query('post_type=brand');     while ($query_brands->have_posts()) : $query_brands->the_post();         the_title();                                             echo do_shortcode("[download-attachments]");     endwhile;      The shortcode line is supposed to display all attachments of the post, but for some reason it does nothing here. Why not?


title: Custom Meta Box If Else Statement

text: I have created a custom meta box for posts and I need to display said data. I have been using the below method to display the data, But I am in need of a slightly different solution.               <a href="<?php echo esc_attr( get_post_meta( get_the_ID(), 'my_meta_box_text4', true ) ); ?>">         <img src="<?php echo esc_attr( get_post_meta( get_the_ID(), 'my_meta_box_text3', true ) ); ?>" alt="" onerror="this.style.display='none'"/>           What I need is a way to do a IF/Else statement such is. If `my_meta_box_text3` exists `echo that`, else `echo this`.


title: How to properly sanitize strings without $wpdb->prepare?

text: I'm working on an advanced search (which uses custom sql queries), and the query string is formed using variables. For example, if the person checks some options, only those conditions get added to the WHERE clause. I can't use `$wpdb->prepare`, since I want to be able to add variables to my query string that look something like:               $var = "AND pm.meta_value = '%$_POST['val']%'";       I looked at `like_escape()`, but the documentation says: > Sanitizes $string for use in a LIKE expression of a SQL query. **Will still > need to be SQL escaped (with one of the above functions)**. What would be an appropriate way to escape $val?


title: Is there an advantage of using multisite if I have multiple WordPress websites for myself?

text: I have multiple WordPress websites, they all have their own domain and are standalone. Is there an advantage of using multisite? Or is my current setup good?


title: How to make 10 post of one category

text:
How can I make 10 posts of one category. What query should I use. Here in following query I need its limit of post in per page.

                     <?php if ( have_posts() ) : ?>
Category Archives: <?php echo  single_cat_title(); ?>

<?php echo category_description(); ?>

                 <?php while ( have_posts() ) : the_post(); ?>
                         <a href="<?php the_permalink();?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title();?>
                 <?php endwhile;?>                          <?php endif; ?>      **EDIT** I meant to say that I want 10 posts in category.php . Let suppose I am clicking one category in categories so it should show result 10 post of each category.


title: Why does my visual post editor break when I try to add a TinyMCE button?

text: I'm trying to add a button to my TinyMCE editor. I'm using WordPress 3.9.1, so I'm following this tutorial to add a new TinyMCE button. Right now, I'm just trying to get the tutorial version working--once that's done, I'll edit the button's script to actually do what I want. I've added this to my child theme's `functions.php` file:               // Hooks your functions into the correct filters     function my_add_mce_button() {         // check user permissions         if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {             return;         }         // check if WYSIWYG is enabled         if ( 'true' == get_user_option( 'rich_editing' ) ) {             add_filter( 'mce_external_plugins', 'my_add_tinymce_plugin' );             add_filter( 'mce_buttons', 'my_register_mce_button' );         }     }     add_action('admin_head', 'my_add_mce_button');          // Declare script for new button     function my_add_tinymce_plugin( $plugin_array ) {         $plugin_array['my_mce_button'] = get_template_directory_uri() .'/js/mce-button.js';         return $plugin_array;     }          // Register new button in the editor     function my_register_mce_button( $buttons ) {         array_push( $buttons, 'my_mce_button' );         return $buttons;     }      I've also created a script with the content below, and saved it as "mce- button.js" in the /js directory of my child theme's folder.               (function() {         tinymce.PluginManager.add('my_mce_button', function( editor, url ) {             editor.addButton('my_mce_button', {                 text: 'New Button',                 icon: false,                 onclick: function() {                     editor.insertContent('WPExplorer.com is awesome!');                 }             });         });     })();      However, when I save all that and load the post editor (in the "Visual" tab), none of the buttons load, and I can't enter text in the editor. In fact, if I go to the "Text" tab and enter text, then switch back to the "Visual" tab, the text I entered doesn't appear. ![Broken WordPress editor](http://i.stack.imgur.com/dwKnY.png) Could someone please help me figure out why my TinyMCE editor is breaking, and how I can add buttons properly without breaking it? Thank you!


title: Can I use OR relation for one item when calling tax_query from WP_Query and use AND for the rest?

text: I am trying to refine search in wordpress template. Basically I want to use multiselect with . I am using array to store selected options like this: location[]=term1&location[]=term2 etc etc. This is how the search code looked:                   $form_location = $_GET['location'];              if ($form_location != "")         $form_location = array(             'taxonomy' => 'location',             'field' => 'slug',             'terms' => $form_location         );               // Final Query         $items_args = array(             'post_type' => 'listings',             'meta_query' => array(                 $form_price,                 $form_area_range,                 $rentbuy             ),             'tax_query' => array(                 'relation' => 'AND',                 $form_location,                 $form_property_type,                 $form_rating,                 $form_bed,                 $form_bath             )         );         ?>         <?php $items_args = new WP_Query($items_args); if ( $items_args->have_posts() ) :       ... I modified $location to handle array. I didn't quite done the loop right because I am not sure how to handle tax_query. Here is what I did. I added foreach:                       foreach ($form_location as $loc2) {             $form_location = array(                 'taxonomy' => 'location',                 'field' => 'slug',                 'terms' => $loc2             ); }      This is the output I cached:               WP_Query Object ( [query_vars] => Array ( [post_type] => listings [meta_query] => Array ( [0] => [1] => [2] => Array ( [key] => rentbuy [value] => rent ) ) [tax_query] => Array ( [relation] => AND [0] => Array ( [taxonomy] => location [field] => slug [terms] => term1 ) [1] => [2] => [3] => [4] => )...      Here is the thing, I want the location taxonomy to be used for a query with OR condition for every item from Array it got, and others from tax_query with AND. Is this possible and how? Google is not friendly tonight.


title: Wordpress multi-query not returning as expected

text: I am trying to perform a merged query to get _at most_ 6 posts from either the `post` post type and my `events` custom post type. The `post` query is based off of whether or not the Featured Image is set, and the `events` query is based off of whether or not the post has the meta value _Featured_ selected. Everything works except: **The query only returns 5 posts, and they are not balanced in the sense that [depending on which post I set as Featured/Add Featured Image too] they take precedence over one another.** For Example: If I add a Featured Image to a `post` post the results will be _3 event, 2 post_. If I then check the Featured meta value in an `events` post type the results will be _4 event, 1 post_. Here is the code I am using to query and return posts:                       <?php             $post_types = get_post_types('','names');             $featuredEvents = get_posts(array(                 'post_type' => 'events',                 'post_status' => 'publish',                 'showposts' => 6,                 'meta_key' => '_ecmb_featured_event',                 'meta_value' => 'on'             ));             $featuredNews = get_posts(array(                 'post_type' => 'post',                 'post_status' => 'publish',                 'showposts' => 6,                 'meta_key' => '_thumbnail_id'             ));             $mergedPosts = array_merge( $featuredEvents, $featuredNews );             $postIDs = array();                 foreach( $mergedPosts as $item ) {                 $postIDs[] = $item->ID;             }             $uniquePosts = array_unique($postIDs);                  $posts = get_posts(array(                 'post__in' => $uniquePosts,                 'post_type' => $post_types,                 'post_status' => 'publish',             ));                  foreach( $posts as $post ) :             setup_postdata($post);             if( get_post_type() == 'events' ) { ?>                         This is a Featured Event             <?php } elseif (get_post_type() == 'post') { ?>                         This a post with the Featured Image set             <?php } endforeach; wp_reset_query(); ?>      Can someone help me with this? **Edit:** Thanks to the answer below, I figured it out and used the following code:               $sliderQueryArgs = array(         'posts_per_page' => 6,         'post_type' => array(             'post',             'events'         ),         'orderby' => 'post_date',         'meta_query' => array(             'relation' => 'OR',                 array(                     'key' => '_ecmb_featured_event',                     'value' => 'on'),                 array(                     'key' => '_thumbnail_id',                     'compare' => 'EXISTS')         )     );          $sliderPosts = get_posts( $sliderQueryArgs );


title: Alternative to file_get_contents() for theme operations

text: My theme options page needs to write to the style.css file in order to store updated theme settings. To do that, I'm using file_get_contents() and file_put_contents() However, theme-check plugin complains about it. What is an acceptable alternative for writing to local files?


title: Adding Woo Commerce using Hooks

text:
Can't figure out what I'm doing wrong with adding Hooks to the `functions.php` I've added it and the pages are still broken. I'm not sure how it should look. This is what I did. My theme is called "instyle"   My content id is `content-area`:               remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);     remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);               add_action('woocommerce_before_main_content', 'instyle_wrapper_start', 10);     add_action('woocommerce_after_main_content', 'instyle_wrapper_end', 10);          function instyle_wrapper_start() {       echo '
';     }          function instyle_wrapper_end() {       echo '
';     }


title: How to detect if website has a mapped domain attached to it on multisite network

text: I'm trying to to detect if a website has a mapped domain attached to it on a multisite network. If not, disable search engine visibility. This is what I have so far:               //* Disable search engine visibility for unmapped sites     add_action( 'init', 'noindex_unmapped_domain' );     function noindex_unmapped_domain( $blog_id ) {         $this->_mapped_domains = array();         $results = $this->_wpdb->get_results( "SELECT blog_id, domain FROM " . DOMAINMAP_TABLE_MAP );         foreach ( $results as $result ) {             if ( !isset( $this->_mapped_domains[$result->blog_id] ) ) {                 $this->_mapped_domains[$result->blog_id] = array();                     add_action( 'pre_option_blog_public', '__return_zero' );             }         }     }      Originally I thought I had a version working, but since I use subdomains in the admin area it was throwing false positives. I believe the code above will work even with using subdomains in the admin area as long as a mapped domain is attached to the site for the frontend, but I'm having issues getting it to work. While we're at it, open to suggestions if there's a more efficient way to do this. Thanks!


title: Post taxonomy from exif data

text: Whenever I post a post with a featured image, I want to extract the exif data from that image and attach it as a term for a taxonomy. I already got a plugin which can extract the relevant info, but I dont know where and when to call `wp_set_object_terms` Can anyone point me in the right direction?


title: Fatal error: Call to a member function add_rewrite_tag() on a non-object in /wp-includes/taxonomy.php on line 333

text: I get this error while trying to load wordpress in a smarty template. But when I visit wordpress I dont get that error any where. the code I use to load wordpress is :               {php}include $_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-load.php';     get_header();{/php}      The Error : Fatal error: Call to a member function add_rewrite_tag() on a non- object in /wp-includes/taxonomy.php on line 333


title: Why would running an admin check throw a 500 error? I'm calling is_super_admin();

text: I have a plugin that I wrote. A user was experiencing compatibility problems with a theme of theirs which uses a masked dashboard to add listings on their site. If the user was logged in, and a contributor, but NOT an admin, my check for is_admin() would return true since they were technically on a dashboard page. So.. my code checks if they are admin, then runs a series of functions. One of the checks is whether or not they have permissions to manage options. If they don't have permissions to manage options, it dies. This is a problem with the theme, so I simply wrapped my add_action tags with the following               if ( is_super_admin() ) {            add_action( 'admin_init', 'myplugin_register');         add_action( 'admin_menu', 'myplugin_menu' );         }      This throws a 500 error when any admin accesses the wp-admin area of the site. I'm not sure why a simple check to see whether or not the user is a super admin would crash the site. More info on is_super_admin() here http://codex.wordpress.org/Function_Reference/is_super_admin


title: Custom Fields Not Showing

text:
I have this custom field for a post:               key: price     value: 2000      I've added this to my loop:
<?php $price = get_post_meta($post->ID, 'price', true);     if ( $price ) { ?>     Price: $<?php echo number_format($price ,",",",",","); ?>     <?php } else {} ?>
      But all I'm getting is:               Price: $


title: output the debug lines to the end of the page

text: Does anyone know a hook, which doesn't depend on the template. A hook I can rely on in any situations? there's some debug data collected while loading pages (i'm using 'all' hook to collect filter names) i would like to log to the screen. i need the data displayed, say, before               </body>       tag. Thanks.


title: How do I display the index position of a post from a custom post type?

text: So I have a custom post type (ex. songs) and have a few posts that I created for this post type. I want to display them on a webpage in order (ex. 1, 2, 3, ...). How do I get the index position and display it on my page? Any insight or solutions would be greatly appreciated!


title: Display the contents of a custom field of a page on their child

text: Let's see if anyone knows how to accomplish the following: I have a custom field, which is a textarea where the user can enter any text. The idea is that if a page is filled in that field, the entered content appears on all child pages. CASE 1   * Page 1    * Page 1.1 (the user fills out the custom field and displays the   content)   * Page 1.1.1 (displays the contents of the field completed on Page 1.1)    * Page 1.1.2 (displays the contents of the field completed on Page 1.1)   * Page 1.1.3 (displays the contents of the field completed on Page 1.1) CASE 2   * Page 1 (the user fills out the custom field and displays the content)   * Page 1.1 (displays the contents of the field completed on Page 1)   * Page 1.2 (the user fills in the field, so it inherits from Page 1.1, but shows your own)   * Page 1.2.1 (displays the contents of the field completed on Page 1.2) I hope I explained well with the examples of what I get. Thank you in advance.


title: Only looping through pages that have children or subpages

text:
I have a custom post type called "films", and most films have a subpage (child page) called "press". I am trying to loop through the films, and check to see if a subpage exists. If a subpage exists, loop through the content. If it doesn't exist, leave out the content. My loop is as follows:               <?php $loop = new WP_Query( array( 'post_type' => 'films', 'posts_per_page' => 8,'orderby' => 'date', 'order' => 'ASC', 'film-categories' => 'available-now-shows-on-homepage' ) ); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
          <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>          <?php endwhile; ?>      I only want the linked title to show if it's page has children (a press page). How would I modify the loop to do just that?


title: Link to full-size image for subscriber only

text: I'm looking for a way to disable the "link to full-size image" for people that are not logged in. I would like that people become a subscriber before they can download my full size images. Is this possible?


title: Problem with using wp-load.php outside of WordPress

text: I'm trying to use wp-load.php in a page outside of wordpress so I can access all the functions in wordpress. Typically I just include the file like this               require( $_SERVER['DOCUMENT_ROOT'].'/blog/wp-load.php' );       But it doesn't seem to be working. Any tips on what can be going on? Thanks, Paul


title: Simple plugin for showing RSS subscription links?

text: Does someone know of a simple plugin for showing RSS feeds? I need something dead simple that only show the links and would rather re-use something before rolling one myself.


title: how do I encode links to specific archive searches?

text: I want to embed links to the archive pages with specific search criteria. i.e Links to specific categories, links to specific authors etc etc At the moment I am adding the links using anchor tags, but these will fail if the permalinks change


title: Show links to archive pages based on custom field values

text: I have a recruitment website on which I want to display a list of Job Location links. The job location has already been entered into a custom field for each post so I just want to display a list of links that when clicked will show posts with only that custom value entered, ie - England Ireland USA etc.. Click a country link above and see all of the posts that have the country in question added as a custom field value??


title: Add custom text to Page Tamplate without need to know html

text: I am new to wordpress. I have experience in css \ html \ js and asp.net (and also a bit of php now). I've added to my blog certain areas that are hard coded in html and css. In these areas I'd like to be able to set text based on the admin's input in the panel's page. I want a person who doesn't know html to be able to easily change the content of these hard coded areas. How can this be done? Thank you!


title: Can't insert caption into image

text: You can see live example here. When I add a caption into the image, it doesn't show at all!   I've added the caption to the image as you can see in the next picture      ![Here](http://i.stack.imgur.com/hKokm.png)      but it doesn't show as you see below      ![here](http://i.stack.imgur.com/LYvCJ.png)      But when I click edit the picture icon as you see below      ![here](http://i.stack.imgur.com/zcQGI.png)      and fill in the caption field      ![here](http://i.stack.imgur.com/NplmB.png)      the caption works!      ![fine](http://i.stack.imgur.com/ElK81.png) Why it's not working in the first case? I've disabled all plugins and no luck! I've tried the twenty fourteen theme, and no problem there, so the problem is in my theme only. Can you please help!


title: Redirect certain pages if user logged in

text: how would one go about redirect certain pages if the user viewing them is logged into the WordPress CMS? For example, we have 2 registration pages that when logged in should direct to some other page / category archive. Thanks.


title: Are there plugins that interfere with the admin part of Rss widget?

text: I've been using the Rss widget in my site, and suddenly a few days ago, the admin part stopped responding.   That is, I'd change the link to the Rss and it wouldn't get saved (and therefore would show the old Rss in the site). Or I would add another Rss widget, but after I refreshed the admin page, I'd see the widget, but without the links and the other options I added.   Then I got to thinking that maybe one of the plugins could be causing the problem.   Are there known plugins that would do that?


title: Is it possible to post with Word 2007 via XML-RPC and limit categories by user?

text: I'm working on a project for a school district I work at where we want to use Word Press to have employees from all of the buildings post announcements and press releases via Word 2007. We will then use RSS feeds to show the information on the district's web page and other subscribed locations. The problem we are running into is when we create user roles for categories, this basically is not working through the XML-RPC in Word 2007. It is working fine within the administration panel, but when the user goes to insert a category in Word, all of the categories are shown. We would like to limit the available categories by user so that only a building secretay and principla can post the the high school category for example. I have been search for a couple of weeks for a solution to this, if one exists. Does anyone have any ideas?


title: is_front_page not working at all in any of the themes .php files

text:
I am using the Paragrams theme from the kind folks at wpshower. I have a little different front page that I would like to load with an image rotator and different layout in the for loop. I have tried all of the conditional comments, with no avail. There are some posts on this already that didn't have a solution...   * is_front_page, is_page('slug'), is_page(id) not working   * is_front_page() not working wordpress I even tried this most basic if else from the WP forum without any help. What am i missing? :(               <?php     if (is_front_page())     {?>
Flash Gordon
          <?php } else { ?>
Wins the Battle!
     <?php } ?>


title: how does get_term_by know which term to return when the same term appears twice in a hierarchical taxonomy?

text: This is from the codex.               <?php get_term_by( $field, $value, $taxonomy, $output, $filter ) ?>      Suppose I have a taxonomy system as follows; taxonomy: "healthy foods" and it's a hierarchical taxonomy and your hierarchy goes exactly like this;               healthy foods         fruits             red ones             green ones         veggies             red ones             green ones      and you use the `get_term_by` function as follows; get_term_by("name","red ones","healthy foods") Do you get the veggies or the fruits?


title: My WordPress site always displays a cached version of its homepage

text: First of all, sorry if I'm making a mistake. I already asked this on the ServerFault forum, but got no answers at the moment and I thought it would be a good idea to ask the question here, considering that it is a WordPress specific question. I have a WordPress site that runs fine, but there's a strange behaviour: one a reader loads the page, **the site shows a "cached" version** of the site, with the same news and comment numbers that the reader viewed when he visited the site last time. So every user **has to reload the page** (Ctrl+F5, Cmd+R) in order to get the "real", and updated homepage. I don't know why this is happening. At the moment I'm not using any cache plugin, and my server is running **Nginx+MySQL+PHP-FPM** on a Ubuntu 10.04 LTS Linux VPS. Is there something I must change on the nginx config files, maybe?


title: Users Role and Access

text: I am a bit of a novice to this so please be patient. I am trying to create a site with a programmer using wordpress, but not using it for blogs or post.   I am not a programmer myself. I want people to register for the site, and by default their role will be a modified subscriber. Meaning they will have no access to admin nor to any kind of editing on the site. All they can do is view the pages. Also, I want to restrict them to view only a particular page or pages. Admin can later go and change their status and make their role to a regular subscriber. What I am really trying to do is to create a site with a full restrictions.   Users will register, but still don't gain access until their registration is reviewed by the admin and grant access to them. Is this possible?


title: get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category

text: Thanks to @MikeSchinkel I have the following code:               $term = get_query_var('term');         $brand = get_term_by('slug',$term,'brands'); // This here just to illustrate         $categories = get_cross_referenced_terms(array(         'post_type'        => 'Products',         'taxonomy'         => 'category',         'related_taxonomy' => 'brands',         'term_id'          => $brand->term_id       ));      which uses the following function:               // query to get categories for a specific tag     function get_cross_referenced_terms($args) {       global $wpdb;       $args = wp_parse_args($args,array(         'post_type'        => 'Products',         'taxonomy'         => 'category',         'related_taxonomy' => 'brands',         'term_id'          => 0,       ));       extract($args);       $sql = <<<SQL     SELECT DISTINCT       {$wpdb->terms}.*,       COUNT(*) AS post_count     FROM       {$wpdb->terms}       INNER JOIN {$wpdb->term_taxonomy} ON {$wpdb->terms}.term_id={$wpdb->term_taxonomy}.term_id       INNER JOIN {$wpdb->term_relationships} ON {$wpdb->term_taxonomy}.term_taxonomy_id={$wpdb->term_relationships}.term_taxonomy_id       INNER JOIN {$wpdb->posts} ON {$wpdb->term_relationships}.object_id={$wpdb->posts}.ID       INNER JOIN {$wpdb->term_relationships} related_relationship ON {$wpdb->posts}.ID=related_relationship.object_id       INNER JOIN {$wpdb->term_taxonomy} related_term_taxonomy ON related_relationship.term_taxonomy_id=related_term_taxonomy.term_taxonomy_id       INNER JOIN {$wpdb->terms} related_terms ON related_term_taxonomy.term_id=related_terms.term_id     WHERE 1=1       AND related_terms.term_id<>{$wpdb->terms}.term_id       AND {$wpdb->posts}.post_type='%s'       AND {$wpdb->term_taxonomy}.taxonomy='%s'       AND related_term_taxonomy.taxonomy='%s'       AND related_terms.term_id=%d       AND {$wpdb->term_taxonomy}.parent=0     GROUP BY       {$wpdb->terms}.term_id     SQL;       $sql = $wpdb->prepare($sql,$post_type,$taxonomy,$related_taxonomy,$term_id);       $terms = $wpdb->get_results($sql);       return $terms;     }      This is used on the category.php page and works great, but I need to now use the same code (ideally) on the child category page? So for example I have it on a category page of 'trainers', filtered by brand of 'nike' for the custom post type 'products'. I now need it to show all child categories of 'trainers', also filtered by brand of 'nike' for custom post type of 'products'. Is there a way to simply add?               'category_id'         => '$parent_category',      Any help would be greatly appreciated! Thanks Dave


text: I have a WordPress site that runs fine, but there's a strange behaviour: one a reader loads the page, **the site shows a "cached" version** of the site, with the same news and comment numbers that the reader viewed when he visited the site last time. So every user **has to reload the page** (Ctrl+F5, Cmd+R) in order to get the "real", and updated homepage. I don't know why this is happening. At the moment I'm not using any cache plugin, and my server is running **Nginx+MySQL+PHP-FPM** on a Ubuntu 10.04 LTS Linux VPS. Is there something I must change on the nginx config files, maybe?


title: previous_post_link in same taxonomy in custom post type

text:
Im trying to make previous_post_link and next_post_link work inside a custom post type, inside a same category (taxonomy) but its not working. It this posible ? Im trying               <?php previous_post_link('
%link
', 'Next in category',TRUE); ?>


title: The Jetpack site is inaccessible 32700

text: I installed Jetpack and I activated JSON API. When i try to access my blog it shows following error: `{ "error": "jetpack_error", "message": "The Jetpack site is inaccessible or returned an error: parse error. not well formed [-32700]" }` What i have to do now?


title: Restrict authors to seeing ONLY their media files

text: I'd like to restrict authors ability to see files uploaded by other users because this causes no end of trouble, since they can change captions etc. I tried this code from here How to hide media uploads by other users in the Media menu?               add_action('pre_get_posts','users_own_attachments');     function users_own_attachments( $wp_query_obj ) {              global $current_user, $pagenow;              if( !is_a( $current_user, 'WP_User') )             return;              if( 'upload.php' != $pagenow )             return;              if( !current_user_can('delete_pages') )             $wp_query_obj->set('author', $current_user->id );              return;     }         This only works on the media screen, not when you select a file on a post to actually upload. I also tried the second solution, but it's causing issues with my autocomplete search function and I can't figure out why. Is there a way to stop authors seeing others files when they're making a post?


title: Wordpress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache

text: I have been working on a theme for a few days and when I realized my JS file for my theme customizer wasn't updating I decided to clear the cookies and cache, and wow that was problematic. As soon as I did that I recieved this error many times, mainly stating the file I am working on(customize.php and the other file it said was pluggable.php:               Warning: Cannot modify header information - headers already sent by customize.php       After I tried to login I am now receiving this error:               Parse error: syntax error, unexpected T_FUNCTION on line 1      Everytime I replace the file with a previous version it keeps messing up the format of the code and making it all one line of code as soon as I refresh the page and redownload the file. I don't understand what is causing this. Why is it making the whole file 1 line? It makes it harder for me to find the original issue. **Edit:** I ended up creating a an empty file and copy and pasted the code into it. After that my issue stopped. For some reason Notepad++ was adding way too much whitespace to the width of the file causing all of the code to form on 1 line. Therefore causing a plethora of problems. After pasting the code into a new file it works.


title: Admin permission for creating blogs in multisite

text: How can I do that ? I have some blogs and anyone can register and build a new blog . I'd like to limit them just to visit and comment not to build a new blog unless I allow them .


title: dynamic page not indexed

text: Im writting a plugin who makes dynamic pages with simple page template: http://domain.com/slug the url is rewriting so internally call to http://domain.com/index.php?pagename=users and works, but the problem is, how I can index it to make searches? Any ideas?


title: To Add Logout Button in Menu

text:
> **Possible Duplicate:**   >  How to use logout function on custom menu link? I want to add a logout button at very last of my nav.. I Found a function               // functions.php     function add_login_logout_link($items, $args)     {       if(is_user_logged_in())       {         $newitems = '
Logout
';         $newitems .= $items;       }       else       {         $newitems = '
Login
';         $newitems .= $items;       }       return $newitems;     }     add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);      But It adds Logout button to the very start of the nav, and i want to to be displayed on very Last. (Ideally it should be float:right, as other menu items are float:left) Thanks


title: How to fix admin stylesheet muck-up?

text: I have no idea what's going on here.. running the latest version, just logged in and I find my admin area looking like this: ![enter image description here](http://i.stack.imgur.com/xTyoZ.jpg) To me it looks like it's missing some/many styles and in load-styles.php in the inspector it's showing a bunch of gibberish and I have a 'Uncaught SyntaxError: Unexpected token ILLEGAL' error twice on loadscripts.php. I tried reinstalling the current version of WP and nothing changed. Then I reuploaded the load-styles.php (same size) from the base wordpress files, and it started working. Then suddenly it was doing the same thing on another of my sites. I tried the same trick (and also with load-scripts.php (this time though the load-styles was much larger so I backed it up) but that didn't help. The only thing I can imagine might be causing this is the iOs wordpress app because I recently added it to both blogs. That's the only change I've made in the last little while and I've been on the sites before with no issue.


title: How to override wp_insert_comment()

text: I am trying to override `wp_insert_comment()` (wp-includes/comment.php). I added the following lines of code in my `functions.php` file, located in my theme :               add_filter('wp_insert_comment', 'my_insert_comment');     function my_insert_comment($commentdata)     {          /* Some stuff */     }         Here is a line found in the original wp_insert_comment() function :               function wp_insert_comment($commentdata)     {         /* Some stuff */         do_action('wp_insert_comment', $id, $comment);         return $id;     }      After many tests, I have the feeling that the real `wp_insert_comment()` is executed, and when it comes to the `do_action()` line, my filter is taken into consideration and my `my_insert_comment()` function is finally executed.    Of course, my purpose is to replace the original function by my own one. `my_insert_comment()` is working fine if I write it directly in the `comments.php` file, but I would like to keep it _update-proof_. Am I doing something wrong ?


title: in_category for custom post types

text:
how can I use the in_category for custom post types? here is my code.               <?php get_header('shop'); ?>      ?>               <?php if ( have_posts() ) while ( have_posts() ) : the_post(); global $_product; $_product = new jigoshop_product( $post->ID ); ?>              <?php do_action('jigoshop_before_single_product', $post, $_product); ?>              <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                  <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Lesson Sidebar')) : else : ?>             <?php endif; ?>
             <?php do_action('jigoshop_before_single_product_summary', $post, $_product); ?>

Lesson Pack

<?php the_title(); ?>
                      <?php do_action( 'jigoshop_template_single_summary', $post, $_product ); ?>

Description
             <?php the_content();?>
                          <?php do_action('jigoshop_after_single_product_summary', $post, $_product ); ?>
              <?php do_action('jigoshop_after_single_product', $post, $_product); ?>          <?php endwhile; ?>      ?> thanks


title: Putting my site live

text: Can anyone help? I've been building a wordpress site in a sub directory of an umbrella 'development domain' if you will, and am ready to go live with the site. It's a single install of wordpress. The wordpress file location is to remain exactly as it is, and we're just repointing the DNS of the live domain to the subdirectory of the development domain. I hope this makes sense so far. In my general > settings section of the admin, I've set the url to be http://s391121685.websitehome.co.uk/sb As that is the url my development domain has allocated to it. We didn't update the DNS settings of the REAL domain prior to now as there is an existing website already up. Bearing in mind that no wordpress files are going to be moved, can i just change the wordpress address and site address under settings to www.newlivesiteurl.com? Any advice would be appreciated. Thanks _**_UPDATE **** Ok so I've edited my config file with the details suggested below, but now when i try to log into my wordpress admin, I'm stuck in a continuous loop. It juts keeps redirecting me back to the login screen! Any help would be greatly appreciated....


title: Get current term in single.php

text: I have a custom post type (dibujos) and 4 custom taxonomy. I would like to get term name in a current post. The probleme is, how to To display the name of the taxonomy, no matter what taxonomy is. The code is:               <?php   // Get terms for post      $terms = get_the_terms( $post->ID , 'my-taxonomy' );      // Loop over each item since it's an array      if ( $terms != null ){      foreach( $terms as $term ) {      // Print the name method from $term which is an OBJECT      print $term->name ;      // Get rid of the other data stored in the object, since it's not needed      unset($term);     } } ?>      Thks!


title: Taxonomy archive page have no post

text: I have a taxonomy with posts assigned to terms, and on the term archive page i get no found post               $rewrite = array(         'slug'                       => 'mytax',         'with_front'                 => true,         'hierarchical'               => false,     );     $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,         'rewrite'                    => $rewrite,      and in my post list in admin, i get the same error when i filter by terms by clicking on the term in the post list i have no error, how i can proceed ? thanks in advanced **EDIT** i try to run the wp_query request ( `wp_query->request` ) in MySQL and it's returned the correct posts, but the `wp_query->posts` is empty **EDIT 2** i try to add a new taxonomy , add a term to this taxonomy and add a post with this taxonomy, but the taxonomy leave after update the post


title: event propagated to google calendar

text: i am using the default events widget. is there a way, that i could propagate any events created in wordpress to a google calendar? so any time a new event is created in wordpress, it should also be reflected in a google calendar. of course if the event is deleted it should be deleted on the google side as well. i have looked into some plugins, but i could not find anything appropriate. there are plugins, that work the other way around. thanks thoms


title: WP_Query Sorting Posts by month ... timeline effect

text:
Hoping someone can take a look at my code and help me out. Right now I am trying to show my blog in a timeline style approach. My current query is generating the posts how I would like them to but I am not getting the HTML structure properly. Right now I have a `<div>` that contains a `<ul>` with post info. I would like the `<div>` to generate a unique `<ul>` for each post within that month instead of each time generating a new `<div>` for the post. So for example... if July 2014 has 3 blog posts I want the structure to be:

      Right now it generates as:

      Here is my template:

                  <?php                 $counter = 0;                 $ref_month = '';                 $monthly = new WP_Query(array(                     'posts_per_page' => -1                 ));                      if( $monthly->have_posts() ) : while( $monthly->have_posts() ) : $monthly->the_post();                      if( get_the_date('mY') != $ref_month ) {                     if( $ref_month );             ?>

<?php echo get_the_date('M Y'); ?>

                  <?php                 $ref_month = get_the_date('mY');                 $counter = 0;                 } if ($counter++ < 5) {             ?>                  <div class="timeline <?php echo strtolower(get_the_time('F-Y')); ?>">

                                          <?php if (has_post_thumbnail()) { ?>                                              <?php the_post_thumbnail( 'full' ); ?>                                          <?php } else { ?>                                                                                <?php } ?>

<a href="<?php the_permalink();?>"><?php the_title();?>
                                         By <?php the_author(); ?> | <?php the_time(get_option('date_format'));?>

<?php echo excerpt(25); ?>

                                         <a href="<?php the_permalink();?>" class="more"><?php echo __('Read More >')?>                                          <?php comments_number('0','1 comment','% comments')?>

                                      <?php } else { ?>                                      <?php } ?>

                  <?php endwhile; endif; ?>

<?php next_posts_link(__(' ')); ?>

<?php previous_posts_link(__(' ')) ?>

                  <?php wp_reset_query(); ?>

      Any help is appreciated, thank you!


title: How can I de-register ALL styles all at once? And same with Javascript?

text: How can I get all enqueued styles or scripts and then deregister them all at once?


title: How can I create a bash install script for my Wordpress sites setup (WP+plugins+theme)?

text:
I build a lot of websites with Wordpress, and my initial setup is basically always the same :   * Latest version of WP   * Latest versions of about 5 plugins    * My naked development theme Instead of downloading/uploading these things separately and do that by hand each time I start a new project, I'd like to create a bash script that would do this :   * Download the latest version of Wordpress   * Unzip   * Download the latest version of plugin X   * Unzip to WP plugins folder   * Download my naked theme   * Unzip to themes folder Now downloading the latest WP is easy (http://wordpress.org/latest.tar.gz), downloading my naked theme too, but I'm having trouble getting the latest version of a plugin, as they are not called `latest.tar.gz` but specifict names with the version (ex: wptouch.1.9.26.zip) EDIT : So I'm wonderning now if it's possible to use cURL in my bash script to find the exact URL of the Current version of a plugin. The idea would be to fetch the page, and then find the value of the `href` that is in the paragraph just after the `<h3>Current Version</h3>`. Here's an example, all plugin download pages on WP are like this :
Current Version

         1.1.2