title: Migrating from Existing MySQL Setup to WordPress

text: I currently have a database with the following schema: Table: Articles Columns: ID, Title, Author, Content Table: Authors Columns: ID, AuthorName, EmailAddress Table: Categories Columns: ID, CategoryName I'm interested in moving this over to WordPress. I do NOT actually need to preserve the authors or categories tables because we are revamping those sections in the migration. However I DO need to save certain rows (or all, if easier) of the articles table. This includes keeping the author ID linked to it. I'm willing to do manual queries in order to select which rows I want to move over to the new table, but I'm not sure exactly where I should do this. So my question is: How can I move these articles over to WordPress in the easiest, most seamless fashion? Bonus points if I'm able to assign authors on import somehow.


title: Rewriting a core function?

text:
As I understand it, it's possible to overwrite core functions in wordpress, without touching the core itself, which is of obvious benefit. Now, certain functions are 'pluggable', but not all of them. I'm trying to overwrite the function that outputs the featured image thumbnail in the admin panel to be a custom size, it's not really difficult to do this in the core. The problem arises when I try to put it in my functions.php as a renamed function. This is the core function, edited. What I'd do is just rename it and put it in functions.php, but then how do I actually have it overwrite the 'core' function itself?               function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) {         global $content_width, $_wp_additional_image_sizes;              $post = get_post( $post );              $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post->ID ) );         $set_thumbnail_link = '
%s
';         $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) );              if ( $thumbnail_id && get_post( $thumbnail_id ) ) {             $old_content_width = $content_width;             $content_width = 700;             if ( !isset( $_wp_additional_image_sizes['post-thumbnail'] ) )                 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, array( $content_width, $content_width ) );             else                 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );             if ( !empty( $thumbnail_html ) ) {                 $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID );                 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html );                 $content .= '
' . esc_html__( 'Remove featured image' ) . '
';             }             $content_width = $old_content_width;         }              return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID );     }


title: Inserting custom fields into new-post.php without using the Custom Fields Template plugin?

text: I know there are a few plugins (Custom Fields Template seems to be the most popular one) that lets me insert custom fields into the new-post.php template. But I'm wondering if I can add in a few fields without using a plugin -- just as a mock-up. Do I have to go into the core?


title: Post migration from one site to another site in a network

text: I have a wordpress network site. I have many sites in my network. Lets say i have two subsites like wordpress.mysite.com,joomla.mysite.com. If the user post wordpress related topic in joomla site then i would like to migrate it from joomla to wordpress. Just like stackoverflow. Is there any good multisite plugin available for this feature?. Thanks


title: How to filter posts by category INSIDE the loop

text:
I'm trying to sort my posts like so:               CATEGORY 1      - post title     - post title          CATEGORY 2     - post title     - post title       I have no problem achieving this with a custom query:               <?php      $args = array(         'orderby' => 'name',         'hide_emppty' => 1,         'hierarchical' => false,         'taxonomy' => 'course_category'     );     $categories = get_categories($args);     foreach ($categories as $category) : ?>
<?php echo $category->name; ?>
              <?php $courses = new WP_Query( "post_type=courses&posts_per_page=-1&course_term=term-fall&course_category=" . $category->slug);  ?>         <?php if ( $courses->have_posts() ) : while ( $courses->have_posts() ) : $courses->the_post(); ?>             <?php the_title(); ?>         <?php endwhile; endif; ?>          <?php endforeach; ?>      However, what I need to do is sort posts that come from a plugin-generated query (I have no (?) control over it) - so this needs to happen inside a normal `if(have_posts()) : while (have_posts())` loop. Is this even possible? The posts from this query are all of correct post type and course_term custom taxonomy, just need to get sorted by course_category taxonomy like above. Thanks in advance for your help!


title: (Dynamically) Decrease the actual image size for downloads

text: I am using feedburner (give it the url of my RSS feed). Each of my feed item have an image, is there a way to lower the actual image size so that people dont have to download the real size? **EDIT FROM COMMENTS** The url of the image is one of the item description. I resized it :               <img width="200" height="200" border="2" {{data['child']['']['image'][0]['child']['']['description'][0]['data']}} />      so that it has a smaller size.   But then I realized that for mobile user we don't want them to download the original image which can be too big. That made me wonder what would be a way to reduce the size of the image before it is downloaded?


title: Walker_Nav_Menu - creating separate menu for current top level item children

text: I have had hard time making wordpress custom walker work as I want and I think the problem might be somewhere else. I have a nav tree which looks like this: ![enter image description here](http://i.stack.imgur.com/XuElr.jpg) What I want to do is to have two separate menus. One displays top level items only and other displays child items for the current top level menu item. For that purpose I use custom walker (for my child items) taken from here: http://code.tutsplus.com/tutorials/understanding-the-walker-class--wp-25401 It works well with hierarchical pages and posts, but it doesn't with custom post types and custom taxonomies. Here's how custom post type with custom taxonomy items looks like: ![enter image description here](http://i.stack.imgur.com/IQ60I.jpg) Then when I click on a single item, the only thing I see on the left menu is Copenhagen, which is a direct parent I guess, and no other parent items. ![enter image description here](http://i.stack.imgur.com/tDT8w.jpg) As a result I'm not only missing all the Page 3 children, but also URL has changed (not to mention breadcrumbs). Does anyone know where should I look for the solution of this problem?


title: Get all the posts from the category in a dropdown list in a custom field

text: In wordpress I have have a custom post type. Lets say it is movies. Inside movies I have a list of posts with different movie name. Now in each post I want a custom field of dropdown. Where all the posts for movie will be get populated. And when I will select anyone of them and save. Then the selected movie will show in the frontend. So can someone tell me how to add custom fields for dropdown and fetch all the posts name from that category in the options? Any help will be really appreciable. Thanks


title: invoke/consume restful API

text: I have a Wordpress website, where I need to call a restful web service but I couldn't find any good example explaining the steps in order to do that. Can Anyone clarify the steps to invoke a restful web service through Wordpress ?


title: add_action('wp_ajax_[action name]', myfunction) problem

text: I'm trying to integrate ajax in wordpress using the wp codex guidelines. In the PHP I added:               wp_enqueue_script ( 'my_ajax', ADMIN_URL . 'js/ajax.js','jquery','1.0.0' );     wp_localize_script( 'my_ajax', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );      The ajax code is:               jQuery.ajax({url: MyAjax.ajaxurl, type: "POST",data: {action: 'myaction',postID : MyAjax.postID}, success: function(response) {      alert('Got this from the server: ' + response);     }});      and the PHP function that should be called by ajax is:               function ajax_function() {     ...do something...     }     add_action('wp_ajax_myaction', 'ajax_function');     add_action('wp_ajax_admin_myaction', 'ajax_function');      The ajax call is successful (the "alert" works), however, the php function "ajax_function" is never called. After doing some debugging I realized that even though the action call add_action('wp_ajax_ sets a new element in the global $wp_filter array, when the corresponding do_action runs inside admin- ajax.php, the $wp_filter array no longer contains that element. Therefore, "ajax_function" function is ignored. Any idea why the function is not called?


title: file_get_contents Not allowed in Themes?

text: I'm using `file_get_contents` in a theme development (in a widget of the theme). However the theme check plugin gives me following warning:               WARNING: file_get_contents was found in the file file.php possible file operations.          Line 49: $data = file_get_contents ( 'http://example.com');     Line 62: $count= file_get_contents ( $cfile );      My question is that if it is not allowed in the themes, is there any alternative for this function which can be used? Thanks.


title: Check if shortcode is self-closing and then displaying it

text: I'm using this snippet: http://wpsnipp.com/index.php/functions-php/update- automatically-create-media_buttons-for-shortcode-selection/ which give me a list of all my shortcodes and always prints like [shortcode][/shortcode] even if the shortcode function have the argument of $content = null. I wonder to know if its possible to pass a conditional to check if the function have the null argument and then print it on the correct way (self- closing).


title: Customize Dashboard Widgets Area for the Client?

text: To avoid the client messing up the website I have already customized other parts of the admin backend, now for the dashboard widgets area. I don’t want to block access but rather I want to give the client the option to add new active widgets, while restricting him to "play" with the already existing ones. What is the best option for that?


title: Get all posts in RSS

text: I'm wondering how/if I can access more than the most recent X posts defined in the wordpress settings. I've seen plugins that migrate all blog content through RSS, haven't poked around to see their methods. Basically I manage a couple hundred WordPress blogs, and I'm building a newsletter generator for my clients. They want to be able to select a few posts and have the excerpts appear in the newsletter body. The sites are spread across multiple servers and the newsletter generator is being built on top of our CRM, so direct database queries would be difficult. RSS would be the cleanest, but I can't seem to figure out how to access more than 10 at a time (when 10 is set in the admin). Any ideas?


title: How to Display Post View Count

text:
I am trying to display post view counts. I've tried below function to display the post view count, but I'm getting same post view for all the post in loop. Not getting correct post view count. **Function:**                      <?php               // function to display number of posts.                function getPostViews($postID){                $count_key = 'post_views_count';                     $count = get_post_meta($postID, $count_key, true);                   if($count==''){               delete_post_meta($postID, $count_key);                          add_post_meta($postID, $count_key, '0');                         return "0 View";                 }                 return $count.' Views';           }                                 // function to count views.            function setPostViews($postID) {           $count_key = 'post_views_count';               $count = get_post_meta($postID, $count_key, true);          if($count==''){                      $count = 0;          delete_post_meta($postID, $count_key);                    add_post_meta($postID, $count_key, '0');               }else{          $count++;                        update_post_meta($postID, $count_key, $count);                    }                  }                         // Add it to a column in WP-Admin          add_filter('manage_posts_columns', 'posts_column_views');            add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2);          function posts_column_views($defaults){           $defaults['post_views'] = __('Views');          return $defaults;              }            function posts_custom_column_views($column_name, $id){     if($column_name === 'post_views'){         echo getPostViews(get_the_ID());           }            }          ?>      **Loop Code:**
           <?php $the_query = new WP_Query( 'showposts=5' ); ?>                  <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?>                 <?php echo getPostViews(get_the_ID()); ?>  //post View COde            <?php echo substr(strip_tags($post->post_content), 0, 250);?>
                <?php endwhile;?>
      Need suggestions to display Correct Post View Count in while Loop


title: diplay my wordpress posts like a ifram and slidshow if onclick

text: I use wordpress 3.9 Theme: TwentyFourteen I love inftead my articles appear as lists on the home page, it appears as slide. I tried with a lot of plugin or play files single.php, functions.php and post.php but I always failed to what I want. Here is an example of exactly how I want my items are displayed: www.paysage3d.over-blog.com Thank you for helping me


title: How to avoid duplicate posts on front page?

text: how to avoid duplicate posts on front page? i have 1 category 'news' for all posts and some categories like 'vegetables' and 'fruits'. Each post is in 'news' and particular category. At the top of page i have recent 3 'news' posts and in other places i want to press fe.3 recent posts for 'fruits' category, but to not duplicate 3 recent 'news' posts. i've tried with sth like that:               query_posts( 'posts_per_page=3&category_name=fuits' ) && query_posts('posts_per_page=3&category_name=news&offset=3' );      Can anyone help me?


title: Most recent post is missing from Author page

text:
Here is the loop from my `author.php` page. It is showing recent posts, but not the MOST recent. Where is my mistake?                   <?php if (have_posts()): the_post(); ?>
                 <?php _e('All posts by'); ?> <?php echo get_the_author(); ?>                 »
              <?php while (have_posts()) : the_post();?>              <div id="post-<?php the_ID(); ?>" class="cat-post">
             <a href="<?php the_permalink() ?>" title="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?> - <?php the_title(); ?>"><?php the_post_thumbnail( '300x169' ); ?>

By  <?php the_author_posts_link(); ?><?php the_date(); ?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?> - <?php the_title_attribute(); ?>"><?php the_title(); ?>
                     <?php the_excerpt(); ?>                     <a class="continue-reading" href="<?php the_permalink(); ?>">Read on »
      Here is the site. The "Editor's Pick" post on the homepage is the most recent and does not show up on the Author page.


title: wp_editor adds HTML entities to the content

text: I'm building my theme options page and I want to use Wordpress TinyMCE editor here, so I'm calling `wp_editor`. But when I'm saving data some entities are added to the content for example, lets say I want to add image: `<img class="" title="" src="path_to_image" alt="" />` Thats what I've got after clicking save: `<img title="\"\"" src="\"path_to_image\"" alt="\"\"" />` Why is this changing quotes into entities (and leaves actual - correctly displayed quotes?)?? @edit: This is how I display my editor:                   $class = (isset($value['class'])) ? $value['class']:'';         $content = (get_option($value['id']) ? get_option($value['id']) : '');              $settings = array(             'textarea_name' => $value['id'],              'editor_class' => $class             );         wp_editor($content, strtolower($value['id']), $settings );      And that's how I save data for this field:               update_option($value['id'],     $_POST[ $value['id'] ]);


How to show the posts of some category first, and then all other posts that does not belong to that category? I have logic that get the category and reorder the posts. But i don't know how to use. Please help.               $args = array(         'post_type' => 'event',         'meta_key'  => '_event_end_date',         'meta_compare' => '>',         'meta_value' => $today,         'order' => 'DESC',         'posts_per_page' => '10'     );     $loop = new WP_Query( $args );


title: Assigning proper permalink to blog that is part of a website

text: My blog is a part of a custom website (all done in wordpress). I would like the blog page to be on mywebsite/blog I've set wordpress so that the root points to a static page and that the posts are displyed under the /blog directory. I would like the blog post to be in /blog/post-name; but now I see that they are under /post-name How can I do it? Thanks. Andrea PS: I'm not using wordpress multisite and both the blog and the main website would be run under the same installation of wordpress and as a single website.


title: Format Buddypress Date Picker Output

text: I've created a custom profile field for my BP users and I'm looking to show the value on the user's profile page. The code below does this...               <?php bp_profile_field_data( array('user_id'=>get_the_author_meta( 'ID' ),'field'=>'birthday')); ?>      ...But it displays it as "1985-10-30 00:00:00". How can I format this to display like this: "October, 30 1985"


title: How to add a class and title attribute to the link generated by next/previous post

text: The following code               <?php previous_post('%', '<', 'no'); ?>     <?php next_post('%', '> ', 'no'); ?>      returns these links, as it should               <     >      My question is about adding a class and title attribute so that the code returns               <     >      I am using the iWR Tooltip plugin and would like to use it on the links for the post navigation. There is probably a simple solution by adding something to the function.php file, but I have not come up with the answer. Any ideas?


**Background** I'am generating posts from an uploaded csv. Each row is supposed to be a new CPT record which will have a term based on one of its column. This is the stripped csv               Post Title;This is the content.;mars      This is supposed to create a CPT with the title "Post Title", and "This is the content." as the post content. The last part is supposed to set the post to the "mars" of the taxonomy "planets" Somehow the script failed me. So now I will have to search CPT - posts that are not related to any term of the "planets" taxonomy. **Question** How to query posts that are not related to any term of a taxonomy? Thank you in advance.


title: Options Framework not saving options correctly

text: I'm trying out the Options Framework, and I've started hacking options.php. I have reduced the amount of options, and one of the options left is an image upload. I have gone into Theme Options, and uploaded an image (for the logo), but I cannot find mention of this anywhere in the database. If I search phpmyadmin for the option id, I find a result in the wp_posts table. The option ID turns up as the post title. I thought it should be in the wp_options table. Here is options.php Here is inc/options-framework.php **UPDATE** The theme I have integrated the Options Framework into is contained in a folder call RWWA. options.php contains:               $optionsframework_settings['id'] = $themename;      so, I was assuming that each individual options would be called RWWA_optionname. However, I have since found there is an entry in wp_options called RWWA, and its value is > > a:3:{s:6:"colour";s:0:"";s:13:"logo_uploader";s:0:"";s:12:"banner_image";s:7:"forrest";} where logo_uploader is the id of the image upload option, and banner_image is the id of an image select option. So it looks like each option is not being saved in the format of $themename_$optionname. You can look at the code of Options Framework here. **UPDATE** I've tested using the whole Options Framework Theme Master, from which I used some components, and the theme master saves options in the same way, under a generic entry in wp_options called "options_framework_theme_master" How do I reference a specific option in this format?


title: Bulk remove category from custom post type?

text: I know you can use bulk actions to add categories but how do you remove them in bulk? I have a custom post type that is using a category (as status) and it needs to basically be toggled in bulk and frequently. I thought just using a category for this would be a simple solution but I was frankly a little shocked when I learned you can only add categories in bulk but not remove. This actually seems like something that would be included in the core. Any ideas?


title: How to add image attachment to post from a single meta key (Woocommerce)

text: I'm using Woocommerce for products. All products are imported automatically by a plugin. Currently when i want to attach an image to a product (a post type) i have to use "Featured image" to display the image on the website. This is all manual work. Once i save the image, the image is saved to the database in table wp_posts, the post_type is "attachment", the post_mime_type is "image/jpeg", the post_parent is the postID.               ID    post_author   post_title      post_status post_name      post_parent guid                            post_type   post_mime_type     200   1             Niceimagename   inherit     Niceimagename  116         http://domain.com/imageurl      attachment  image/jpeg                  What code do i have to add to my functions.php that if a post gets saved or updated that it uses the value in meta key "_image" to attach the image to the post like the sample above?


title: Show Available Taxonomy List with Current Category

text: As you can see from the image, I am listing all categories and the cities (taxonomy list).   ![enter image description here](http://i.stack.imgur.com/xMhmI.png) What I want to do is : If Car classifieds is selected on cities list show the city name which has car classified on that city. That means if 2 Car Classified is on London should show 'London (2)' (not total number). It is like filtering action. I have something like               $cat_id = get_category(get_query_var('cat'))->slug;      wp_list_cats( 'hide_empty=1&hierarchical=1&order=ASC&show_count=1&taxonomy=location&title_li=0&cat=$cat_id' );      Which doesnt work. I feel I am really close to solve this but couldnt manage to do it.


title: Advanced custom field boolean value in custom post type

text:
I'm using the Advanced Custom Field (ACF) plugin in a Custom Post Type (CPT). I have field group in ACF that contains a Image field and true/false field called 'home_offer'. I'm using this ACF in a Custom Post Type called Offers. I want to loop through the CPT Offers and check if the true/false field 'home_offer' is checked. How do I check if the true/false field is selected. Ive started with this WP_Query.
                 <?php                     $offers_args = array(                         'post_type' => 'Offers',                         'post_per_page' => 1,                         'meta_query' => array(                                 array(                                     'key'       => 'home_offer',                                     'value'     => 'on',                                     'compare' => '=',                                      'type'      => 'CHAR'                                 );                         );                     );                          $offers_loop = new WP_Query($offers_args);                          if($offers_loop->have_posts()):                         while($offers_loop->have_posts()):                             $offers_loop->the_post();                          $image = get_field('image');                              ?>
                          <img src="<?php echo $image ?>" alt="" />
                        <?php                          endwhile;                     endif;                          wp_reset_postdata();                      ?>


title: How to prevent deleting of comments when deleting a post

text: Like the title says: How can i prevent Wordpress from deleting post comments when i delete a post? What i am trying to accomplish is that i want to merge all comments from different posts to posts that are relative to eachother by posttitle or a predefined meta key in the post. Sometimes i delete a post that is absolete and i still want those comments to show up for the undeleted posts. I already have some of the comment aggregate coding for my functions.php. (still has to be adjusted a little bit for the query part to get results based on comment meta instead of the comment post id).               function multiple_comment_post_id_query_filter( $query )     {         //todo:         //get postid's from comments where a certain meta value is set. Database table wp_commentmeta         //the meta value is extracted from the post meta value with the same id         //when someone adds a comment, the comment meta will be included         //put the captured post id's into an array with variable $post_ids          $post_ids = array ( 1, 2, 3, 4 );         if ( FALSE === strpos( $query, 'comment_post_ID = ' ) )         {             return $query; // not the query we want to filter         }              remove_filter( 'query', 'multiple_comment_post_id_query_filter' );              $replacement = 'comment_post_ID IN(' . implode( ',', $post_ids ) . ')';         return preg_replace( '~comment_post_ID = \d+~', $replacement, $query );     }     add_filter( 'query', 'multiple_comment_post_id_query_filter' );      I prefer not to edit core files in case i have to upgrade (if there is no other possible way i will do it...)


title: List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?

text:
I have the following function that lists all Child-Pages of a page.               function show_subpages() {              global $post;         $subpages = wp_list_pages( array(             'echo'          =>0,             'title_li'      =>'',             'depth'         =>2,             'link_before'   => '— ',             'child_of'      => ( $post->post_parent == 0 ? $post->ID : $post->post_parent)         ));         if ( !empty($subpages) ) {             echo '
';             echo $subpages;             echo '
';         }     }      So when I'm on the `parent-page` I see a list with all the child-pages. If I'm on a `child-page` I see the same list with all the child-pages corresponding with the parent-page.               — My Parent Page        — My Child Page Nr. 1        — My Child Page Nr. 2        — My Child Page Nr. 3      This is almost what I want! The only little thing I need to add is to remove the "current" page I'm on from the list of child-pages. So imagine I'm on `My Child Page Nr. 2` I only want to list `My Child Page Nr. 1` and `My Child Page Nr. 3` but not "Nr. 2" since I'm currently on this one. Any ideas how to add this? Thank you in advance.


title: Change rss title of individual feeds?

text: I want to set a custom title to indiviual rss feeds. Right now my post feed runs under a page called podcasts and the title of my rss feed then becomes `<blog name> » podcasts` because it is the feed of the podcasts page. However I would like to replace the slug `» podcasts` with the subtitle of my blog. How can I replace the title of the feed under posts or category? I have seen the answer RSS Feed Custom Title? here but this does not remove the slug for me ... but appends it! Help is appreciated.


title: How to Make a Categories Meta Box with Hierarchical Checkboxes on Frontend?

text: My website allows uses to post posts of a custom post type ("place"). I would like to display the same "Categories" meta box seen in WordPress dashboard when you add or edit a post on frontend:   ![backend categories meta box](http://i.stack.imgur.com/zU83s.png) This is because the "Categories" meta box or hierarichical checkboxes is simply the best way to view and edit the categories a post belongs to. How do I the "Categories" meta box on frontend? I do know JQuery so feel free to throw in JQuery stuffs if any. I would strongly prefer an approach to replicate what WordPress does for adding/ editing a post in backend, instead of a hack from scratch.


title: How to determine if a post has attached images?

text: I would like to know how I can determine if a post/page has an image gallery (not documents/videos etc)? I am not talking about gallery shortcode as shown here Check if post/page has gallery? so that               if (has_gallery = true){            //Do Something     }          else {       // Do Something else     }


title: Wordpress plugin ajax post parameter

text:
i have problem. I don't know why but my paramters from form don't pass too aad_process_ajax(). My code from functions and jquery: Function with my form:               function aad_render_admin() {              ?>

<?php _e('Admin Ajax Demo', 'aad'); ?>

             <form id="aad-form" action="" method="POST">
     <input type="text" name="name" />     <input type="text" name="header" />     <input type="text" name="body" />     <input type="text" name="urls" />                     <input type="submit" name="aad-submit" id="aad_submit" class="button-primary" value="<?php _e('Get Results', 'aad'); ?>"/>                     <img src="<?php echo admin_url('/images/wpspin_light.gif'); ?>" class="waiting" id="aad_loading" style="display:none;"/>
             </form>

         <?php     }      Jquery code:               jQuery(document).ready(function($) {         $('#aad-form').submit(function() {             $('#aad_loading').show();             $('#aad_submit').attr('disabled', true);                data = {               action: 'aad_get_results',               aad_nonce: aad_vars.aad_nonce           };                   $.post(ajaxurl, data, function (response) {                 $('#aad_results').html(response);                 $('#aad_loading').hide();                 $('#aad_submit').attr('disabled', false);             });                      return false;         });     });      And this function don't get my parameters why?               function aad_process_ajax() {         global $wpdb;              echo $name = $_POST['name'];         $header = $_POST['header'];         $body = $_POST['body'];         $urls = $_POST['urls'];         echo 'xxxx';                  $wpdb->insert(               'wp_myprojects',                 array(    'name' => $name,                         'header' => $header,                         'body' => $body,                         'urls' => $urls,                         ),                 array(    '%s',                         '%s',                         '%s',                         '%s'                         )             );              $wpdb->show_errors();         /*EVRY PROCESS AJAX MUST DIE!!!!*/         die();         /*EVRY PROCESS AJAX MUST DIE!!!!*/     }     add_action('wp_ajax_aad_get_results','aad_process_ajax');      Tell my why parameters don't show in function `aad_process_ajax()`. Problem is in Jquery or Wordpress?


title: Using AJAX in a Widget to Sort items

text:
Hi I am trying to use jQuery sortable to sort items in a widget on the admin side. However I am having trouble getting any data in the JS file when I do `alert(order)`. Any idea what might be wrong here? in the php file:               /*     Plugin Name: Test widget     */               add_Action('widgets_init', 'boj_widgetexample_register_widgets');          // register our widget     function boj_widgetexample_register_widgets() {         register_widget('boj_widgetexample_widget_my_info');      }                    class boj_widgetexample_widget_my_info extends WP_Widget {                  // process the new widget             function boj_widgetexample_widget_my_info() {                 $widget_opts = array(                     'classname' => 'boj_widgetexample_widget_class',                     'description' => 'Display a user favourite movie and song'                 );                 $this->WP_Widget('boj_widgetexample_widget_my_info', 'My info widget', $widget_ops);                 /* load the widget javascript for the widgets admin screen. */                 add_action( 'load-widgets.php', array(&$this, 'my_widget_admin_script') );                      // function to process ajax order                 add_action('wp_ajax_mywidget_update_order',array(&$this, 'my_widget_save_order') );                                   }                              // displaying the widget form in admin             function form($instance) {                 $defaults = array('title'=>'my info', 'movie'=>'','song'=>'');                 $instance = wp_parse_args( (array) $instance, $defaults);                 $title = $instance['title'];                 $movie = $instance['movie'];                 $song = $instance['song'];                 ?>

Title: <input class="widefat" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />

Movie: <input class="widefat" name="<?php echo $this->get_field_name('movie'); ?>" type="text" value="<?php echo esc_attr($movie); ?>" />

                              <?php }                       // saving the widget options             function update($new_instance, $old_instance) {                 $instance = $old_instance;                 $instance['title'] = strip_tags($new_instance['title'] );                 $instance['movie'] = strip_tags($new_instance['movie'] );                 $instance['song'] = strip_tags($new_instance['song'] );                      return $instance;             }                  // output on front end             function widget($args, $instance) {                 extract($args);                      echo $before_widget;                 $title = apply_filters( 'widget_title', $instance['title']);                 $movie = empty($instance['movie'] ) ? ' ' : $instance['movie'];                      if ( ! empty($title)) { echo $before_title . $title . $after_title; }             }                       /* Push the widget scripts into widget admin page */             function my_widget_admin_script() {                                      wp_enqueue_script('jquery-ui-sortable');                 wp_enqueue_script('update-order', plugin_dir_url(__FILE__) . '/js/update-order.js');                  }                         function my_widget_save_order() {                 echo 'test';                      //print_r($_POST);                 //die();             }                 }


title: Hide wp-login.php but not the widget

text: I have a website which is still under nascent construction stage: http://42charts.com . Lately I find that couple of users are registering themselves in my site. It seems like a bot as the mails IDs are weird, users do not use the site. Moreover my `wp-login.php` page does not have direct link (the homepage login site is a social login through wp-social-login plugin integrated with Login- with-ajax - ajax does not work right now but its for future). I do not want a user to be able to see the login/registration page, _but_ I want them to be able to see the login option at the page top, which comes through a wp-social-login widget. Is there anyway to do this?


title: Change Category Page Display

text: I have several category pages (e.g. example.com/?cat=3) that display only the post titles. I would like to make them display the post as well. What is the easiest way to do this?


title: Change the path where wordpress plugins are uploaded

text: Currently my plugins are getting uploaded to `public_html/sitename/wp- content/plugins` instead of `public_html/wp-content/plugins`. Is there any way that I can change the path where word press uploads the plugins? I had moved my site to the root folder and hence this issue arose.


title: Not 100% width on mobile for twenty twelve theme

text: I'm creating a blog for my website which is the only thing on my site to use wordpress. I'm using the twenty twelve theme. my website looks ok on my desktop (all 100% screen layout) but viewing this on my IPod and iPad my added header and footer are 100% width but my "body" content is not. Please can someone explain what I am missing. Thank you.


title: Change "From" name in MailChimp STS plugin

text: I'm using the Mailchimp STS plugin for Wordpress, which uses Amazon SES for transactional emails. The plugin is set up correctly, but the default "From" name appears only as "andrew" in sent emails. Since there is no option to change this in the plugin's settings, I assume this is being grabbed from my email address (e.g. andrew@domain.com). I found this code in the plugin:               // Plugin authors can override the potentially troublesome default     $phpmailer->From     = apply_filters( 'wp_mail_from', $from_email );     $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name  );      How can I change it so that I can display a custom "From" name (e.g. My Name, Company). Thanks in advance for the help!


title: Preserve theme settings when migrating from local to live

text: Whenever i try to move the website from local to live or viceversa **Theme Option settings** resets. Exporting the settings and importing it couldnot restore the images which is an upload field(P.S.it restores the text fields).I tried changing the urls of the export file i.e from               http://localhost/mysite/image.jpg     to     http://newhost/mysite/image.jpg      but no use. I faced this problems in redux framework, nhb options framwork and even with most of the premium themes. If anybody faced this problem or know any solution for this You can help me sorting out.


title: How to hide child categories from displaying

text: I am using this code to show a list of all categories in sidebar `<?php wp_list_cats('list=0&sort_column=name&optioncount=0&hierarchical=0&optioncount=1&children=0'); ?>` but the problem is that is lists the child categories as well. so the final result using the above code is like :   - category 1   - category 2   - child-category 1    I do not want the child-category 1 to be displayed - any suggestion on how ? thanks


title: Loop issues when creating custom query for media uploader

text: I'm working on a theme for a magazine publisher who routinely deals with a large number of images. I need them to be able to associate each image with a contributor (photographer, illustrator, artist, etc.) Each contributor is contained in a custom post type, 'jdp_contributors' and the contributor type is a custom taxonomy, 'jdp_contributor_types'. Using the WordPress hook 'attachment_fields_to_edit' I would like to add a select menu that allows the user to choose a contributor for the image. I have the site spitting out the menu and saving the values correctly, but there are a couple of strange bugs going on. 1) When adding a new image via the media uploader the full list of (50+) contributors is available to select from. 2) When editing an image via the media uploader (in the 'Media Gallery') tab, only the first 10 contributors are available for selection. To create the select menu I am creating an new instance of WP_QUERY. The arguments for WP_QUERY state that 'posts_per_page' = -1 and 'nopaging' is set to true. I'm at a loss as to what I'm not doing correctly.               <?php     /**     * Add Photographer selection to media upload     *     * @param $form_fields array, fields to include in attachment form     * @param $post object, attachment record in database     * @return $form_fields, modified form fields     */     function bsj_attachment_field_credit( $form_fields, $post ) {         //do_dump($post);              $form_fields['jdp_photographer'] = array(             'label' => 'Contributor:',             'input' => 'html',             'helps' => 'Choose the photographer/artist for this image',         );              //GET THE CURRENT PHOTOGRAPHER         $current_photog = get_post_meta($post->ID, 'jdp_photographer', true);         if ( !isset($current_photog) ) {             $current_photog = 0;             }              //SETUP THE FORM FIELD         $form_fields['jdp_photographer']['html'] = '<select name="attachments['.$post->ID.'][jdp_photographer]" id="attachments['.$post->ID.'][jdp_photographer]">';              //OUTPUT NULL FIELD         $form_fields['jdp_photographer']['html'] .= '<option value="0" '.selected(0, $current_photog, false).'>Choose one...</option>';              //GET THE TERMS IN THE 'jdp_contributor_types' taxonomy, excluding authors         $terms = get_terms( 'jdp_contributor_types', array('fields' => 'ids', 'hide_empty' => false, 'exclude' => '32') );              //GET THE PHOTOGRAPHERS         $args = array(             'post_type' => 'jdp_contributors',             'nopaging' => true,             'posts_per_page' => -1,             'tax_query' => array(                 array(                     'taxonomy' => 'jdp_contributor_types',                     'field' => 'id',                     'terms' => $terms                 ),             ),             'orderby' => 'name',             'order' => 'ASC',         );         $photographers = new WP_QUERY($args);              //LOOP THRU THE PHOTOGRAPHERS         foreach( $photographers as $postdata ) {             setup_postdata($postdata);             $form_fields['jdp_photographer']['html'] .= '<option value="'.$postdata->ID.'" '.selected($postdata->ID, $current_photog, false).'>'.$postdata->post_title.'</option>';         }         wp_reset_query();              $form_fields['jdp_photographer']['html'] .= '</select>';              return $form_fields;     }     add_filter( 'attachment_fields_to_edit', 'bsj_attachment_field_credit', 10, 2 );               /**     * Save values of Photographer Name and URL in media uploader     *     * @param $post array, the post data for database     * @param $attachment array, attachment fields from $_POST form     * @return $post array, modified post data     */     function jdp_attachment_field_credit_save( $post, $attachment ) {         if (isset( $attachment['jdp_photographer'] ) )             update_post_meta( $post['ID'], 'jdp_photographer', $attachment['jdp_photographer'] );              return $post;     }     add_filter( 'attachment_fields_to_save', 'jdp_attachment_field_credit_save', 10, 2 );     ?>


title: meta_query returning excluded result

text: I have a series of day slots per location, in a multicheckbox custom field. I have a search page where the user can select location, weekday desired, and activity type. Right now I just have 2 samples: a class that meets on Tuesdays and one that does not. When searching for a Tuesday class, however, both are showing up. Here is how I build my argument:               $searchday = $day; // save this value for the results_array                             $day = array();                             for($a=1; $a<=10; $a++) {                                 $day[$a] = array(                                     'key' => '_cmb_'.$searchday.'_location_'.$a,                                     'value' => $location,                                     'compare' => 'LIKE'                                     );                             }          $args = array('posts_per_page' => -1,                             'post_type' => $class_type,                             'meta_query' => array(                                                     'relation' => 'OR',                                                     (($day) ? $day : ''),                                                       ),                             );      And here is that output as `print_r`               Array     (     [posts_per_page] => -1     [post_type] => aquatics     [meta_query] => Array         (             [relation] => OR             [0] => Array                 (                     [1] => Array                         (                             [key] => _cmb_tuesday_location_1                             [value] => huntley                             [compare] => LIKE                         )                          [2] => Array                         (                             [key] => _cmb_tuesday_location_2                             [value] => huntley                             [compare] => LIKE                         )                          [3] => Array                         (                             [key] => _cmb_tuesday_location_3                             [value] => huntley                             [compare] => LIKE                         )                          [4] => Array                         (                             [key] => _cmb_tuesday_location_4                             [value] => huntley                             [compare] => LIKE                         )                          [5] => Array                         (                             [key] => _cmb_tuesday_location_5                             [value] => huntley                             [compare] => LIKE                         )                          [6] => Array                         (                             [key] => _cmb_tuesday_location_6                             [value] => huntley                             [compare] => LIKE                         )                          [7] => Array                         (                             [key] => _cmb_tuesday_location_7                             [value] => huntley                             [compare] => LIKE                         )                          [8] => Array                         (                             [key] => _cmb_tuesday_location_8                             [value] => huntley                             [compare] => LIKE                         )                          [9] => Array                         (                             [key] => _cmb_tuesday_location_9                             [value] => huntley                             [compare] => LIKE                         )                          [10] => Array                         (                             [key] => _cmb_tuesday_location_10                             [value] => huntley                             [compare] => LIKE                         )                      )              )          )      Not sure what I am doing wrong here. I went so far as to examine the database to ensure that this class (which should not show up) holds no value for meta_key '_cmb_tuesday_location_1' .. 2, 3, etc - through 10. No key should mean `huntley` value is not found. Thanks for reading.


title: How can i add some static text above the editor?

text: I created a custom post type and i want to display some text on the editor page below the title and above the text editor. How can i do this? I tried using add_meta_box, but i wasn't able to move it above the editor.


title: Lock Display Name To Nickname

text: Using the following code to change the author url links to their nickname. The issue is it seem to be conflicting and trying to use the display name instead. Can i lock the display name to the nickname or can i change this code up a bit. If i change the nickname from the wp-admin it changes with the nickname field just fine. However if users change the nickname from the front end form (using wp user frontend pro plugin) i have to go into wp-admin and set the display name to make it change.                     add_filter( 'request', 'wpse5742_request' );                function wpse5742_request( $query_vars )           {           if ( array_key_exists( 'author_name', $query_vars ) ) {         global $wpdb;         $author_id = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key='nickname' AND meta_value = %s", $query_vars['author_name'] ) );         if ( $author_id ) {             $query_vars['author'] = $author_id;             unset( $query_vars['author_name'] );             }         }          return $query_vars;         }          add_filter( 'author_link', 'wpse5742_author_link', 10, 3 );          function wpse5742_author_link( $link, $author_id, $author_nicename )         {       $author_nickname = get_user_meta( $author_id, 'nickname', true );          if ( $author_nickname ) {         $link = str_replace( $author_nicename, sanitize_title($author_nickname), $link );         }         return $link;         }         add_action( 'user_profile_update_errors', 'wpse5742_set_user_nicename_to_nickname', 10, 3 );         function wpse5742_set_user_nicename_to_nickname( &$errors, $update, &$user )         {         if ( ! empty( $user->nickname ) ) {         $user->user_nicename = sanitize_title( $user->nickname, $user->display_name );        }        }


title: Crafting WP_Query array, sort by date

text: question about wordpress WP_Query: **'post_type' => 'event_date'** outputs dd/mm/yy ex: 31122012 I would like to order my frontend **'event_date'** output not by latest WP post entry but by latest **'event_date'** Already tried **'order' => 'ASC'** that sort only on WP post entry Heres my code:               $arg = array('post_type' => 'livedates');     $the_query = new WP_Query($arg);     while($the_query->have_posts()) : $the_query->the_post();     $date = str_split(get_post_meta($post->ID, 'event_date', true), 2);          //the loop          endwhile;


title: Displaying shortcode content inside custom field without images

text: I need to be able to display different shortcodes inside custom fields. I have found a method that almost works perfect, but since that uses `get_content`, it also shows the main featured image of the page.   After the image that's output, the correct content that the shortcode outputs is displayed correctly. How can I stop the image from being output in the first place? I'm using css to hide it, but would rather not have it output at all. I've tried using this other method which used `get_the_content` instead, and that doesn't work.   The shortcode content doesn't even show at all with that method. I also found this:               echo preg_replace("/\< *[img][^\>]*[.]*\>/i","",get_the_content(),1);       Does anyone know how to make that filter work for me with the code I'm using (shown in the pastebin link).


title: Image "description" and SEO within WP

text: I've been told here and there that the "description" is important for SEO purposes and it's an optional, but should be filled in, attribute on WordPress when inserting an image. I never ever fill this in and, to test, just now I inserted an image in the blank WordPress theme I use for testing plugins etc. (on local) and, obviously the "alt" _has_ to be filled in since it's required, the "title" tag is optional but good to put in. Both show up in the code but, unless I'm missing something, "description" does not. My question is simply, is this true? Is it needed?


title: Post thumbnail outside the loop

text: I'm trying to get the post thumbnail in the sidebar which is in essence outside the loop.   For some reason it seems impossible!!!   I have tried all kinds of ways.   Here is the wirking code: (I have edited the code now that I found it)               global $wp_query;     $post_id = $wp_query->post->ID;          if (has_post_thumbnail( $post_id ) ):         $image_id = get_post_thumbnail_id($post_id);         $imazz = wp_get_attachment_image_src($image_id,'medium',true);         $image_url = $imazz[0];         $image_url = '';     else :         php $image_url = '';     endif;      I have also tried using the following code:               get_the_post_thumbnail($post->ID); // using the post id      and that               get_the_post_thumbnail($post_id); // using the fetched post id      any help would be very much appreciated. Thanks


title: Custom Post Type: Set post_title equal to a custom post type field

text: I’ve created a custom post type for employees in a company with some fields they have to fill (like E-mail, phone, etc.) and a select box which takes some values from another custom post type called “company”. I’ve disabled / removed the editor for the employee post type but now I’m having trouble listing them in the overview because each “employee” misses a title (post_title). How can I set the post_title for an employee to be equal to the custom field “Name”? There is a lot of code working so I’ll only show the part where I’m saving my data for each employee:               foreach ($meta_box['fields'] as $field) {         if(isset($_POST[$field['id']])) {             if(!add_post_meta($post_id, $field['id'], $_POST[$field['id']], true)) update_post_meta($post_id, $field['id'], $_POST[$field['id']]);         }          }      I have an array with all the data and then save with the right values for each field but can I here say, that:               If($field[‘id’] == ‘emp_name’) {         Set($post_title = $field[‘id’]);      }      Or something like that? Any help or suggestions would be very much appreciated. Thank you - Mestika


title: WP CRON on shared hosting that does not allow loopback connections?

text: My hosting company infrom me that they do not allow loopback connections, which are required to run the following cron task on my server. I need to run a cron task for this plugin: http://tribulant.com/plugins/view/1/wordpress-newsletter-plugin               wget -O /dev/null "http://localhost/?wpmlmethod=docron&auth=XXXXXXXX" > /dev/null 2>&1      They provide the following code which I have adapted for my hosting (path to wget being /usr/bin/php I blieve). I've also tried letting wp-cron.php do the job itself, and it fails, I've also tried making a simple server cron job that manually fires wp-cron.php, this worked once and didn't fire again. I'm now testing the latter with a longer schedule. Ahhh! Thanks.


title: How to Show or Hidden Categories on page in Wordpress?

text: I have a problem to resolve. I have wordpress site with 2 pages : Food and Cooking. I have categories : food_categories (1) and cooking_categories (2). I want to show only food_categories on Food page and only cooking_categories on Cooking page. Please help me to resolve it . Thanks all.


title: Wordpress 3.2 - removed ability to select a page template in the page attributes when adding a new page?

text: Maybe it's just the site I'm running but has the 3.2 update removed the ability to select a page template in the page attributes when adding a new page? It's kinda essential unless anyone knows a way around it?


title: how to add a div inside wp_page_menu

text:
Right now I'm using the `<?php wp_page_menu('menu_class=nav'); ?>` function, which gives this result:

      Obviously, in every `li` tag there is an `a` tag; so my goal is to add a `div` tag inside the `li` tag and under the `a` tag. How can I do that? I know that I have to create a function in `functions.php`, but I don't know which one.   Thanks!


title: Do I have to override the wp_mail() pluggable function with writing a plugin?

text: If I want to override wp_password_change_notification, do I have to write a plugin to do this? It seems to have no effect in functions.php of my theme. The only thing I need to do is change the wording to lower case.                   if ( !function_exists('wp_password_change_notification') ) :         /**          * Notify the blog admin of a user changing password, normally via email.          *          * @since 2.7          *          * @param object $user User Object          */         function wp_password_change_notification(&$user) {             // send a copy of password change notification to the admin             // but check to see if it's the admin whose password we're changing, and skip this             if ( $user->user_email != get_option('admin_email') ) {                 $message = sprintf(__('Password lost and changed for user: %s'), $user->user_login) . "\r\n";                 // The blogname option is escaped with esc_html on the way into the database in sanitize_option                 // we want to reverse this for the plain text arena of emails.                 $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);                 wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), $blogname), $message);             }         }          endif;


title: Print WordPress template filename(s) for debugging

text: I've taken over the maintainance of a large WP-MS powered site. The site has ~200 templates, many page specific, and with no standard naming procedure. It would save a lot of time if while surfing around the site I can see the template names which make up the current page. Is this possible? I've looked at the debug plugins for WordPress, but they appear geared towards variables and SQL queries, not templates.


title: How to Automatically jump to the corresponding language of the page using WPML plugin in wordpress

text: I'm setting up a multi-language blog using WPML. I works well using the button to change the language. Is there any way to automatically jump according to the Browser's language? My WPML version is 2.0.4.


title: another post a page problem

text: I have a difficult post a page problem. I have this code :               function wpse31701_4filter_query() {      global $wp_query;      // Check year and month      $wp_query->set('orderby', 'date'); $wp_query->set('order', 'ASC');      if ( $wp_query->get( 'year' ) == 2005 and $wp_query->get( 'monthnum' ) == 9 )          // Check page number to apply offset          if ( $wp_query->get( 'paged') == 2 ) $wp_query->set( 'offset', 1 );          else           if ( $wp_query->get( 'paged') == 3 ) $wp_query->set( 'offset', 2 );          else           if ( $wp_query->get( 'paged') == 4 ) $wp_query->set( 'offset', 3 );          else         if ( $wp_query->get( 'paged') < 8  )              $wp_query->set( 'posts_per_page', 1);       } It's don't work because I get a 500 error. The problem I have it that on the first 8 pages only 1 article is displayed. On the rest the normal number of articles is displayed. Who can help me find out how I get this working. Roelof


title: Are you sure popup on Contact Form 7

text: I have a contact form built with Contact Form 7. What I want to do is when the user hits the submit button to throw up a pop up window with a notice asking if their sure they want to submit the form with an ok or cancel button. I've found the hook 'wpcf7_before_send_mail'. I was hoping there might be something i could do in the additional settings. Something like               wpcf7_before_send_mail: "javascript here"      But when I have tried to just get an action to work like this say:               before_send_mail: "window.alert("hello");"      It just submits the form without doing anything. How would I get a popup to appear with an ok and cancel button, ok submitting form and cancel breaking the action?


title: Get WP_Query query after execution?

text: It it possible to get the configuration of a the latest called WP_Query? I need to use it for debugging. For example, if i run something like:               $the_query = new WP_Query( $args );     ...      Could i get the $args array later by doing something like `$the_query->args();` or something?


title: Changing the loop w/o killing category links

text:
OK. I am going to try to rewrite this. I am trying to use the Gridly theme as a mobile only theme for my site. The problem is the theme pulls all post categories into the main feed when it is formatted for mobile devices. I only want readers to see posts in two categories on the main page, with the option to select other categories from the menu up top. There is no front page php file. The theme only includes the following: > 404 Template (404.php)   >  Comments (comments.php)   >  Footer (footer.php)   >  Theme Functions (functions.php)   >  Header (header.php)   >  Main Index Template (index.php)   >  admin-menu-mark.php   >  admin-menu.php   >  Page Template (page.php)   >  Single Post (single.php) Styles > Stylesheet (style.css) So I modified the `index.php` file to limit the post categories pulled into the homepage by writing `query_posts( 'cat=79,120' )` above the start of the loop ( above: `<?php if (have_posts()) : ?>` ). Doing so limits the main page to those two categories, but also does the same when I click on other categories in the menu. Since it is outside the loop it seems to be overwriting the rest of the rules (?). Here is the code as is: (This is taken from the index file)               <?php get_header(); ?>          <?php if (have_posts()) : ?>
     <?php while (have_posts()) : the_post(); ?>                    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>             <?php if ( has_post_thumbnail() ) { ?>
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail( 'summary-image' );  ?>

<?php the_category(', ') ?>

                    <?php } ?>

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

<?php the_time(get_option('date_format')); ?>
                  <?php the_excerpt(); ?>
<a href="<?php the_permalink() ?>">

               <?php endwhile; ?>
     <?php else : ?>     <?php endif; ?>          <?php next_posts_link('
View Older Entries
') ?>               <?php get_footer(); ?>      Does anyone have any idea how I could only include two categories in the homepage feed without overwriting the rules for the rest of the site?


title: Restrict access to the Trash folder in Posts

text: I want to restrict users from deleting posts permanently. How do I restrict access to the Trash folder in Posts? This is the only page were the users can delete their posts **permanently**. The only solutions that I have so far is: 1) Adding this to stylesheet:               li.trash {         display: none;     }      But both me and you know that this is a dummy fix and more importantly, it just hides the link that goes to the Trash folder for **all** users. 2) Remove the capability `delete_posts` for none-editors. The problem with this is that the users will not be able to move their posts to the trash folder (which is a feature that is essential for my platform). Do you know of a better solution?


title: Check if next post is available and output a link

text:
I'm checking if the next post is available in the same category. If it is, output the link. If it's not, output a static text. I have created a function for this:               function thelink() {         $next_link = next_post_link('%link', 'Next →', TRUE);         if($next_link){             echo $next_link;         } else{             echo 'Next →';         }     }      Then, I list it as follows:               echo '
';     echo '
';     thelink();     echo '
';     echo '
';      The problem is, the output includes both the link AND the static text. It does check for the posts though. Here's what happens: If this is NOT the last post, the output is as following, rendering the Next twice. Once with the link, followed by static text:
Next →Next →
      If this is the last post, the output is just static text:
Next →
      I realize that the problem seems to be in the loop. But I'm out of ideas on how to get this working. Help is VERY much appreciated.


title: alternative to wp_link_pages() that only shows link to last page

text: I plan to have posts with multiple pages that would receive updates (added pages) over time. what i want to do is to display the direct link to the last page of the post on the main index. for example, I have a post split into 4 pages using the tag. what i want to do is that instead of pagination (which I get using wp_link_pages) that looks like this--> [Page 1 2 3 4] I'll only get 1 link and get something that looks like this --> [Jump to Page 4] any way how?


title: Subdomain login problems

text: Tonight I installed a clean copy of WordPress on my local machine, with the intent of trying to set up a subdomain multisite installation. (I've got lots of experience using subdirectories, but this is my first time using subdomains.) I set up the following hostnames in my `/etc/hosts` file:               127.0.0.1 multi     127.0.0.1 snoopy.multi     127.0.0.1 robots.multi      I installed WordPress and set up multisite as per the Codex's Create a Network page. I set up my Apache config so that `snoopy.multi` and `robots.multi` pointed to the same directory as `multi`. I signed in to `http://multi/wp- admin/` and set up sites at `snoopy.multi` and `robots.multi`. Everything worked fine -- the new sites showed up in My Sites. Only I couldn't log in to the subdomains' `/wp-admin`. If I entered the username and password that logged me in to the root site, I'd simply be redirected back to the login page. (Entering a bogus password _did_ trigger the "can't log you in" message, though, which was weird.) I did find a solution, and will post it as an answer here, in case anyone else runs into this issue. (That's kosher, right? I did a search to see if it had been answered before, but didn't find anything that sounded like _exactly_ the same issue. If I'm wrong, please let me know.) **Edit** The solution below is apparently not a complete solution; I can log in to the subdomains' `wp-admin` pages, but now I'm unable to log in to the root site's `wp-admin` pages at `http://multi/wp-admin` . Any advice would be appreciated.


title: How to read newpost return post ID value as integer for xmlrpc

text: I would like to read the $remote_id as integer, $remote_id should be post_id after executing metaweblog.newpost. Does anyone know how to transform the data as integer? Here are the codes below:               $MAINURL = "http://mywordpress.com";     $USERNAME = "username";     $PASSWORD = "password";          function get_response($URL, $context) {     if(!function_exists('curl_init')) {     die ("Curl PHP package not installed\n");     }          /*Initializing CURL*/     $curlHandle = curl_init();          /*The URL to be downloaded is set*/     curl_setopt($curlHandle, CURLOPT_URL, $URL);     curl_setopt($curlHandle, CURLOPT_HEADER, false);     curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));     curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $context);          /*Now execute the CURL, download the URL specified*/     $response = curl_exec($curlHandle);     return $response;     }          /*Creating the metaWeblog.newPost request which takes on five parameters     blogid,     username,     password*/          /*The title of your post*/     $title = "Sample Post from main site";          /*The contents of your post*/     $description = "This is a sample post from main site";          /*Forming the content of blog post*/     $content['title'] = $title;     $content['description'] = $description;     $content['categories'] = array("mycategoryname");     $content['post_status'] = 'publish';  /* 'publish' or 'draft' or 'pending'     /*Whether the post has to be published*/     $toPublish = true;               $request = xmlrpc_encode_request("metaWeblog.newPost",      array(1,$USERNAME, $PASSWORD, $content, $toPublish));          /*Making the request to wordpress XMLRPC of your blog*/     $xmlresponse = get_response($MAINURL."/xmlrpc.php", $request);     $remote_id = xmlrpc_decode($xmlresponse);          echo $remote_id;          $MAINURL = "http://mywordpress.com";     $USERNAME = "username";     $PASSWORD = "password";          function get_response($URL, $context) {     if(!function_exists('curl_init')) {     die ("Curl PHP package not installed\n");     }          /*Initializing CURL*/     $curlHandle = curl_init();          /*The URL to be downloaded is set*/     curl_setopt($curlHandle, CURLOPT_URL, $URL);     curl_setopt($curlHandle, CURLOPT_HEADER, false);     curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));     curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $context);          /*Now execute the CURL, download the URL specified*/     $response = curl_exec($curlHandle);     return $response;     }          /*Creating the metaWeblog.newPost request which takes on five parameters     blogid,     username,     password*/          /*The title of your post*/     $title = "Sample Post from main site";          /*The contents of your post*/     $description = "This is a sample post from main site";          /*Forming the content of blog post*/     $content['title'] = $title;     $content['description'] = $description;     $content['categories'] = array("mycategoryname");     $content['post_status'] = 'publish';  /* 'publish' or 'draft' or 'pending'     /*Whether the post has to be published*/     $toPublish = true;               $request = xmlrpc_encode_request("metaWeblog.newPost",      array(1,$USERNAME, $PASSWORD, $content, $toPublish));          /*Making the request to wordpress XMLRPC of your blog*/     $xmlresponse = get_response($MAINURL."/xmlrpc.php", $request);     $remote_id = xmlrpc_decode($xmlresponse);          echo $remote_id;


title: Fetch the input type date value via ajax

text: I am new to ajax and I've been struggling for 3 days now on how to solve my problem. I am trying to fetch the value of the date input (input type="date" in html)and pass (post method) it to ajax so that it can be processed. My goal is to be able to update a certain post meta value of multiple posts filtered via post date in a specific date range selected by user using an html 5 date input. Currently I only have a button which updates all the post meta value but the date range must be manually entered into the code, I couldn't make it possible to be dynamic where a user can select a date range like update post meta values of posts between April 1, 2013 and May 1, 2013. My working ajax which can run my function is               jQuery(document).ready(function($) {         $('#update-form').submit(function(){             data = {                 action: 'update_beginning_balance'             };             $.post(ajaxurl, data, function(updatebbal) {                 $('#updated-bbal-result').html(updatebbal);             });             return false;         });     });      I tried to use $(#id).val which I referred from here http://api.jquery.com/val/. I hope you could give me some ideas on how to $_POST my input date fields via ajax. Or do you have any idea on how can I accomplish this task without using ajax? I am better with PHP compared to AJAX/JavScript. Thanks


title: Adding a template in WPTouch

text: I am creating a mobile version for a site. For that I am using WPTouch not WPTouch-Pro. Now I want to add a form in my page. For desktop version I used template to add form. But in mobile version it's not working. When I exit mobile version form is present in my page. I saw some post which suggest to add child theme and its for WPTouch-Pro. Since I am new to wordpress I don't have any idea how to solve this problem.


title: Hook functions for Wp e-commerce?

text: I am new to wp e-commerce plugin, I need the following hook function for this plugin   1. customer register success event   2. customer login   3. sales order place after   4. Hook function to change order shipping status from wp-admin end I tried search, but could not found. Kindly advice


title: Search points to /search/?s=KEYWORD instead of /search/KEYWORD

text: I can access my search page and results correctly here /search/KEYWORD but when I click search it points to /search/?s=KEYWORD. I updated my permalinks in the admin.


title: Create page to handle form submission

text: I currently have some custom post types "shops" (actually more like pages than posts) and a custom taxonomy "products" linked to those post types. I'm attempting to create a form (via shortcode) that allows the user to select one (or potentially more in the future) products that when submitted, shows a page listing shops (title and other post meta) related to the chosen product(s). I have the form, just not sure what the best way is to handle the submission and subsequent display page. I noticed the codex page for add_rewrite_endpoint() states > This can be used for all sorts of things: > >   * ajax handler >   * **form submission handler** >   * alternative notification handler > however there's no further information about how to achieve this. Any pointers on handling form submissions would be great. Thanks. **Edit** : Further on this, I want the form submission page to redirect to a nice URL representing the selected term. For example   1. User selects product "books", hits submit   2. Form submits to handling URL **or** some kind of hook catches the submission   3. The browser is redirected to "shops/books"   4. Something displays the "shop" pages tagged with "books" products My question can be broken down to...   1. What URL do I use in the form's `action` attribute? Is this even necessary?   2. Where do I handle the form submission? Do I create a specific file or can I register some kind of action hook. Keep in mind that I'm wanting to send a `Location` header to redirect to another URL so this needs to happen prior to any output sent to the browser.   3. How do I configure _something_ to accept the "shops/%product%" request and show results accordingly Sorry for the long-winded query but I'm struggling to get to grips with the Wordpress API and documentation.


title: How to intergrate wordpress.com with twitter like the way it is with facebook?

text: (Please note this is not a wordpress.org question) Hi everyone, I want every new post on my blog automatically broadcasted on twitter - the same thing is beautifully supproted with facebook. But I cannot find how to activate it on my blog at namgivu.wordpress.com. Please help if you know how to. Thank you!


title: Saving a post, content filtering and user levels

text: I wrote a function to add and insert additional metadata to images. It looks like this:               function add_image_orientation_fields_to_edit($form_fields, $post) {         $current_value = strtolower(get_post_meta($post->ID, 'orientation', true));         $options = array('Portrait','Landscape');              $html = "<select name='attachments[{$post->ID}][orientation]' id='attachments[{$post->ID}][orientation]'>";         foreach($options as $value):             $selected = ($current_value == strtolower($value)) ? ' selected="selected"' : '';             $html .= sprintf('<option value="%s"%s>%s</option>', strtolower($value), $selected, $value);         endforeach;         $html .= "</select>";              $form_fields["orientation"]["label"] = __("Orientation");         $form_fields["orientation"]["input"] = "html";         $form_fields["orientation"]["html"] = $html;              return $form_fields;     }          function add_image_orientation_fields_save($post, $attachment) {         if(isset($attachment['orientation']))             update_post_meta($post['ID'], 'orientation', $attachment['orientation']);         return $post;     }          function image_orientation_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) {         $img_url = wp_get_attachment_url($id);         $orientation = get_post_meta($id, 'orientation', true);         if(isset($orientation)) $orientation = sprintf('data-orientation="%s"', $orientation);         $html = sprintf('<img src="%s" alt="%s" %s/>', $img_url, $alt, $orientation);         return $html;     }          add_filter("attachment_fields_to_edit", "add_image_orientation_fields_to_edit", null, 2);     add_filter("attachment_fields_to_save", "add_image_orientation_fields_save", null, 2);     add_filter("image_send_to_editor", "image_orientation_to_editor", null, 8);      When writing a post, hitting "Insert media", choosing an image and making sure the form field id set gives me a proper image embed. The problem arises when i hit save draft/publish:   * As **super admin** (the blog in question is part of a multisite setup), saving works as intended   * As **administrator** (for that site), it strips my newly created attribute Can anyone explain what's happening here? I've so far spent 2 hours trying to backtrack the maze that is wp-includes. I assume there's some sanitize/filter steps while saving the post that for a reason chooses to remove my attribue, but if so - why does it just happen for the site admin (and not super admin)?


title: Problem with Featured Image and database

text: I have an issue with with WordPress install which I just haven't been able to resolve... I have tried disabling all plugins and reverting back to default theme, but the problem remains. The issue is that when I click the featured image, I can select it, and when I click the 'set featured image' button, the image just doesn't save or appear as set. it also doesn't appear in the post. I have the same issue when trying to 'add media'. I can go through the whole process of adding it, but it doesn;t actually add it to the post. I have also uploaded known good files (worpdress) which has not corrected the issue. This leads me to believe that the issue is with the database. Unfortunately I am not great with mysql databases and although I can see references to attachments and the images in via phpmyadmin, I am unable to troubleshoot it any further as I just do not know enough about mysql databases... I have enabled debug and noticed these errors which may be trying to tell me somthing:               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 D:\virtualservers\easywebc\canariesnews.com\wwwroot\wp-includes\functions.php on line 3006          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 D:\virtualservers\easywebc\canariesnews.com\wwwroot\wp-includes\functions.php on line 3006               WordPress database error: [Duplicate entry '132090' for key 1]     INSERT INTO `wp_postmeta` (`post_id`,`meta_key`,`meta_value`) VALUES (4168,'_edit_lock','1395408463:1')      Any ideas?


title: wp-admin: Sort users by surname

text: ![enter image description here](http://i.stack.imgur.com/bQL3r.png) Is it possible to alter this table in the backend so I can sort users by **Name** and **Surname**? I have dozens of users on my multisite that need to be sorted by Surname. Can anyone help me out here? Kind Regards, Matt


title: new blog post does not appear in blog after publishing

text: I can not see the new post I created for the blog. In Settings > Permalinks > I changed it from Post name to Default and switched from a Theme Trust design to the default theme (twenty twelve). I did not deactivate the plugins. I can still see http://margaretsphotoplace.com/?p=741 but not http://margaretsphotoplace.com/?p=2686


title: Noindex, nofollow stuck on homepage

text: Recently my hosting automatically upgraded our Wordpress version. Due to custom plugin conflicts, we requested them to restore it to the previous version. Our homepage now contains the code "meta name='robots' content='noindex,nofollow' /" (< removed). From Googling, it appears that this code should be added when I visit the Privacy section of Wordpress and select "I would like to block search engines, but allow normal visitors". However, my site is selected as "I would like my site to be visible to everyone, including search engines (like Google, Bing, Technorati) and archivers". I also understand that by default, Wordpress chooses the first option, blocking search engines. I think that at some point during the restore to a previous version, Wordpress has got stuck in the blocking search engine mode. Changing privacy is having no affect on the code. I need a manual way to remove "meta name='robots' content='noindex,nofollow' /" from the homepage - I have no idea where the code is located though.


title: Modify the WordPress admin bar CSS?

text: I want to remove how it adds 32px to the top of the HTML tag. It's dumping it there with a STYLE tag right at the end with !important. It's damn impossible to override it, because there are no hooks or HTML and wordpress is setting it with like 5 css rules :/


title: get custom post type categories

text: From http://codex.wordpress.com:               $categories = get_categories( $args );          $args = array(     'type'                     => 'post',     'child_of'                 => 0,     'parent'                   => '',     'orderby'                  => 'name',     'order'                    => 'ASC',     'hide_empty'               => 1,     'hierarchical'             => 1,     'exclude'                  => '',     'include'                  => '',     'number'                   => '',     'taxonomy'                 => 'category',     'pad_counts'               => false      );       I thought that 'type' was the post type. But not. This is the type of category to retrieve. I've researched without success. So, any idea of how to retrieve all categories assigned to all post of specific post type?


title: SEO implications of assigning a new domain to a multisite subdomain

text: I run Wordpress in Network mode (subdomain), and I have built up a good page rank for one of my subdomain sites. If I register a proper domain name for my network subdomain site, and use the domain mapping plugin to take it from a subdomain of the first site, to being a new domain, does Wordpress do a 301 redirect from the subdomain of the first site to my new domain? Thanks.


title: get_terms returns the keys, but I can't get the values in all languages, Using qTranslate

text:
I am using this code to generate some `<select>` that I display in the sidebar to filter posts depending on the term values (of each select)
         <?php             $types = get_terms( 'tvr_global_amenity', array('hide_empty'=>true) );             $global_amenities = array();             foreach( $types as $type ) :                 $global_amenities[] = $type->name;             endforeach;             if( !empty( $global_amenities ) ) {                 $details = array();                 foreach( $apartments->apartments as $apartment ) {                     foreach( $apartment->apartment_details as $detail => $value ) {                         if(!empty($value)) {                             $details[$detail][] = $value;                         }                     }                 }                 $gaindex = 0;                 foreach( $global_amenities as $field ) {                     /*echo '('.$field.' '.$value.')
'; */                                                             $field_name = str_replace( ' ', '_', strtolower( $field ) );                          /*?>
<?php print_r( $details[$field] )?>
<?*/                          if( !empty( $details[$field] ) ) :                         $details[$field] = array_unique( $details[$field] );                         sort( $details[$field] ); ?>                                                           <?php                             if( qtrans_getLanguage() == 'en' ){ ?>                                 Minimum                             <?php }else if( qtrans_getLanguage() == 'es' ){ ?>                                 Mínimo                             <?php }else { ?>                                 Minimum                             <?php }                                                                           $myname = trim($field);                                       echo $myname ?>
                                 <select name="<?php echo $field_name ?>" class='tvr_apartment_detail'>                                     <?php echo $field ?>                                     <option>0</option>                                     <?php foreach( $details[$field] as $value ) : ?>                                         <option value='<?php echo $value ?>'><?php echo $value ?></option>                                     <?php endforeach ?>                                 </select>
                              <?php                     endif;                 }             }         ?>
      I am using qtranslate, so the term id's and term post's are the same (it's not that wpml that generates different ids for each translation) Any Idea why               if( !empty( $details[$field] ) )      Is returning different among languages? For some reason, I get all the values in spanish but none in english


title: Wordpress comment for virtual page

text: How to create separate comment section for all the virtual pages? Is this even possible? Do I have to create separate table to store the comments and do all the work myself or is there any alternative for that? If I have to create separate table, is there a way to use default wordpress functions in any way? **EDIT:** I haven't probably grasped the concept of custom post type yet or don't understand their power properly. Let me give you an example. Say I have 2 database table. `wp_product_category` and `wp_product`. Each product will have a product_category. There are few products_category and thousands of products. It's not possible to create all the pages manually. So, I have rewritten the URL and all the request is handled by a single page `product`. When someone goes to `product/product-category/` or `product/product-category/product- name`, the page is created comparing the values of `query_var` and making the content and title from the plugin. I don't understand how custom post type can be used in this case. Any direction would be great help.


title: How to pass REQUEST_URI to function

text: I'm trying to build a custom URL with error messages at user registrations, e.g.: `?invalid_username=1` or `?email_exists=1`. I am able to build the front part of the URL manually/statically, with the line `$redirect_url = get_bloginfo('url') . '/register';`. However, sometimes users call the registration site as `/register/?redirect_to=....` and I would like to **keep** the `?redirect_to` argument when adding the (error) arguments. I tried replacing that line with `$redirect_url = get_bloginfo('url') . $_SERVER["REQUEST_URI"]` but apparently this does give me the `REQUEST_URI` from the wp-login: `mydomain.com/wp-login.php?action=register&email_exists=1` Here's the full code:               add_action('register_post', 'register_fail_redirect', 99, 3);          function register_fail_redirect( $sanitized_user_login, $user_email, $errors ){         //this line is copied from register_new_user function of wp-login.php         $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );         //this if check is copied from register_new_user function of wp-login.php         if ( $errors->get_error_code() ){               //setup the custom URL for redirection         $redirect_url = get_bloginfo('url') . '/register'; // <-- THIS works          // BUT I want $redirect_url to be the URL that was called when loading the site                   //add error codes to custom redirection URL one by one             foreach ( $errors->errors as $e => $m ){                 $redirect_url = add_query_arg( $e, '1', $redirect_url );                  }             //add finally, redirect to your custom page with all errors in attributes             wp_redirect( $redirect_url );             exit;            }     }      Appreciate your input!


title: Woocommerce custom fields

text: I'm using woocommerce plugin in my wordpress web site. In Admin panel for products I've added few custom fields as shown bellow: ![enter image description here](http://i.stack.imgur.com/PJ8j6.jpg) On my shop page, I want to print the custom field values, and I use the following code ( my code is inside the `while loop`):                <?php echo get_post_meta(get_the_ID(), 'flavour1Title', true);?>      But I get empty string for any retrieved value. Please can someone explain me what is wrong with my code? Thx!


title: Require file in functions from theme directory using PHP

text: I am trying to dynamically get the facebook php sdk from my current themes folder. I am writing this in my functions.php, but all my attempts break the site. See my attempts below...               require template_url('/') . 'facebook-php-sdk-6c82b3f/src/facebook.php';          require get_bloginfo('template_url') . 'facebook-php-sdk-6c82b3f/src/facebook.php';      Can any one help me understand why this does not work? Thank you very much.


title: wordpress add_rewrite_rule not working

text: I have page on my site named annuaire-membres and i want this with my custom search like this               example.com/annuaire-membres/character/A      or               example.com/annuaire-membres/department/xyz      for this I have use the function               function md_custom_taxonomies_rewrite(){             add_rewrite_tag('%character%','([^&]+)');         add_rewrite_tag('%department%','([^&]+)');         add_rewrite_rule('^annuaire-membres/department/([^/]*)/?','index.php?page_id=27&department=$matches[1]','top');         add_rewrite_rule('^annuaire-membres/character/([^/]*)/?','index.php?page_id=27&character=$matches[1]','top');        }     add_action('init','md_custom_taxonomies_rewrite');      but this is not working any buddy pla help me to solve this


title: Using FlexNav with WordPress

text: Has anyone managed to get the FlexNav plugin - http://jasonweaver.name/lab/flexiblenavigation/ - working with WordPress? I've got an HTML version of the site working fine, but I'm running into trouble when integrating with WordPress as WordPress uses it's own classes, ids etc. on menu items and this seems to override the flexnav plugin. I'm wondering if I should be trying to replicate the menu structure that the plugin creates using a custom walker function, or just re-writing the CSS with what WordPress gives me? Any advice appreciated! Thanks


title: Change in custom taxonomy permalink cause 404 error for another custom taxonomy

text: I have created hierarchy based custom permalinks with help of this link. But now it is causing 404 error on another custom taxonomy used in site. Although I want custom permalinks on this taxonomy also, but if I don't use any rewrite argument and leave it on its default permalink it is still not working. My code for second taxonomy is this:               register_post_type( 'gallery',         array(             'public' => true,             'menu_position' => 15,             'supports' => array( 'title', 'editor', 'comments', 'thumbnail' ),             'taxonomies' => array( '' ),             'menu_icon' => get_template_directory_uri().'/img/icon_gallery.png',         'register_meta_box_cb' => 'add_gallery_metaboxes'         )     );     register_taxonomy('gallery_category','gallery',array(         'hierarchical' => true,         'labels' => $labels       ));      For more assistance am also mentioning my first custom taxonomy code:               register_post_type( 'article',         array(             'public' => true,         'hierarchical' => true,             'menu_position' => 15,             'supports' => array( 'title', 'editor', 'comments', 'thumbnail' ),             'taxonomies' => array( '' ),             'menu_icon' => get_template_directory_uri().'/img/icon_article.png',         'query_var' => true,         'rewrite' => array(                 'slug' => '%article_category%/articles',                 'with_front' => true             ),         'has_archive' => '%article_category%',         'register_meta_box_cb' => 'add_article_metaboxes'         )     );          register_taxonomy('article_category','article',array(       'hierarchical' => true,       'labels' => $labels,       'query_var' => true,       'rewrite' => array('slug' => '', 'hierarchical' => true),     ));      Function for custom permalink:               function filter_post_type_link($link, $post)     {     if ($post->post_type != 'article')         return $link;          if ($cats = get_the_terms($post->ID, 'article_category'))     {         $link = str_replace('%article_category%', get_taxonomy_parents(array_pop($cats)->term_id, 'article_category', false, '/', true), $link); // see custom function defined below     }     return $link;     }     add_filter('post_type_link', 'filter_post_type_link', 10, 2);


title: show tags of custom post type ONLY

text:
I have a custom post type with tags included as a taxonomy, I am trying to display a list of all the tags that are in the custom post type only. I initially used:               wp_tag_cloud();      which generates the list of tags with links fine but it shows the tags of the normal posts with it. I tried to query the posts like this:               query_posts( array( 'post_type' => 'archive' ) );     if ( have_posts() ) :          while ( have_posts() ) :              the_post();             the_tags('

','

','

');             wp_reset_query();         endwhile;      endif;      but it shows the tags in duplicate loads. e.g if I had the tag as `test`, it would say `test`,`test`,`test` and so on. This is the code that declares the tags               'taxonomies' => array('post_tag')      Does anybody know a way of displaying a list of tags that are specific to my custom post type only?