title: get images attached to post

text:
I want to have the ability to use pictures from the media library in a jquery slider on the home page so that it's easy for someone else to update the pictures without having to hardcode it. I have attached a bunch of photos to a post and tried this               <?php     $image_query = new WP_Query(array('name'=>'slider-images'));     while ( $image_query->have_posts() ) : $image_query->the_post();         $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID );          $attachments = get_posts($args);         if ($attachments) {             foreach ( $attachments as $attachment ) {                 echo '
';                 echo 'ID).'" />';                 echo '
';             }         }     endwhile;     wp_reset_postdata();     ?>      but it doesn't display anything. Is there something wrong with my code or is there an easier/better way to group images together rather than put them in a post? EDIT: If I use the_content() in my $image_query loop it outputs the images like

      but what I need is something like


title: How do I get a meta value from WP_Query?

text: I've got the custom post type `foo` with meta fields called `bar` and `baz`. Now I get the `WP_Query` object using:               $args = array(             'post_type'      => 'foo',             'meta_key'       => 'bar',             'meta_value'     => $bar_value,            'posts_per_page' => 10,     );     $res = new WP_Query($args);      Now I want to check if the value `baz` of the selected post is equal to `$baz_value`. How can I do that?


title: How to parse without changing the characters case (lower and upper) in wordpress the_content?

text: I made a custom parse function for my plugin and this one works great. I just have a little problem ! Here is my function :               public function ys_glossary_parse( $text )         {             // Get all the items in the database             $terms = $this->get_all_termes();                  // Get the id of the glossary page             $glossary_page_id = get_option('ys_glossary_PageID');             if(!$glossary_page_id OR $glossary_page_id == 0)             {                 return $this->admin_message('You don\'t have a Glossary page yet. Go in the option page !');             }                  // Get the permalink of the page             $permalink = get_permalink($glossary_page_id);                  $text_to_link    = apply_filters( 'ys_glossary_text', $terms );                  //$preg_flags      = $case_sensitive ? 's' : 'si'; // TODO: add an option for that             $preg_flags      = 'si';                  $text = ' ' . $text . ' ';             if ( ! empty( $text_to_link ) ) {                 foreach ( $text_to_link as $old_text ) {                          // TODO: modify this to use the upper/lower case of each words without modifying them                          $new_text = '' . $old_text . '';                     $new_text = apply_filters( 'ys_glossary_text_linked_text', $new_text, $old_text, $permalink );                     $text = preg_replace( "|(?!<.*?)\b$old_text\b(?![^<>]*?>)|$preg_flags", $new_text, $text );                 }                 // Remove links within links                 $text = preg_replace( "#(]+>)(.*)]+>([^<]*)([^>]*)#iU", "$1$2$3$4" , $text );             }             return trim( $text );         }      The $terms are in a simple array like :               array(     [0] => 'item1',      [1] => 'item2',      [2] => 'item3'     );       (they are with uppercase on the first letter). What i want is : How do i make the link on the words without changing the words case ? **Blocking** will stay as **Blocking** but **blocking** will be **blocking**. (So the uppercase and lowercase of the words stay as they are !) I use the case insensitive but my function change all the words with a uppercase for the first letter because the terms are like that. But if i use lowercase on the terms, it change all to lowercase the_content. So i need help on this. Thank you very much ^^ Yann


title: Rotating image does not work for custom image sizes

text: When rotating an image with the WordPress image editor it creates new images and renames all of the images for the thumbnail, medium and large image sizes that are default for WordPress. My problem is that I have registered new image sizes using add_image_size(); Is there anyway to make WordPress rename/rotate these custom image sizes? If there is a way to just have it replace the original image names that would be great. So we don't end up with strange image names like My_Image-e13232345234234-200x600.jpg. **EDIT** Below is a test plugin that shows this happening. Paste the code in a file in your plugins folder, then upload an image such as my_image.jpg. You should now have my_image-30xY.jpg. Now if your rotate the image you will get only 4 new images such as my_image-e1343232354234.jpg, but there will not be a new image for the "test" image size.               <?php          /*     Plugin Name: Test     Description: this is a test     Author: Mike     Version: .1     */          class test{              function __construct(){         add_action( 'after_setup_theme', array($this, 'add_image_sizes') );         }              function add_image_sizes(){         add_image_size( 'test', '30', '30' );         }     }          new test();          ?>


title: Wordpress is adding <!— page-who-we-are.php --> above html

text: Wordpress is adding this comment above all HTML on my site which is causing problems in IE in which the site won't render properly at all. How do I stop WP adding this? Tried disabling all plugins but nothing


title: How to load a css file in one page only?

text: I have a javascript file and a corresponding css file. Both files should be embedded at a single wordpress page. I managed to load the javascript file, but how can a css file be loaded from/at a page?


title: Creating multiple functions for front-end forms

text: I have the following situation (which I simplified for didactical purposes): page-books.php:               <form>         <input type="text" name="title" />         <input type="text" name="sinopsis" />         [...]     </form>      page-cars.php:               <form>         <input type="text" name="name" />         <input type="text" name="model" />         <input type="text" name="year" />         [...]     </form>      page-movies.php:               <form>         <input type="text" name="title" />         <input type="text" name="director" />         [...]     </form>      functions.php:               function insert_custom_post()     {         // Treating $_POST variables sent from above forms         // Executing wp_insert_post(...) according to post type         // Redirecting to Home         [...]     }     add_action( 'template_redirect', 'insert_custom_post' );      In the above case, both forms, of three pages, are using the same function on `functions.php` to treat the submitted data. How can I make three separate functions, one for each form on each page? Note: I do not want to put the PHP code to treat the submitted data on the same page of the form 'cause it is confusing to manage, lacks security and I cannot use wp_redirect properly. So, I'm trying to transfer all processing steps to `functions.php`.


title: dynamically get post attachment while editing

text: I want to show a meta box on the post edit screen, that contains a list of the images attached to the post. I need the meta box to work for new posts as they are being created. It should update dynamically when images are added to or removed from the post ( when images are added/removed as featured image, or using the "insert media" picker as single image or as part of a gallery in the content) . I need the metabox to 'see' these events and update accordingly, before the post is published or even (manually) saved as a draft. Is this possible? If it is, I'd be happy to know (roughly) how to achieve it. Links to plugins already doing this, or an explanation of the overall way of doing it. Is there a JavaScript event I can listen to, and do I need to fire an ajax request to get the updated list of attachments, or can I get it all from the JS environment available in the post edit page?


title: Only display latest custom taxonomy post

text: I have a custom taxonomy set as a "splash" on my front page, I would like to only display the latest one of these taxonomies as a splash, and any older ones to be returned to the loop and displayed as normal. My code atm below displays the splash fine, but reproduces the splash again in the loop for some reason:               $args = array(         'post_type' => 'post',         'posts_per_page' => '1',         'order_by' => 'date',         'order' => 'DESC',         'tax_query' => array(             array(                 'taxonomy' => 'theme',                 'field' => 'slug',                 'terms' => array ('text-image', 'just-image', 'just-text')             )         )     );          $query = new WP_Query( $args );     if (have_posts()) :         while( $query->have_posts() ) :             $query->the_post();      Any help would be appreciated!


title: Using the "Latest posts" feature on a different site

text: I want to display the "latest x posts", like you see per default on the index- page, but on a completely different site. E.g. `/blog/` Installing WP into the directory `/blog/` is not an option, as the other pages will be managed with WP. Currently I'm using the `NuRelm Get Posts` plugin to get the content of the latest 10 posts, but the styling is really hard to recreate with it. So, is there any simple solution to use the "Show latest posts" on other sites? **Edit** : I'm using the `twentyten` theme as basis


title: "Order" doesn't work in custom loop?

text: I have a custom loop (used in a shortcode) that lists items from custom post type. Everything works fine but "order" for posts doesn't work, no matter what I type as order attribute on post page - items are always displayed the same way (the most recent first and the oldest last). Why doesn't "order" work in my case? The loop looks like:                 $loop = new WP_Query( array(              'post_type' => 'images',                'paged' => get_query_var('paged') ? get_query_var('paged') : 1,             'posts_per_page' => $per_page,              ) );          while ( $loop->have_posts() ) : $loop->the_post();     (my code)     php endwhile;


title: Find Posts based on Child Post value

text: I am creating a plugin that adds two custom post types, one of which will always be a child of the other. The parent post type is for Events, the child for Performances. Before entering the Loop, I'd like to be able to find a set of Events that have Performances on a specific date. Performance date is stored as a meta field on the Performance post. The Loop would then list each Event matched, like in a standard post archive loop. My preference is to query the Event post type, since that strikes me as easier to manage for pagination, but if there's a better implementation that simply involves querying performances, I am open to that, but I'd like to see if there's a facility for limiting a query based on a field in the child post.


title: remove sanitize_title() for register_taxonomy()

text: **Update**   From reading the answers, i think i didn't make myself clear, so i try to post it again. I register taxonomies from data from parsed xml files. The arguments passed _should_ be absolutely correct. What i wanted to know is on which of the arguments of the `register_taxonomy()` function the `sanitize_title()` function get's called. I currently got an error and need to figure out which of the parameters is wrong.


title: What is the best way to figure out which template file that a "pretty permalink" is using?

text: I'm new at wordpress, so maybe this question is very basic, but I looked at Google and I searched for tutorials and I didn't find anything... The question is simple. I have a "page", and this page is show as a friendly url. Example http://www.example.com/seleccion/2011/03/24/abuso-sexual-el-secreto-y-la- verguenza-por-jose-andres-murillo/ How I coul find the php file where this "page" is render? When you don't have friendly url, thats is easy : http://www.example.com/page_file.php?id=3&cat=8 but the friendly url hide all this information :( Thanks in advance...


title: Supersize plugin error in internet explorer 7 and 8

text: Supersize plug in works great in firefox and safari but won't load in ie at all and brings up the following error line: 13 Char: 1152 'd.options.slides[…].thumb' is null or not an object any help much appreciated Site is http://ac-design.no


title: Can't add external rewrites

text: I've got the following code in my functions.php               function add_custom_rewrite_rules(){             add_rewrite_tag('%gallery%','([^/]+)', 'gallery=');        add_rewrite_tag('%album%','([^/]+)', 'album=');             add_rewrite_rule('galleries/(.+)/?$' , 'index.php?pagename=galleries&album=1&gallery=$matches[1]');     }          add_action('init', 'flush_rewrite_rules');     add_action('init', 'add_custom_rewrite_rules');      But the rewrite rule is not getting added, and it doesn't show up in my list of rewrites in the admin.


title: Disable TinyMCE Drag and Drop

text: I would very much like to disable the drag and drop upload feature for tinyMCE (both the default one and the `wp_editor()` one) because it interacts with my custom pop up menus - (WP Trac). Right now I'm trying to just disable the one with the actual `WP_Editor()` function. For some reason it doesn't seem to actually disable any drag and drop functionality and was wondering if I was doing something wrong. My function call looks like this:               wp_editor($meta_content, 'additionalTab', array(         'wpautop'           =>  true,         'media_buttons'     =>  false,         'textarea_name'     =>  '_additional_content',         'textarea_rows'     =>  15,         'teeny'             =>  true,         'drag_drop_upload'  =>  false     ));      **The Expected Output** is that it should completely disable drag and drop uploads directly to the tinyMCE. **The Actual Output** is that it doesn't do anything, it still allows you to drag and drop upload into the tinymce. Is there something wrong with what I'm doing or is there something inherieitnly wrong with `wp_editor()`?


title: Fatal error, is this because of host?

text: Suddenly I am getting the following error on my website, I don't know why, but I think this is because of shortage of RAM or Memory in the host? Is it true? Error: > Fatal error: Out of memory (allocated 12845056) (tried to allocate 311296 > bytes) in /wp-content/plugins/WPRobot3/wprobot.php(1239) : eval()'d code(1) > : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) > : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) > : eval()'d code on line 335 > > Fatal error: Out of memory (allocated 18874368) (tried to allocate 35 bytes) > in /wp-includes/wp-db.php on line 1140 Is this because of insufficient memory with the host? or is it because of wp? Notices               Notice: get_settings is deprecated since version 2.1! Use get_option() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: Undefined index: page in wp-content/plugins/seo-booster-lite/seo-booster.php on line 980          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: Undefined index: page in wp-content/plugins/autoblogged/autoblogged.php on line 164          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: Undefined index: page in wp-content/plugins/seo-booster-lite/seo-booster.php on line 990


title: Indenting (tabbing) WP_head

text: Right now all the stuff that gets included in wp_head are left justified all the way in the code view. Whereas all my other code that is around the wp_head is indented (tabbed) two times. Is it possible to add an indent/tabs to all the wp_head info? Thanks


title: Adding if statement to content for homepage

text:
I have an if statement already in my loop to display content based on post type. I was wondering if there was a way that I could say to ignore that section if it is the front page/homepage. Here's a sample of my code:                   <?php if( get_post_type() == 'reviews' ) { ?>

                      other div stuff
          <?php } ?>


title: Metabox does not show in custom post type

text: I am trying to create a metabox input field in a custom post type and it does not work even if I followed the instructions the best I could. I am not a PHP dev so I guess it could be just a small thing that is missing or it is wrong. By not working I mean, I does not show at all in the WP UI. Here is the code:               <?php          function add_post_type($name, $args = array()) {         add_action('init', function() use($name, $args) {                      $upper = ucwords($name);                 $name = strtolower(str_replace(' ','_',$name));                      $args = array_merge(                      array(                 'public'=> true,                 'label' => "All $upper" . 's',                 'labels' => array('add_new_item' => "Add New $upper"),                 'support' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'custom-fields'),                 'taxonomies' => array('post_tag','category')                 ),                      $args                      );                      register_post_type('$name', $args);             });          }               //now we create and register a taxonomy     function add_taxonomy($name, $post_type, $args = array()) {         $name = strtolower($name);              add_action('init', function() use($name, $post_type, $args) {                 $args = array_merge(                     array(                     'label' => ucwords($name),                          ),                     $args                 );                     register_taxonomy($name, $post_type, $args);         });      }          /************************************************************       Now we add the names of the custom post type and taxonomies     *************************************************************/               add_post_type('snippet', array(                 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'custom-fields'),                 'taxonomies' => array('post_tag')     ));               add_taxonomy('language', 'snippet');          /************************************************************       Creating Metaboxes     *************************************************************/          add_action('add_meta_boxes', function() {         add_meta_box(             'er_snippet_info',             'Snippet Info',             'er_snippet_info_cb',             'snippet',             'normal',             'high'         );     });          function er_snippet_info_cb() {         global $post;         $url = get_post_custom($post->ID);               ?>              <label for="er_associated_url">Associated URL: </label>         <input type="text" name="er_associated_url" id="er_associated_url" value="<?php echo $url; ?>" />              <?php     }         add_action('save_post', function () {             global $post;              if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;             //security check              if ($_POST && !wp_verify_nonce($_POST['er_nonce'], _FILE_)) {                     if ( isset ($_POST['er_associated_url']) ) {                 update_post_meta($post->ID, 'er_associated_url', $_POST['er_associated_url']);                   }            }              });     ?>      The other issue is that the Tag is not named even if the function is there.


title: Featured Image inserted through custom query, does not show up

text: I need to transfer all my records from OpenCart to WooCommerce powered WordPress site. I used custom query to insert the image urls from opencart db to wp_posts as attachment and guid as the URL of the image, along with post_parent being the product id for that particular image. While the listings show in Media, it still does not load show images and also does not appear on Featured Image box of related products. But if I copy the url from Media manager and open it in new tab. The image shows up just fine. What could be the reason? Also is there any other way to transfer OpenCart data to WooCommerce? Any help would be appreciated. Regards


title: Multisite permalinks for subfolder wordpress installation

text: I have WordPress installed in a subfolder of the main site: `http://www.example.com/blog/` Now I need to add second blog on `http://www.example.com/blog/second/` So 2 blogs should work on the following URLs:   1. `www.example.com/blog/`   2. `www.example.com/blog/second/` I configures WordPress and almost everything works fine, but I have a little issue with the main blog (`www.example.com/blog/`), the post URLs look like **/blog/blog/hello-world/** rather than **/blog/hello-world/**. Second blog URLs work properly. I tried to change permalink structure in site settings to /%postname%/, and all URLs look good after that, but all they cause 404 error. How can I get rid of double /blog mention in this case? Thanks in advance! wp-config settings:               /* Multisite */     define( 'WP_ALLOW_MULTISITE', true );     define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', false);     define('DOMAIN_CURRENT_SITE', 'www.mysite.com');     define('PATH_CURRENT_SITE', '/blog/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);      htaccess:               RewriteEngine On          RewriteBase /blog/     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]     RewriteRule . index.php [L]


title: How to retrieve the date on which a post was moved to trash?

text: I need to retrieve a list of posts that are in trash based on the date on which they were trashed. The following code allows me to retrieve posts that are in trash, but how to filter them by date?                   $options = array(             'post_status' => 'trash',             'post_type'   => 'post',             'nopaging'    => TRUE         );              $wp_query = new WP_Query();         $posts    = $wp_query->query( $options );


title: 3 Step registration Process in Wordpress

text: I Developed my site with wordpress 3.9.2 and now i want to Implement User Sign up and profile in my website. I would like to create a 3 step registration. For example: I would like to set up a registration process in 3 different steps: (i) user fillups the account info with username, password, email address, (ii) in second step user select their account type, fill some field based on account type (iii) define your personal profile, i googling this topic but not find any solution, Does anyone know how to do that in wordpress?, Thank you all…


title: Determing number the query ran by core wordpress

text: I wanted to find out, how many queries does wordpress core run, and how many queries the theme run. Is there any way to get they number of both of them separately ? As i run               `echo get_num_queries();     queries in     timer_stop(1);`      It gives me total of queries, but i want to have the number separate, of how many does theme run, and wordpress core alone.


title: Change password from admin panel

text: while updating password from admin panel of wordpress dashboard, I am facing this unique issue. when I am typing password which is very weak, and updating it. I am getting message, profile updated successfully. But when I am trying to log into my ID using new password, I am not able to do it, its still accepting old password. How can I make wordpress accept weak password.


title: How to make previous versions available for users?

text: I am new to using subversion, trac and do not clearly understand how the wordpress plugin repository works. When committing WP Responder I put all the files in a directory called "trunk" and committed it to the server. It worked. It may be useful to make previous versions of the plugin available for download. So I copied all the files from a previous version (4.9) as well as the current version (4.9.5.1) and placed it in the "tags" directory of the repository. So tags had two directories: 4.9 and 4.9.5.1. The 4.9.5.1 had the same content as the trunk directory. When I did this the downloadable archive had only the php files directly under the trunk directory and not the sub directories that are part of plugin. So I had to removed all the directories within the tags directory to restore it to the previous state. What am I doing wrong? How can I make previous versions available for download?


title: WPML Plugin Not displaying multilingual Menus

text: I'm using WordPress 3.0 Menus, which the WPML (wordpress multilingual) plugin claims to have added support for in a recent release. I am using the most current version of the plugin. My problem is that using the following to call my nav menus               <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'menu-header', 'menu_id' => 'menu-primary-navigation' ) ); ?>      is pulling up only the English translation of the menu. Here is an image of the WPML admin panel and how the menus are setup multilingual: [link to image] http://cl.ly/42RW [link to image] http://cl.ly/42o0 You can see the site currently in development: http://anasmadance.com.s66112.gridserver.com/ The problem is that when you go to the French translated page, the menu is still in English (despite the fact that I've already set up the French menu) http://anasmadance.com.s66112.gridserver.com/fr/


title: Plugin that inserts favicon next to links

text: I, like many others, have numerous links all over my website. Some are in the body, some are in the sidebars, some are in comments. When links go to an external site, I would very much like to have that website's favicon appear to the left of the link. I have seen this in many places. E.g a link to Wikipedia page, should have that wikipedia favicon. The plugin File Icons appears to do that, but for file types (you link to a PDF, you get a PDF icon). But the question is, how do you do this for general types of links? You could add URLS to the File Icons plugin by hand, but that is a pain, and I have heard of Google's S2 which should find most fav icons automatically. So my question is; is there a plugin that will auto find any links on a post/page/etc. and insert the URL's fav icon to the left of the text?


title: syntax highlighting for theme-editor.php?

text: Is there any syntax highlighter for wordpress. This is not to post code snippets on posts but for the backend/theme editor of wordpress. If not do you think it will be implemented in sometime future?


title: Authors posts on a author created page

text: Any suggestions/ideas on how to get posts made by certain author to be displayed on a page that same author has created without using author.php? To clear this up a bit, I have a site where author can create one page and multiple posts. Using normal author archives/pages do not offer the flexibility I need, so I'm looking for a way to have the authors' posts to be displayed on a page the author have created. So "Matthew" creates a page named "Matthew" and every post he has made will be shown there. Everybody should be able to see the page as well. Hopefully I made at least some sense with this.


title: Custom Taxonomy Navigation, with current menu items for children?

text: Is it possible to have a custom taxonomy navigation, with added active/current-menu classes if the post your on is within that category/custom tax? e.g you have a custom taxonomy called... Weather. Within that you have Sunny,Windy, Raining. Whenever you appear on a Sunny page, whether its the archive of the custom taxonomy, or a single.php or most importantly a child post of a post in the sunny page, the Sunny button is highlighted? Is the only way to manually list then categories then apply if in echo active? I tried added a custom menu and adding via the admin, but it just had the usual menu item, it didn’t indicate have children or anything. Unsure if this is possible at all.


title: Random Image Script Working but Want to Avoid Duplicates

text: I'm using the following to display random images:               <?php $new_query = new WP_Query('&showposts=24'); ?>              <?php while ($new_query->have_posts()) : $new_query->the_post(); ?>              <?php $args = array (                 'post_type' => 'attachment',                 'numberposts' => 1,                 'orderby' => rand,                 'status' => 'publish',                 'post_mime_type' => 'image',                 'parent' => $post->ID              ); ?>              <?php $attachments = get_posts($args);                 if ($attachments) {                     foreach ($attachments as $attachment) {                         echo '<li>';                         echo wp_get_attachment_link($attachment->ID, 'thumbnail', true, '');                         echo '</li>';                     }                 };                      endwhile;      But I'm trying to avoid duplicates. Any ideas? Thanks!


title: saving custom post type data to different table in wordpress

text: As the title says, is there any option to save the data in different table in wordpress. I have around 10000+ data in my site in a different table. I have moved this table inside wordpress database and i have created custom post and now I want to show the data from my own table not from wp_posts. Any ideas, suggestion or example.


title: my excerpts lack the 'more' link

text: on a site am writing, on the home page i want to achieve the following   * Posts should appear as excerpts with links to full article   * Editors should have the power to explicitly control excerpt length I tried the following solution:   * create template file called home.php   * use the_excerpt() in the loop The problem   'read more' link is missing if user specifies explicit 'more' `<!--more-->` when creating a post but strangely if explicit 'more' is not specified in post, the link to full article is available. What the hell is going on? ![enter image description here](http://i.stack.imgur.com/zxEWa.jpg)![enter image description here](http://i.stack.imgur.com/cGPVZ.jpg)![enter image description here](http://i.stack.imgur.com/tUwuA.jpg)


title: Any good desktop client for wordpress with support for google syntax highliter?

text: I'm using Google Syntax Highlighter for WordPress and I have to go to the html view where I have to manually type the tags for pasting code and formatting gets messed up when I switch back to the WYSIWYG view. Is there a desktop client like windows live writer that has support for Google Syntax Highlighter and allows us to paste code and format the post in the same view?


title: Settings API no update status? (refering to the yellow bar when you save settings)

text: I just created some settings for my theme ... not perfect, still learning ... http://pastie.org/1988772 I am expecting the "Settings Saved" yellow box ![](http://i.stack.imgur.com/f3tTa.png) Do I need to do something on my part?


title: update = remove code

text: i updated my wordpress in 3.1 (i'm using twenty ten) and some of my code has been deleted, i'd like to understand it : is it only because i'm using the "twenty theme", that the "code" was replaced with the new version? does a "new version" remove also the code if i use my own theme? and so : to have a code safe, the "plugin" folder is the only safe area? I'd like to be confident the next time i update my version of wordpress. Thanks


title: Confirmation before deleting plugin options via uninstall.php

text: I'm creating a WordPress plugin and have the uninstall.php file ready. It deletes the options used by the plugin on deletion. What I'd like to do is to popup a dialog box asking whether to delete or keep these options when the user decides to delete the plugin. How can I do this?               <?php     // If uninstall not called from WordPress exit     if( !defined( 'WP_UNINSTALL_PLUGIN' ) )     exit ();     // Delete option from options table     delete_option( 'my_options' );     //     ?>


title: Using wp_trim_excerpt to get the_excerpt() outside the loop

text: I'm building a theme that is going to show excerpts on the homepage for potentially dozens of posts. I don't have manual excerpts on all of my posts, so `$post->post_excerpt` is empty for many posts. In the event that there isn't a manual excerpt, I would like to use the built-in get_the_excerpt() function, but it isn't available outside the loop. Tracking down the function, it looks like it uses wp_trim_excerpt from wp- includes/formatting.php to create excerpts on the fly. I am calling it in my code like `wp_trim_excerpt( $item->post_content )`, but it is simply returning the full content. Am I doing something wrong? I know that I can create my own function to create an excerpt, but I like to use built-in functions where possible, keeping my code compatible with other potential plugins / filters. http://adambrown.info/p/wp_hooks/hook/wp_trim_excerpt?version=3.0&file=wp- includes/formatting.php


title: Change Posts per page count

text: In the wordpress **settings** => **Reading** => **Blog pages show at most** [input field] **posts** I have it set to 3 posts at the moment. On my index, date archives, tag archives, category archives, search results, etc... All pages that use the loop and paging, it shows 3 posts per page now. My goal is to be able to have different number of results for different pages. ON my index maybe have 3 posts but on search results or archives, show a different number of results per page. Any ideas how to do this?


title: WYSIWYG clear:both

text: How to clear floats in WYSIWYG editor? Not everyone know how to add `<div style="clear:both>"` in HTML mode. Is there any way to add extra button to WYSIWYG or plugin. TineMCE doesn't have that option.


title: How to Hard Code Custom menu items

text:
Is there any way that i can hard code the custom menu items when first theme installed? I am creating a theme which will automatically make some common pages when installed. So I need to know if I can also add them to Wordpress custom menu so client don't need to add them manually? In other words: how to insert/create custom menu item programmatically? Let me know if anything unclear. Guide to the appropriate codex page is welcome. Thanks! * * * **update:** tried code from here Targeting specific menu with wp_nav_menu_items **Menu registration:**               function register_my_menus() {       register_nav_menus(         array('main-menu' => __( 'Main Menu' ) )       );     }          add_action( 'init', 'register_my_menus' );      **Template use:**               <?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>      **Code for adding new items:**               function new_nav_menu_items($items) {         if( $args->theme_location == 'main-menu' ){         $homelink = '
' . __('Home') . '
';         $items = $homelink . $items;         return $items;         }     }     add_filter( 'wp_nav_menu_items', 'new_nav_menu_items', 10, 2 );      when adding the code for adding new items in nav menu in `functions.php` file nothings happens in menu page in admin panel but the current menu items are gone in site!


title: Does the switch_theme action run when you're upgrading a theme?

text: Did anyone test if this action is being executed on theme upgrade? Are there any other actions I could use to attach a theme uninstall function?


title: Wordpress for a club website -- Members page

text: I'm making a website for a student activity and have a wordpress page for each member under a common parent group. Each page contains some member info (currently unstructured) and a profile picture. I would like to list all these members under a member page with perhaps a grid of profile pictures and names. Is there a plugin that can accomplish this? Note that each member does not have a wordpress account. I already found plugins that can do that, but it's not what I am looking for.


title: how do you create an admin interface in plugin for your theme

text: I'm creating a theme that would need some settings on the client side. So I need a admin interface where they can set some values. (like, source of image, title, or numbers) so in my theme, I can just set some variables like `<img src="IMAGE_SOURCE" title="TITLE" size="NUMBER" />` If you can point me to a tutorial that would be great. Thanks!


title: How to delete post attachments when jQuery is used with a click event on the delete link

text: I think I'm on the right track with what I need to do, at least for doing one of the ways it could be done. I'm not really sure though, I could be way off for all I know. This is part of the code I needed help with last night for resizing the uploaded image files, but now I am trying to figure out how to use the wp_delete_attachment($id) function to delete images attached to the posts. So, I have this jQuery script that adds/ removes extra fields, for uploading more images to attach. For every added image there is a link to remove them. Clicking remove has only ever just remove the div which the link clicked was contained by, and when saving the post the attached file would show up as still attached. In my click event handler for the remove link, I need to first run function that will call the wp_delete_attachment(), to permanently delete the file/attachment, THEN I can use jQuery to remove the div of that attachment from the page. That way when saving the post it will have been deleted and not show up again still. Here's my functions I've been trying to work with:               // a function that returns the delete attachment php function,      // and a message saying Deleted that fades in and out.         jQuery(function() {             function delete_att( attID ) {                 var div = jQuery('#img_uploads'),                     msg = $('div').html('Attachment Deleted!').fadeIn().delay(200).fadeOut().appendTo('div');                 return '<?php wp_delete_attachment( ' + attID + ', true ); ?>', msg;             }      And the click handler which calls this function and then removes the containing div element from the page is:                   jQuery('.remImage').live('click', function() {              if( size > 1 ) {                 var postID = jQuery('#attID').val()                 delete_att( postID );                      //jQuery(this).parents('.attchmt').find('#attID');                 jQuery(this).parents('.attchmt').detach();                 size--;             }              return false;          });     });      The code to add extra fields is between these two parts but these are the key pieces for what I need help with. Currently, the way I have it coded here I am getting this error message. idk wtf this means exactly though lol.               Error: uncaught exception: [Exception... "Node cannot be inserted at the specified point in the hierarchy"  code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)"  location: "http://code.jquery.com/jquery-1.4.4.min.js Line: 113"]      So here is the full code which I am using, exactly. https://gist.github.com/802465 Just trying to pass info to/from jQuery and Php and that's always a pain in the ass, (for me).


title: Echo current custom post type

text: I have a all my custom post types list together in blog format. What I'm trying to do is echo the post type name on each post. I tried this:               get_post_type_object('post');     echo $obj->labels->singular_name;      But it just displayed "Post" for everything instead of the custom post type name


title: Add "external" link to admin menu in the backend

text: Trying to add a link to my admin menu (dashboard/backend) that leads to the frontend of wordpress, so I basically want a link in the menu that takes me to the blog. I've found a couple of ways to add new stuff to the admin menu, but I haven't been able to link to the home_url, it seems like the admin menu only is designed to let you link to stuff within the wp-admin. Anyone that have succeeded with this? Edit:   Tried with this: https://gist.github.com/792b7aa5b695d1092520               add_admin_menu_item('Overview',array(            'title' => 'View Site',           'slug' => get_bloginfo('url')       ));      Which gives me the link hxxp://myurl.com/myurl.com   With this plugin (hxxp://wordpress.org/extend/plugins/admin-menu-editor/), I get:   hxxp://myurl.com/wp-admin/www.test.com


title: Problem with context in multisite - getting main site data in every blog (get_pages())

text: I'm working on a multisite, everything is configured and works fine from dashboard. Now I'm trying to write a plugin with a PHP file that displays the list of pages created in a site - to be displayed to the admin of the site who logs in. Here is the code (simplified)               <?php     require('../../../wp-load.php');     ?>     (some HTML)     <?php             $pages = get_pages();                                                foreach ( $pages as $page ) {             echo $page->post_title . '<br>'     ?>      My plugin PHP file uses `login_redirect` filter to redirect user after login to that PHP file where I am trying to display the list of pages the user created:               function my_login_redirect( $redirect_to, $request ) {          return '/wp-content/plugins/my-admin-plugin/my-admin-view-all-pages.php';      }      THE PROBLEM - no matter which site I'm in, I get the list of pages created in the "main" site. How do I pass the context of the existing site to the functions?


title: How to keep a record of changes to a custom field?

text: I have a custom post type that hold real estate listings and I need to figure out a way to keep a record of the price of the property is listed for. For example a user lists a property for sale and then the user edits the property listing and changes the price. I need to show the price before and the new price and the date the price was changed. The price value is stored in a custom field. Doe anyone have any idea of how I can begin to tackle this issue. I basically need to keep a record of a posts custom field and the date it was changed. If i can get an idea of how to code this I can post the code here for anyone who might find this useful. Thanks


title: Send POST request to Wordpress to make a new post

text: I want to make new posts on my Wordpress blog using HTTP POST sent to `post.php`. I was searching for the parameters I should pass but i didn't find any useful information yet. Can anyone give me a reference to the parameters I should send?


title: Need to hide an element depending on date and post category

text: I've been racking my brains for a few days trying to figure this out. I'm using WP Voting on my site. I need to create a script in single.php that will remove the div that contains the voting widget depending on the date and the post category. For instance: If the month is September and the category IS NOT 13, remove div Else If the month is October and the category IS NOT 14, remove div. I tried this first with JavaScript which worked with the date, but not category, and then php, but I can't seem to get it right. Can anyone help? Please? Thanks Ettan


title: Limit one submission from each user using Contact Form 7?

text: I am using Contact Form 7 along with the add-on Contact Form 7 Dynamic Text Extension to pre-populate usernames and emails. I know this may be sort of a strange request but I want to be able to limit the number of submissions to one for each user only for one of my forms. Basically, it's a submission form for a contest and I don't want users to be able to submit over and over again. Is something like this possible with this plugin?


title: Define multisite is not working

text: I put the define( 'WP_ALLOW_MULTISITE',true ); in the wp-config but the network tab never shows up. I read some comments on the internet, and tried only MULTISITE, true, even WP_ENABLE_MULTISITE, but nothing works The network tab never shows up. running wordpress 3.9.2 Please help


title: List all Wordpress key words

text: I have a page               http://bhaa.ie/realex-ipn.php      that returns normally when called with GET but is throwing a 404 when it is called via a POST request               curl -i -X POST http://bhaa.ie/realex-ipn.php      I'm trying to understand what is causing the issue. I've disabled the various plugins i have installed and the issue is still there. I know that using key works as http parameter names can causes issues and that the list of wordpress reserved keywords is here. I think it might be the case that one of my plugins has registered its own keyword and this is causing this 404 issue. Is there a way to list all the keywords that wordpress and the installed plugins have registered?


title: Problems with custom post_type and custom taxonomy

text:
I'm trying to make a simple plugin that let's me create blogposts from a custom post_type (tutorials), with it's own custom taxonomies. I got this working. There are 2 problems though. 1: I also created a widget which works almost the same as the category widget provided by WordPress. It displays the categories from my custom taxonomy (tutorials). It also shows the post count per category. Just like the default category widget for regular posts. But, when I click on one of the categories, I get a 'Not Found' page, instead of an overview of my tutorials within that category. The url of this page is 'example.com/tutorials/category'. I already tried to make a custom template called 'taxonomy-tutorials.php', which is a copy of the 'archive.php', but this didn't work. 2: The tutorials (custom post_type) should have the url 'example.com/tutorials/category/blogpost'. But I have no idea how to set this correctly. Right now the url is 'example.com/tutorials/blogpost'. The permalink structure is set to '/%category%/%postname%'. Regular blogposts for example are 'example.com/category/blogpost'. And my custom blogposts should be 'example.com/tutorials/category/blogpost'. Here is the PHP code that registers the custom post_type, the custom taxonomy, and the widget.               /* Function to register the custom post type */     function create_tutorials_posttype() {         register_post_type( 'tutorials', array(                 'labels' => array(                     'name' => __( 'Tutorials' ),                     'singular_name' => __( 'Tutorials' )                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array( 'slug' => 'tutorials' )             )         );     }          /* Function to register the custom taxonomy */     function create_tutorials_taxonomy() {         register_taxonomy( 'tutorials', 'tutorials', array(             'hierarchical' => true,             'public' => true,             'show_ui' => true,             'show_admin_column' => true,             'rewrite' => array( 'slug' => 'tutorials' )         ) );     }          /* Widget (within a widget class ofcourse) */     public function widget( $args, $instance ) {         // outputs the content of the widget         $title = apply_filters( 'widget_title', $instance['title'] );              echo $args['before_widget'];         if ( ! empty( $title ) ) {             echo $args['before_title'] . $title . $args['after_title'];         }              $terms = get_terms( 'tutorials', 'orderby=name&hide_empty=1' );         echo '
';         foreach ($terms as $term) {             $link = get_term_link( $term, 'tutorials' );             echo '
'.$term->name.' ('.$term->count.')
';         }         echo '
';         echo $args['after_widget'];     }      I hope someone can help me with this. It's getting a little frustrating


title: get_terms() doesn't return empty terms even though hide_empty is false

text: I can't manage to make `get_terms()` to return the empty terms and I've tried it in a number of ways. Here's the code:               $terms = get_terms('device',array('hide_empty' => 0));     foreach($terms as $term) {             if($term->parent == 0) {                 if($i++ != 0) echo '</optgroup>'; echo '<optgroup label="'.$term->name.'">';                 $id = $term->term_id;                 $args = array("child_of"=>$id);                 $this_term = get_terms('device',$args);                 foreach($this_term as $the_term) {                      $term_name = str_replace($term->name,'',$the_term->name);                     echo '<option value="'.$the_term->term_id.'">'.$the_term->name.'</option>';                 }             }         }      I've tried all the possible ways:               $terms = get_terms('device',array('hide_empty' => false))     $terms = get_terms('device',array('hide_empty' => 0))     $terms = get_terms('device',array('hide_empty=false'))     $terms = get_terms('device',array('hide_empty=0'))      Also tried the last two ways without `array`. Nothing seems to be working. It returns all the terms that have posts, but no empty one.


title: How to check for empty and not a failure

text: I'm querying the postmeta table to see if a url has already been entered, using this statement (where $thisLink is the url I'm checking)                 $mypostids = $wpdb->get_results("select * from $wpdb->postmeta where meta_key = 'rssmi_source_link' and meta_value like '%".$thisLink."%'");      The problem is that on some servers it appears it's not finding urls that already exist in the database, and I'm becoming convinced that this may be due to the server failing on the query or something like that. Anyway, I'm not sure how to check for both the url already exist (thus don't process anymore) or there was some sort of failure in completing the query). right now, I just use:               if (empty( $mypostids )){ do stuff}      is there a way I could make the condition like if empty AND if not a failure then do stuff?


title: Removing Unnecessary Text from Admin Menu without CSS

text: I am looking for a way to remove all the unessesary text from default worpdress metaboxes. Preferably I would like to ensure that the content is not just hidden through CSS but actually removed from the HTML so it does not even show up in the source. The areas I am interested in removing include:   1. The HELP button on the top right and associating DIV/HTML/text when you click on it   2. On the Dashboard in the Right Now Metabox I want to remove the text related to which theme is being used and the version of wordpress as well as the change theme button.   3. On the "Page Attributes" metabox on the bottom it has the text "Need help? Use the Help tab in the upper right of your screen." I would like for this text to be removed   4. Under the "Excerpt Metabox" there is text which I would like to remove   5. Any other text which you might also know how to remove to cleanup wordpress.


title: Save an array from drop-down in custom meta box

text: I have successfully pulled a custom post type through into a drop-down that is in a custom meta box. However, when displaying it on the front end I would like to also provide a link to the actual post, not just the name of the post. So I am guessing I need to save this as an array? Is this possible through a drop-down? Confused on how I should approach this. Any help is greatly appreciated. Here is what I have so far:               // Add Meta Box To Select Overseeing Pastor     add_action('admin_init', 'ministry_select_add_meta');     function ministry_select_add_meta(){         add_meta_box('ministry_select_post', __('Overseeing Pastor'), 'ministry_select_meta', 'ministry', 'side');     }          function ministry_select_meta( $post ) {         $values = get_post_custom( $post->ID );         $selected = isset( $values['pastor_select'] ) ? esc_attr( $values['pastor_select'][0] ) : '';         wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );         ?>             <select name="pastor_select">                 <?php                 $args = array(                     'post_type' => 'employee',                     'position' => 'pastor'                 );                 $pastorList = new WP_Query($args); while ($pastorList->have_posts()) : $pastorList->the_post();                     $is_selected = (get_the_title() == $selected) ? 'selected="selected"' : '';                     echo '<option value="'.get_the_title().'" '.$is_selected.'>'.get_the_title().'</option>';                 endwhile; wp_reset_postdata();                 ?>             </select>         <?php        }          add_action( 'save_post', 'ministry_select_save' );     function ministry_select_save( $post_id )     {         // Stop If Autosaving         if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;              // Stop If Nonce Can't Be Verified         if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;              // Stop If Unauthorized User         if( !current_user_can( 'edit_post' ) ) return;              // Make Sure Data Is Set Then Save               if( isset( $_POST['pastor_select'] ) )             update_post_meta( $post_id, 'pastor_select', esc_attr( $_POST['pastor_select'] ) );     }


title: List Wordpress.org Blog on Wordpress.com

text: I have a self-hosted blog at `www.MyPersonalSite.com/blog` that runs on the Wordpress.org platform. My buddy has a blog at `www.HisName.wordpress.com`. He seems to get a lot more traffic to his blog. My inclination is that when he makes a post, it submits it to some central Wordpress blogroll. Is this right? **Question:** Is there a way for me to list my blog such that it gets more exposure and people can search for it through Wordpress.com and subscribe to my posts?


title: Editing registration page labels through .mo and .po files

text: I'm attempting to change the wording of Buddypress's registration page (see below) so that the "Username" heading is displayed as something else. ![registration page](http://i.stack.imgur.com/rpn1v.png) I found this documented here on Buddypress's website, in which I am directed to   1. Create a copy of the .po language file in `/plugins/buddypress/bp-languages`   2. edit the wording in that copy   3. Use the edited version to create a .mo   4. Move both the .mo and edited .po to the `wp-content/languages/` directory (which I had to create). I followed the above steps but no change was made to the page. Can anyone see a step that I might be leaving out? Or might this process be obsolete? Thanks for any thoughts!


title: Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy

text: I've (I think) an interesting problem here. What I want to do is create a global archive page, with everything on it. Dates, authors, categories etc all on one page. I have a child theme, with TwentyTwelve as the parent. Inside TwentyTwelve there exists archive.php, category.php, tag.php, author.php etc., basically all faceted archive templates split up individually. In my child theme what I want to do is to create an archive.php template, and have that overwrite all of the parents templates. I understand creating archive.php in the child will overwrite the parents archive.php, but before it checks for archive.php it will check for category.php, and use that template from TwentyTwelve before hitting archive.php in my child theme. Same for all other templates as per the template hierarchy. I know of at least 2 ways to fix this:   1. Delete category.php, tag.php etc from TwentyTwelve. (Not the best, as any update will restore those files)   2. Re-create tag.php, category.php, etc in my child theme and copy/paste my layout for each one into each template file. (Better, but lots of template files just makes for a messy directory.) I'm wondering if there is something I could drop in functions.php to overwrite the hierarchy, and force WP to use my child archive.php for all archive pages. Ideas? Regards, Dave


title: How to make blog posts have their own urls?

text: When I post a blog post, the blog post doesn't appear with a separate url -- it just appears under http://richardclunan.com/blog and there's no button to edit the url when I'm on the Edit Post page. How do i make blog posts have their own urls?


title: W3 total cach and theme changes

text: i have read that i have to weight with w3 total cache until my blog design is complete. But to be honest, it will never be finished. I'm constantly developing new stuff. How will this affect my site if i chose to use w3 total cache? Can i reset the cache every time i make changes to the theme? and how does this plug in deal with comments? Hope some one have a simple answer for me :)


title: How Do I Order Posts by Modified Date?

text: I've read the codex article about `WP_Query`'s `orderby` parameters and I understood that it is possible to order by Modified date. But I couldn't find where should I edit. How WordPress post order by modified date including home page as well as categories page and tag pages?


title: How to translate get_intermediate_image_sizes?

text: I use the following code to get image sizes:               public function getImageSizes(){             global $_wp_additional_image_sizes;             $sizes = array();             foreach(get_intermediate_image_sizes() as $s){                 $sizes[$s] = array(0, 0);                 if( in_array( $s, array( 'thumbnail', 'medium', 'large' ) ) ){                     $sizes[$s][0] = get_option( $s . '_size_w' );                     $sizes[$s][1] = get_option( $s . '_size_h' );                 } else {                     if ( isset( $_wp_additional_image_sizes ) && isset( $_wp_additional_image_sizes[ $s ] ) )                         $sizes[$s] = array( $_wp_additional_image_sizes[$s]['width'], $_wp_additional_image_sizes[$s]['height'] );                 }             }             return $sizes;         }      The result is a select with image sizes, something like this:               <option value="thumbnail">Thumbnail</option>     <option value="medium">Medium</option>     <option value="large">Large</option>     <option value="tribe_image_widget_custom" selected='selected'>Custom</option>      The question is how to translate sizes (Thumbnail, Medium, Large and Custom)? By default the sizes are in English, I need them to be another language (I use CodeStyling Localization plugin for it). Thank you! P.S.: to biuld a select I use this code:               <select class="widefat" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">         <?php foreach ($this->getImageSizes() as $name => $atts): ?>             <option value="<?php echo $name ?>"<?php echo ($name==$size?' selected':'') ?>><?php echo ucwords($name) . ' ('. implode( 'x', $atts ). ')' ?></option>         <?php endforeach ?>     </select>


title: What's the correct way to include files in Wordpress TwentyTen theme with it's own jquery scripts and css?

text: I want to include a slider in the default Wordpress theme on the home page. I did manage to get the page to show using `<?php if ( is_home() ) { include ('slider.php'); } ?>` but it doesn't look like it's loading the jquery script it needs or the style sheet. I know there's a conflict with scripts and Wordpress, I just don't know how to get it to work. Sample page is at http://axiomwest.com/ How do you feed in a page with it's own style sheet and scripts?


title: How to dynamically build a multiple taxonomy query loop within a post type's single loop?

text: This question is a little different then the others floating around here. The most similar one is "How to get the parent's taxonomy ?". I have a music cms setup that utilizes two post types: _album_ and _album media_ and a few taxonomies: _genre_ , _year_ , and _artist_. In the footer of every _single-album.php_ post I want to display the corresponding _album media_ template and do this dynamically. There is only one _album media_ post for every one _album_. Both post types are associated with the three taxonomies. How can I write a loop inside another loop that automatically/dynamically obtains the associated taxonomies of it's parent post type? For example: An _album_ called "Dark Side of the Moon" is associated with taxonomies rock, 1973, and Pink Floyd. The _album media_ "Dark Side of the Moon" is associated with the same taxonomies. Within the main loop in _single-album.php_ is another loop that looks for what three taxonomies the _album_ is associated with and constructs a loop for "album-media". The contents of this loop could also be displayed as _single- albummedia.php_. Can this be done? I have the feeling that I am over-thinking this :) Things this question involves:   * multiple taxonomy query   * loop within a loop   * custom taxonomies and post types


title: wordpress query - orderby child post date

text: I have support ticket system which i have built using wordpress. The basic functionality is that when a "ticket" is created, it creates a post. When an admin replies, it then add a child post to the original post. My question is how can i order my posts by the child post_date is ASC order? My query args at the moment are:               $args = array(       'post_type' => 'support_tickets',       'numberposts' => -1,       'post_parent' => 0,       'orderby' => 'date',       'order' => 'DESC'  );      This only obviously orders the parent post's in ASC by date. Is what i require achievable?


title: custom fields for attachments?

text: is it possible to add extra fields via the functions.php script for attachments in wordpress? Tried loads of examples but none seem to work. Worried an existing plugin might be affecting my attempts but its not clear if its even possible. best, dan.


title: Get Next / Prev 3 Posts in Relation to Current Post

text: I have 7 posts, like this: 1   2   3   4 - this is the current post   5   6   7   As noted, number four is the current post being displayed. I need to create a query that will allow me to display the previous 3 posts (by publication date) and also the three posts after. This can be done with two separate queries. I've been able to display the immediately previous or next post, just not the ones further down / up. Any ideas?


title: Create html from function

text:
I have a simple html structure like this.
              <a href="<?php echo get_permalink($post->ID); ?>">
                 <?php                          $attachments = get_children(array(                         'post_type' => 'attachment',                         'post_mime_type' => 'image',                         'post_parent' => $post->ID                     ));                          if(count($attachments) > 0) {                         echo '';                     }                      ?>

<?php echo the_title(); ?>

by
                  <?php echo the_excerpt(); ?>
      I'm using this on a number of pages so I want to add it to functions.php and call the function on the page. How do I add this as a function to generate this structure. I tried this.               function ideas(id){       echo '
';       echo '';          echo '
';            $attachments = get_children(array(         'post_type' => 'attachment',         'post_mime_type' => 'image',         'post_parent' => $post->ID       ));            if(count($attachments) > 0) {         echo '';       }            echo '
';       echo '
'.the_title(); .'
';            echo '
by
';            echo the_excerpt();            echo '';       echo '
';          }      and in the page               if(function_exists('idea')){       idea();     }


title: Changing interface language without multisite

text: I want to change the Theme's interface language without making multisite by passing langauage parameter into the URL.               <a href="<?php echo home_url('/')?lang=bn ?>">Bengali      My thought is to use the following code:               get_query_var('bn') {              /**          * CHANGE THE 'WPLANG' IN wp-config.php TO bn_BD ON THEME SWITCHING          * Thanks: toscho          * Source: http://wordpress.stackexchange.com/a/121136/22728          * -------------------------------------------------- */              add_filter( 'locale', 'toscho_change_language' );              function toscho_change_language( $locale ) {             return 'bn_BD';         }          }      With checking `isset()` of the parameter in URL, loading of this code block. And using the theme's language file `bn_BD`. But I'm actually curious about the logical proceedings:   * Is this concept Ok?   * Will it load the theme's language file successfully?


title: posting twice from an array?

text: I dynamically create iterations of a form field with jquery, but they all carry the name extrakosten[] for the first variable and the other variable vergoeding[]. The php:               $postTitle = ''; // save post title          if(isset(   $_POST['submit']    )){             // if submit button is present              for ($i=0; $i < count($_POST['vergoeding']); $i++) {                  $new_post = array(                 'post_title'    =>  $postTitle,                 'post_content'  =>  ' ',                        // can not be empty                 'post_status'   =>  'publish',                           'post_type'     =>  'landschapselement'         // custom post type             );             $pid = wp_insert_post($new_post);                   // insert the post                  wp_set_post_terms( $pid, $_POST['extrakosten'],'kostenpost',false);             wp_set_post_terms( $pid, $_POST['vergoeding'],'vergoedingaanleg',false);          } // close for loop          }      What happens now, is that when I click the submit button, a new post under custom post type 'landschapspakket' is made. The values under vergoeding and kostenpost are being posted in the custom taxonomy 'vergoedingaanleg' and 'kostenpost'. What it does now, is create ONE post with TWO values for 'kostenpost' and 'vergoeding'. What I try to achieve is to create TWO posts, each with ONE value for both 'kostenpost' and 'vergoeding'. I think something might be wrong with the array. I'm new to arrays. Any suggestions? Thanks for the help


title: wp_mail is sending two emails when used after retrieving session data

text: I'm using the wp_mail function to send emails in WordPress. Before I run the function, I retrieve a heap of data from a session and some others from a form that was just submitted. For example:               $first_name = $_SESSION['first_name'];     $last_name = $_SESSION['last_name'];     $phone_number = $_POST['phone_number'];     $message = $first_name . $last_name . $phone_number;     wp_mail($myemail,"Email sent",$message);      I'm using the plugin called WP-MAIL SMTP to send via Gmail's SMTP servers. When I disable this, no emails are sent at all. For some reason, I receive two emails. One has the POST AND SESSION information and the other only has the SESSION information. Any help would be greatly appreciated! Thanks in advance, Jamie I'm using WordPress 3.3


title: Comment Pagination

text:
I am hoping someone can help me with comments pagination. I have the pagination working and the links point to the next page etc, but when clicking the page just refreshes. Here is my code so far and hoping someone can help me.               $pid = $post->ID;        $comment_query = "SELECT * FROM `wp_comments` WHERE comment_post_ID = ".$pid. " AND comment_approved = '1'";     $comments_array = $wpdb->get_results($comment_query, OBJECT);          if ($comments_array):                                                      $cpp = 10; // Comments per page                                                      $wp_query->comments = count($comments_array);                                                      //echo $wp_query->found_posts;                                                      $wp_query->max_num_pages = ceil($wp_query->comments / $cpp);                                                      $on_page = intval(get_query_var('paged'));                                                      if($on_page == 0){ $on_page = 1; }                                                       $offset = ($on_page-1) * $cpp;                                                      $wp_query->request = "                                                     SELECT * FROM `wp_comments` WHERE comment_post_ID = ".$pid. " AND comment_approved = '1'                                                                                LIMIT $cpp                                                     OFFSET $offset                                                         ";                                                     $newcomments = $wpdb->get_results($wp_query->request, OBJECT);     ?>
         <?php if ($newcomments) : ?>
<?php _(comments_number('No Comments','1 Comment','% Comments')); ?>

                 <?php                           foreach ($newcomments as $comment) :      full code: http://pastebin.com/md3zdpbd Thanks


title: Overriding the currently selected menu item

text: I have a WP 3.x site that I'm using mainly as a CMS. The menu links to the various WordPress pages. One of the pages, "News", is the "posts" page. However, when clicking on one of the posts on the News page, the "News" item in the menu loses highlighting because the post isn't treated as a child of "news". Is there an easy way to override the currently highlighted item in the menu? Ideally by forcing a page ID upon it.


title: Incorporating a meta query into a mysql query in wordpress

text: I'm trying to find a way of inserting a meta condition into this bit of SQL below...               $query = "SELECT COUNT( ID ) as num_events " .                  "FROM $wpdb->posts " .                  "WHERE post_type = '" . AI1EC_POST_TYPE . "' AND " .                  "post_status = 'publish'";      I know this first bit works but I wanted to add to it the condition that the **meta_key** called **private** isn't **true** which is stored as `a:1:{i:0;s:4:"true";}` thanks to Advanced Custom Fields I haven't written any MySQL myself so my first attempt came out like this:                           $query = "SELECT COUNT( ID ) as num_events " .                  "FROM $wpdb->posts " .                  "WHERE post_type = '" . AI1EC_POST_TYPE . "' AND " .                  "post_status = 'publish' " .                  "AND WHERE meta.meta_key ='private' " .                  "AND meta.meta_value != 'a:1:{i:0;s:4:"true";}'";      But then I get a `PHP Parse error: syntax error, unexpected 'true' (T_STRING)` because of the "true" in the longtext value of the meta. Then changing to `"AND meta.meta_value != 'a:1:{i:0;s:4:\"true\";}'";` on the last line means that no results are omitted - is it because it's searching for `\"true\"` now instead?? Have also tried with `"AND meta.meta_value IS NULL "` \- as would achieve roughly the same. No Joy I am not hugely familiar with SQL queries so I could be doing something completely wrong - if anyone can spot anything I would be hugely appreciative.


title: Comments not enabled for custom post types

text: I don't get this at all. I've looked online and I think I did everything I was supposed to, but my custom post type does not display a comments form. In functions.php. where I define the post type I have: `'supports' => array('title','editor','thumbnail', 'excerpt', 'comments'),` ( **note:** the 'comments' string wasn't there when the posts where made, I added it just now trying to fix this) In the `single-mytype.php` I added `<?php comments_template('comments.php'); ?>` to the loop. note: before I added the filename, I got nothing but now I get a "comments are closed" slug. If I edit the post, I see "enable comments" and "enable trackbacks" are unchecked, but if I check them they won't stay checked. If I check "enable comments" and add a comment to the admin form, that comment _will_ be displayed... but no form for other comments. What am I missing here?


title: 2 wordpress site same database

text: I have twoo websites on worpdress platform:   * http://fian.ro/   * http://nuovafattoria.ro/ On the server there are 2 different folders with same files, same config but one of them has:               define('WP_HOME',    'http://nuovafattoria.ro/');     define('WP_SITEURL', 'http://nuovafattoria.ro/');      so is the same database but different url. I wanna made some changes on one of them, different logo, background so I need a second options table but the others to remain same for both websites. How can I have different logo, background and settings on the second website?


title: Custom Post Type order Title ASC

text:
I´d like to display all car manufacturer in order by title (e.g. "Merecedes") and order from lowest to highest values (e.g. "A-Class") "ASC", too. It should looks like a glossary. ### Page: Cars A ... BMW:   1er   2er   3er   ... Mercedes:   A-Class   B-Class   C-Class   ... Z This is my `custom-port-type-cars.php`
Mercedes
         <?php $args = array( 'post_type' => 'cars', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC',               // ============================= Mercedes ==============================             'tax_query' => array(                 array(                     'taxonomy' => 'manufacturer',                     'field' => 'slug',                     'terms' => array('mercedes')                 )             )         );              // ============================= OUTPUT ==============================         $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post();             the_title('
', '
');             the_content();         endwhile; ?>
BMW
          <?php $args = array( 'post_type' => 'cars', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC',               // ============================= BMW ==============================             'tax_query' => array(                 array(                     'taxonomy' => 'manufacturer',                     'field' => 'slug',                     'terms' => array('bmw')                 )             )         );                   // ============================= OUTPUT ==============================         $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post();             the_title('
', '
');             the_content();         endwhile; ?>      This doesn´t work for me. I can´t order title an terms at the same time. Thanks for your help   Ogni


title: How to add new custom page or post blocks?

text: I would like to add custom contents to post, such as price, options and some others, I dont like to use the custom fields, because always i have to select from a drop down menu, I want these options to be in a separate area such as title, editor, thumbnail... I think its possible, I have seen this in WP Ecommerce plugin. Can anyone tell how t do it?


title: My Calendar Plugin - add output directly in template file

text: I am using the latest version of the My Calendar plugin by Joe Dolson with the latest version of WP. I want to output an events list in a particular place in my code, but I can't seem to find any way to do this. The only thing I've found regarding output is by using shortcodes in the post/page. I guess theoretically I could add a new sidebar widget and then add the templates that way. Then put the sidebar where I want in the code, but this poses two problems: 1\. It's a hassle 2\. I don't want my clients to be able to move or change this. I'd like to have it set and stay that way. I'm having some trouble finding the answers to this question. It seems like it would be possible, because most plugins I've used have an option to add output directly in the template code, but I can't seem to find the answer. Thanks in advance!


title: Problem with get_posts, tax_query and counting the number of posts

text: I want to count the number of posts that has simoultaneously 3 different taxonomies. THe code i'm using is this:               $products = get_posts(array(         'post_type' => 'products',         'posts_per_page' => -1,         'post_status' => 'publish',         'tax_query' => array(             'relation' => 'AND',             array(                 'taxonomy' => 'collection',                 'field' => 'slug',                 'terms' => array($current_collection),                 'operator' => 'IN'             ),             array(                 'taxonomy' => 'type',                 'field' => 'slug',                 'terms' => array($current_type),                 'operator' => 'IN'             ),             array(                 'taxonomy' => 'color',                 'field' => 'slug',                 'terms' => array($current_type),                 'operator' => 'IN'             )         )        ));     $countpost = count($products);      The problem occours when the **colors** and **type** taxonomy term I'm looking for do not exists...   * if the **collection** does not exists, the count is 0   * if the **type** does not exists, it returns posts with the specified collection and color   * it the **color** does not exists, it returns posts with the specified collection and type what I was expenting, since the relation is AND, was that if one of the terms does not exists, the count should be always 0, instead of basically ignoring that term and considering only tho other two... am I doing something wrong? how can I fix it? thanks a lot!


title: Let user subscribe to specific categories

text: How could I let each user subscribe to a specific categories of his choice? I want to do something like reddit subscribe to categories? Is there any tutorial helps doing this?


title: get_query_var vs global query variables?

text: I have query vars defined in functions.php using:               add_filter('init', 'add_query_vars');          function add_query_vars() {         global $wp;         $wp->add_query_var('profession');     }      Until now, to retrieve the query var in page templates, I have been using `$profession = get_query_var('profession');`. A similar example `$paged = get_query_var('paged');` is also shown for the `$paged` variable on Codex page for `get_query_var()`. However, today I learnt that the query variables are accessible as global variables. All I have to do is declare `global $profession;` and I can start using the value of the variable anywhere within the template. This to me appears to be a much better way of accessing the query vars without the overheads of nested functions of `get_query_var()`. Is there a good reason to use `get_query_var()` to fetch the query vars instead of accessing them as global variables? If not, then why does `get_query_var()` even exists?


I want to display the all the posts that are inside a certain subcategory in a specific order that I decide (this is because the category contains a list of tutorials and I want to decide how to list them). How can I do that? Is there any plugin that I can use? I just want to be able to set the order when displaying that category. Thanks.


title: GD Star Rating Rating In Latest Comment

text:
I want To Show latest comment with rating.. Iam Using The code below.. But Its don't Shown Any Rating.               <?php $comments = get_comments('status=approve&number=3');     foreach($comments as $comment) : ?>         <?php $my_id = $comment->comment_post_ID ; $post_id_comms = get_post($my_id); $title = $post_id_comms->post_title; ?>          Who: <?php echo($comment->comment_author);?>
         Rating: <?php wp_gdsr_comment_integrate_standard_result(get_comment_ID(), '', 16); ?>         About: <a href="<?php get_permalink($comment->ID)?>#comment-<?php echo $comment->comment_post_ID?>" title="on <?php echo $title ?>"><?php echo $title ?>
         What they said: <?php echo($comment->comment_content);?>
         When they said it: <?php echo($comment->comment_date);?>
     <?php endforeach;?>


title: How to use Link Manager

text: I'm working on a plugin and want to use WordPress's 'link manager' (see following image). ![Link Manager](http://i.stack.imgur.com/00CfV.png) How can I use it? I used Google to find an answer but I couldn't. I also figured out that this option was disabled with Wordpress 3.5?! And this plugin should help me out. I installed it but I can't figure out how it works or what I have to do with it.


title: WordPress get posts by date without query_posts

text: I'm want to get posts from the last 30days in a sidebar but I don't want to use query_posts, is there a way to achieve this with the get posts function?


title: Shortcode doesn't work if I directly paste its function in a template file?

text:
This is a shortcode to add a question form in the Question and Answer Forum plugin for Wordpress:               [question_form width=\'x\' bordercolor=\'x\' style=\'x\']question form title[/question_form]      This short code calls this:               //allow short codes  [question_form]     function question_form($atts,$content = "")     {         global $questionformid;         include "askquestionform.php";         return $html;     }     add_shortcode('question_form','question_form');      and this is askquestionform.php:               <?php     load_plugin_textdomain( 'qna-forum', false, 'question-and-answer-forum/languages' );     if(get_option('q_loginrequired_ask')=="TRUE" && !is_user_logged_in())     {         $html = "
".__("Please login to ask a question",'qna-forum')."
";         $html .= q_loginform(get_permalink());         return $html;     }                                                  //STYLING INFORMATION=============     $formstyle = "";     $introstyle = "";     if(isset($atts['width']))     {         $formstyle .= "width:" . $atts['width'] . ";";     }     if(isset($atts['style']))     {         $formstyle .= $atts['style'];     }     if(isset($atts['bordercolor']))     {         $formstyle .= "border: 2px solid " . $atts['bordercolor'] . ";";         $introstyle .= "background-color:" . $atts['bordercolor'] . ";";     }          if(!isset($_POST['title']) || $_POST['title'] == null)     {         $qtitle = __("Enter Question Title",'qna-forum');     }     else{         $qtitle = $_POST['title'];     }     if(!isset($_POST['question']) || $_POST['question'] == null)     {         $Qtext = __("Enter Your Question Here",'qna-forum');     }     else{         $Qtext = $_POST['question'];     }          $html = '<form class="questionform" name="questionform-'. $questionformid . '" id="questionform-' . $questionformid. '" style=\'' . $formstyle. '\'>
';     if($content != "")     {         $html = $html . $content;     }     else     {         $html = $html . __("Use the form below to ask a question",'qna-forum');     }     $html = $html . '
';     include_once (ABSPATH . 'wp-content/plugins/question-and-answer-forum/coreform.php');     $html = $html . '</form>';          $questionformid = $questionformid + 1;      I created a template file called, **question-form-page.php** , I pasted the whole code of **askquestionform.php** but nothing is displayed (blank). I also tried placing the following in **question-form-page.php** :               question_form($atts,$content = "")      and               global $questionformid;     include "askquestionform.php";     return $html;      But I get the same result. Any suggestions?


title: Allow shortcode in the author bio textarea

text: Is it possible to make shortcodes available in the Author bio textarea?


title: Filter Category Loop Dynamically

text: I'm trying to display a custom loop with a dynamic category filter. As a setup I have categories of all usernames which are created once a user creates an account. So I am trying to echo the user's username as a category filter. It works when I echo is elsewhere on the page, but it doesn't work when I try to embed it like so:               <?php query_posts('category_name=<?php global $current_user; if ( isset($current_user) ) {echo $current_user->user_login;}?> &posts_per_page=6'); ?>          <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>          <a href="<?php the_permalink() ?>"><?php the_title(); ?>       <?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?>          <?php endwhile; else: ?>          NO Posts Present           <?php endif; ?>      Any help would be greatly appreciated, thanks.


title: Log in / Log Out Custom Button

text: On our website we have a "Join" button in the top right corner and a log in / log out link using `<?php wp_loginout(); ?>` . Instead of having the log in / log out link we would like to have it display in a button. It should ready "Login" when something like `if ( is_user_logged_in() )` is false and "Log Out" when it's true. The Code for the Join Button is:               Join      so the code for the Log in / log out button should have the same `.join- button` class. Style for `.join-button`:               .join-button {     -moz-box-shadow:inset 0px 1px 0px 0px #f5840c;     -webkit-box-shadow:inset 0px 1px 0px 0px #f5840c;     box-shadow:inset 0px 1px 0px 0px #f5840c;     background-color:#f5840c;     -moz-border-radius:6px;     -webkit-border-radius:6px;     border-radius:6px;     border:1px solid #f5840c;     display:inline-block;     color:#ffffff;     font-family:Arial;     font-size:14px;     font-weight:bold;     padding: 1px 4px;     text-decoration:none;     text-shadow:1px 1px 0px #f5840c;     }      Could someone please help me write the code to achieve this task?


title: Get images attached to a specific page

text: Is there a way to fetch the URLs and captions of all images attached to page _x_?


title: Use Featured Image for backstretch.js

text: I'm using backstretch.js for full-width header images on my pages. I'm able to grab the Featured Image url like this:               <?php $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full', false, ''); echo $src[0]; ?>      Does anyone know of a way to pass this url to my main.js file?               $(".cover").backstretch("FEATURED_IMG_URL_WOULD_GO_HERE"); // backstretch.js      Thanks in advance. Any help is appreciated! UPDATE: Thinking it might be possible to store the PHP in a variable, though I'm not so sure. Something like this, perhaps?               var cover-image = <?php $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full', false, ''); echo $src[0]; ?>;          $(".cover").backstretch(cover-image); // backstretch.js


title: Rewrites with hierarchical taxonomies in permalink

text: I am attempting to create a hierarchical list of products in WordPress 3.5.1. For example if the custom post type product was in the custom taxonomy `Outdoor > Garden Tools > Hoses`, these would be the desired permalinks: `/outdoor/garden-tools/hoses/mega-hose/` (loads the single.php template) `/outdoor/garden-tools/hoses/` (loads the archive.php template) What is the best practice approach to achieving this? I have generated the permalinks with all multiple levels of parent categories successfully for the posts and terms using the `post_type_link` and `term_link` filters respectively. There appears to be a problem with the URL rewriting though as the permalinks return 404 responses, I can't seem to figure out how these requests are functioning (where "xx" can be any string): `/xx/mega-hose/` (returns mega hose page) `/xx/xx/mega-hose/` (redirects to /outdoor/garden-tools/hoses/mega-hose/ and returns a 404) Any help would be much appreciated!


title: Order by Custom Field date not recognized

text: Ok, so I have this custom field `wpcf-evento-data-inicio1` generated with the (great) Types plugin.   This is how it stores on db:   `1372896000`   OK, so I want to order by this value. I'm doing it by url args, and i can't spot what is wrong... I'm currently doing like this:               mysyte.com/?post_type=evento&order=desc&orderby=meta_value_num&meta_key=wpcf-evento-data-inicio1      I have also tried with meta_value instead of meta_value_num               mysyte.com/?post_type=evento&order=desc&orderby=meta_value&meta_key=wpcf-evento-data-inicio1      it outputs like this order:   1. 1372896000   2. 1371600000   3. 1372204800 I just cannot see what is wrong, any ideas? Thank you so much. _(edit: Pls note that this is a archive template (archive-evento.php)_


title: How to add the time of a post to the list of posts on the administration page?

text: This seems like a simple thing to do, but I haven't been able to figure it out. What I'd like to do is add the time a post is scheduled to the date stamp on the list of posts. I know this means modifying the columns, and there's a way to do it that seems fairly simple. Has anyone done this, and can you suggest some code?


title: Query multiple custom post types in single loop

text: I'm aware there are several other posts that cover similar ground to what I'm about to ask. I have three custom post types running, in addition to 'posts'. I want to run a loop that pulls all posts categorised under a particular category                <?php               $args = array(         'post_type' => 'testimonial',         'posts_per_page' => 1,         'tax_query' => array(             array (                      'taxonomy' => 'testimonial_category',                     'field' => 'slug',                     'terms' => 'home'         )     )     );     $query = new WP_Query( $args );                     $postcount = 0;                 ?>                 <?php if ($query->have_posts()) : ?>                     <?php while ($query->have_posts()) : $query->the_post(); ?>                         <?php $postcount++; ?>     //loop here     <?php wp_reset_query(); ?>         This is the code I have at the moment, not sure how I condense this into pulling in multiply post types from one category.


title: How to display product category's individual product list in shop page?

text: I want to display each product category's sub products list in the shop page. Actually now in my shop page was displaying the whole list of products. But when ever i click on the list of sub category menu the control was automatically goes to the home page of that site. And i can understand that there is no code error. When i add 2 categories followed by the 4 pre_category in the admin part this problem is occur. So may be its WP-ADMIN settings problem.               I done this site by using woocommerce plugin.          Can u pls help me whats the problem...


title: WordPress keeps asking for connection information in localhost

text: I tried to find and answer but even though the problem is common I haven't been able to fix it, WP keeps asking me for the FTP info on my local LAMP environment when trying to install, delete or update themes and plugins. I have set my local `www` folder permissions like this:               drwxrwsr-x  3 root www-data 4096 Oct 28 07:43 www/      So the users in the `www-data` group have full access to the folder, I also ran `chmod -R 775` on my site root folder to make sure the owner and group had full permissions as well. I can upload files using the media upload just fine and I can delete them as well, I can also change the `.htaccess` file on the permalink menu so the permissions are at least partially working. If I change the owner of the site folder to the `www-data` user recursively it works fine but since the files and their parent folders group is `www-data` and they have full group permissions I shouldn't need to do this, is this correct?


title: Help with a query not working with custom taxonomy

text: The query below is always returning the latest "news" post, not the latest "news" post with the taxonomy "sotm". I have verified the details of my custom taxonomy, name is "postCat" attached to post type "news", and there is a term "sotm" applied to the post I want to display. Can anyone point out what might be wrong?                   <?php             $sotmArticle_query = new WP_Query(array(                 'post_type' => 'news',                 'postCat' => 'sotm',                 'orderby' => 'date',                 'order' => 'DESC',                 'posts_per_page' => 1             ));             if($sotmArticle_query->have_posts()){                 while($sotmArticle_query->have_posts()){ $sotmArticle_query->the_post();         ?>


title: Additional Option on Custom Header admin

text:
I would like to extend the Custom Header class to include an animation feature for the header graphics. Essentially, I'd like to add another possible value for the radio button for randomization. The existing code reads:               if ( 1 < count( $headers ) ) {             echo '
';             echo '<input name="default-header" type="radio" value="random-' . $type . '-image"' . checked( is_random_header_image( $type ), true, false ) . ' />';             echo __( 'Random: Show a different image on each page.' );             echo '';             echo '
';         }      I would like to do something like this so you can toggle between random and animated. Default output would look something like this:

     <input name="behavior-header" type="radio" value="none" checked />     None: No randomization or animation.

     <input name="behavior-header" type="radio" value="random" />     Random: Show a different image on each page load.

     <input name="behavior-header" type="radio" value="animate" />     Animate: Display headers as slideshow.

      I have had no luck hooking into the custom_header_options (it just places any code into the end of the page, which does not allow for an either/or selection of none/random/animation). Anyone had any experience with extending the custom header class? Is there a simpler way to do this without extending the class? I'm all ears :)