title: Using JQuery to check for Rel Attribute of Image before Overriding It

text: My Wordpress theme (when enabled) overrides the rel value of the link of all images with rel="lightbox" using the following code: http://pastebin.com/Bsh739QY How can I edit the JQuery to check for the rel value first? If the rel value is already set to "lightbox[xyz123]" or "lightbox[xyz-123|abc]" or "lightbox", then the rel value will not be over-written. Thanks!


title: Woocommerce shipping plugin: create checkout error based on validation

text: I'm writing a shipping plugin for Wordpress and I need the ability to display an error to the user and disable the checkout process based on the results of custom validation. I've been using the sample shipping method here as a basis for the plugin: http://docs.woothemes.com/document/shipping-method-api/ I'm not sure how to add a validation check that would be able to accomplish all that.


title: Custom Post Type Order Index Loop

text: I have created a custom post type called 'events'. On the index page, I want to amend the loop to list all posts (standard and events). However, I want to order standard posts by the date it was posted, and I want to order events by a custom field which contains the date of the event. Example:               Standard Post  (Posted on 12th May 2014)     Standard Post  (Posted on 11th May 2014)     Event Post     (10th May 2014)     Standard Post  (Posted on 9th May 2014)     Event Post     (8th May 2014)     Event Post     (7th May 2014)     Standard Post  (Posted on 6th May 2014)      I have added these parameters for query_post on the index.php               <?php        query_posts( array(          'post_type'   => array( 'events', 'post'),         'meta_key'    => 'date_of_event',         'orderby'     => 'meta_value',         'order'       => 'asc',         'meta_query'  => array(             'key'     => 'date_of_event',             'value'   => date("Ymd"),             'compare' => '>=',                       'type'    => 'DATE'                    )         )       );     ?>      At the moment I only have events being returned


title: Clean URL link for page without number

text: This is probably a really noob question, but I can't figure out how to change it. I've created a page called "Photos" and my url link shows:               http://mysite.com/photo-7/      What's with the **-7** and how do I remove this so it is just _photo_?


title: Pull in custom content types into page template

text:
I've looked everywhere for a solution, but have yet to find one. Here is the situation. I've created a custom content type using the plugin `Custom Content Type Manager` and now have need to use these custom post types within pages that I've created in WP. So I created a page called "Photos" and use a template php file to configure the layout / styles of the page. The plugin generated a sample template for me in order to get the custom fields that I've put in. It looks something like this:               get_header(); ?>     <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php the_title(); ?>
             <?php the_content(); ?>             <?php the_author(); ?>
Custom Fields
               Image: <?php list($src, $w, $h) = get_custom_field('image:to_image_array');?>                  <img src="<?php print $src; ?>" height="<?php print $h; ?>" width="<?php print $w ?>" />
          <?php endwhile; // end of the loop. ?>      **The Problem:** When I use "the_content();" and the other php methods, they pull the content from the page called "Photos", and not the content from the custom content type created with this plugin. Is there something I can override / rewrite so that the_content(); from the custom content type shows up instead of the pages' content? Is there a better way I should be doing this other than creating WP pages and using custom templates? I am fairly new to this whole WP programming business..


title: Update content of multiple pages/posts at once?

text: Is this possible? using shortcodes? Custom post type? Custom Fields? CSV upload? Unique content per page. Do not need to create new pages, Just update body of them. Seems like a tough one? Also can this be scheduled. * * * Specifically there are a dozen Horoscope pages, with a paragraph of text. I'd like to update each Horoscope paragraph (replace) with new text daily but leave page intact. Also would be great to schedule these updates.


title: Single reusable value for post meta: Custom Taxonomy or Post Meta?

text: Suppose I have a post meta like "Region" it will contain values like "Region 1", "Region 2" etc. But it should only contain ONE value. Also I would like it to have an archive page. If I use custom taxonomy, users can select more than 1 value. Is it possible to have a drop down type selection instead?


title: Make view count for pop up post

text: I'm using SimpleModal to allow users to click on a post excerpt on my homepage and popup a box showing the full post. However it doesn't count for an actual view of the post when this happens. Is there a way to make wordpress recognize it as a view? I'm using wp-postviews to track view counts.


title: Unable to upload data to Media Libary

text: I uploaded wordpress to my server. Everything works fine so far. But when I try to upload data to my media libary nothing happens. Doesn't matter if I click the "Select Files" or "browser uploader" just nothing happens. I never had those kind of problems before. The permission for the wp-content/uploads/ folder is on 777. I have absolutely no conclusion what could be the problem here? Any suggestions? Regards, Nils


title: How to split <p> text text text </p> into array

text:
I like to output and style in a shortcode, but the content that is get is the content of a page, so it's style like that
2012-12-12

2012-6-23

2012-7-3
      i like to be able to have ONLY the value date in a array to be able to output it in a unorder list after how do i do that (strip the p and get it into an array ? some code :               //Add a SHORTCODE to get date listing     add_shortcode ('getdate','get_date_listing');        function get_date_listing ($att) {            $req_id = 901;            $post = get_page($req_id);             $content = apply_filters('the_content', $post->post_content);                 $contentarray = explode( '\n', $content );            echo ($contentarray[0]);            //var_dump ($contentarray);            //return $content;        }


title: My custom query not detecting the correct category

text:
For category.php my custom query code isn't displaying the posts from the correct category. I have a parent category called 'Blog' and it can have any number of unknown children. With that in mind I'm trying to automate my loop so it can detect the category and display just the articles for that category (even though the name of which is unknown).

                  <?php             global $paged;             global $post;             $do_not_duplicate = array();             $categories = get_the_category();             $category = $categories[0];             $cat_ID = $category->cat_ID;             $myposts = get_posts('category='.$cat_ID.'&paged='.$paged);             $do_not_duplicate[] = $post->ID;             $c = 0;             ?>                  <?php foreach($myposts as $post) : setup_postdata($post); $c++;                 if( $c % 2 == 0) {                     $style = 'even animated fadeIn';                     $c = 0;                 }                 else $style='animated fadeIn'; ?>                      <article id="post-<?php the_ID(); ?>" <?php post_class($style) ?>>                         <a class="article-block" href="<?php the_permalink(); ?>">                         <?php if ( has_post_thumbnail() ) { ?>
                             <?php $category = get_the_category(); echo $category[1]->cat_name;?>

                                             Read more

                                                               <?php the_post_thumbnail('full'); ?>
                         <?php } ?>

<?php the_title(); ?>
                             <?php the_content('Read more'); ?>

                  <?php endforeach; ?>

Loading Posts...
                 <button class="load-more button">Load More</button>


title: Trying to wrap <span> around first word of multiple word strings with a widget_title() filter, only works on two word strings and not more than two

text: I am trying to wrap a around the first word of multiple word widget titles. I have used the answer from here: http://stackoverflow.com/questions/10263792/revised-wordpress-function-to-put- a-span-around-the-first-word-of-the-title and adjusted it to look like:               function add_label_to_post_title( $title = '' ) {         $ARR_title = explode(" ", $title);              if(sizeof($ARR_title) > 1 ) {             $first_word = "".$ARR_title['0']." ";             unset($ARR_title['0']);             return $first_word. implode(" ", $ARR_title);         } else {             return $title;         }     }          add_filter( 'widget_title', 'add_label_to_post_title' );     add_filter( 'the_title', 'add_label_to_post_title' );      and it works great on two word titles. However 3 or more word titles are not affected. I tried modifying the code with:               preg_replace('/(?<=\>)\b\w*\b|^\w*\b/', '$0', $string);      from here: http://stackoverflow.com/questions/10833435/wrap-b-tag-around-first-word-of- string-with-preg-replace and had the same result, works great on two word titles but three or more are not affected. Does anyone have any idea why? I am also using this for:               the_title();      And it works xactly as expected. Also if I use:               echo add_label_to_post_title('any multiple word string with more than two words');      it also works exactly as expected. I tried using:               add_filter('widget_title', my_title);          function my_title($title) {     // Cut the title to 2 parts     $title_parts = explode(' ', $title, 2);          // Throw first word inside a span     $title = ''.$title_parts[0].'';          // Add the remaining words if any     if(isset($title_parts[1]))         $title .= ' '.$title_parts[1];          return $title;     }      from Insert a span inside widget title to give a different color to the second word and I had the same result, it worked for up to 2 word strings but 3 or more words it does not work. Does any one know what it is about the:               widget_title();      that is making this function act funny?


title: Is that possible put a whole POST in a list ,<li>

text:
I want a whole post content into a list. The result i want like this:

the fist Post

the second Post

the third Post

      I try several times, just doesn't work. here is my php for get posts:               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>         <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>"><?php the_title(); ?>

                 <?php the_content(); ?>

                 <?php the_tags('Tags: ', ', ', '
'); ?>                 Posted in <?php the_category(', ') ?> |                  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

     <?php endwhile; ?>     <?php else : ?>
Not Found
     <?php endif; ?>      Thanks a lot :)


title: SSL not working for checkout

text: i configured an ssl certificate (geotrust through namecheap) for apache on amazon ec2 following instructions at http://splittingelectrons.wordpress.com/2012/02/24/how-to-configure-an-ssl- certificate-for-apache-on-amazon-ec2/ , but then when i try to access the checkout page (the only page that's set up to have https), the page simply says "This webpage is not available" (we are using woocommerce). the rest of the site navigates fine, it's just when i try to go to the checkout page that nothing is loading. any help would be much appreciated!


title: Is there a way to force Featured image to show as attachement?

text: When adding an image as a featured image to a post - if the image is an existing image in the Media Library, then the image is not added as a true attachment but as a thumbnail, shown like this in the JSON feed:               "attachments": [],     "comment_count": 1,     "comment_status": "open",     "thumbnail": "http://sitename.com/wp-content/uploads/image.png"      but if the image is not added from the Library, but uploaded then it is added as an attachment and a thumbnail - shown like this:               "attachments": [                     {                         "id": 8,                         "url": "http://sitename.com/wp-content/uploads/image.png",                         "slug": "evac",                         "title": "evac",                         "description": "",                         "caption": "",                         "parent": 1,                         "mime_type": "image/jpeg",                         "images": {                             "full": {                                 "url": "http://sitename.com/wp-content/uploads/image.png",                                 "width": 1280,                                 "height": 720                             },                             "thumbnail": {                                 "url": "http://sitename.com/wp-content/uploads/image-150x150.png",                                 "width": 150,                                 "height": 150                             },                             "medium": {                                 "url": "http://sitename.com/wp-content/uploads/image-300x168.png",                                 "width": 300,                                 "height": 168                             },                             "large": {                                 "url": "http://sitename.com/wp-content/uploads/image-1024x576.png",                                 "width": 625,                                 "height": 351                             },                             "post-thumbnail": {                                 "url": "http://sitename.com/wp-content/uploads/image-624x351.png",                                 "width": 624,                                 "height": 351                             }                         }                     }                 ],     "comment_count": 1,     "comment_status": "open",     "thumbnail": "http://sitename.com/wp-content/uploads/image-624x351.png"      Any suggestions why this would be and if there is a solution to have the feature image shown the same way in either circumstance? This is a clean install, and the only plugin i am using is the JSON API plugin. **Edit:** Also noticed that when selecting a post Featured image that is already loaded into the Media Library, that image show "Unattached" in the "Uploaded to" column in the Media Library - I think this is where the discrepancy starts. Whereas when uploading it, it shows it being attached to that specific post.


title: Using Custom Fields in Custom Post Type URL

text: I'm developing a car site that has showrooms. Each showroom needs it's own custom URL based on it's location. The location (City and County/State) is already inserted as two custom fields. So for example, if it's "Showroom A", located in Liverpool, Merseyside, it's URL would be the following:- http://www.domain.com/location/merseyside/liverpool/showroom-a/ I have a custom post type of "Showroom", that has it's rewrite rules set to false (though it was previously set to true earlier in the test). However when I create the post in question, there's an issue. The permalink is given as everything BAR the name of the showroom (i.e. http://www.domain.com/location/merseyside/liverpool/). Visting this URL causes a 404 error, and even adding "showroom-a" (for example) to the end of the code (http://www.domain.com/location/merseyside/liverpool/showroom-a/), also causes a 404 error. Here is my code.               function add_rewrite_rules()     {         // Register custom rewrite rules              global $wp_rewrite;              $wp_rewrite->add_rewrite_tag('%showroom%', '([^/]+)', 'showroom=');         $wp_rewrite->add_rewrite_tag('%post_custom_data%', '([^/]+)', 'post_custom_data=');         $wp_rewrite->add_permastruct('showroom', 'location/%post_custom_data%', false);          }                              function permalinks($permalink, $post, $leavename)     {         $no_data = 'no-data';         $post_id = $post->ID;              if($post->post_type != 'showroom' || empty($permalink) || in_array($post->post_status, array('draft', 'pending', 'auto-draft')))                  return $permalink;                        $state = sanitize_title_with_dashes(get_post_meta($post_id, 'state', true));         $city =  sanitize_title_with_dashes(get_post_meta($post_id, 'city', true));         $data = $state . "/" . $city;              if(!$data)                  $data = $no_data;                   $permalink = str_replace('%post_custom_data%', $data, $permalink);                        return $permalink;          }          add_action('init', 'add_rewrite_rules');     add_filter('post_type_link', 'permalinks', 10, 3);      Any ideas or help would be appreciated :)


title: Firing a function AFTER redirect

text: I am using a function that redirects the user to a custom page, rather than wp-login in the event of errors. In my case I am using the Http Referer function to send the user back to the same page because I have the login form in a modal. How can I execute a function on the redirected page, so that the page automatically opens the modal? This is the code for the redirect in the event of an error:               add_filter('login_redirect', '_catch_login_error', 10, 3);     function _catch_login_error($redir1, $redir2, $wperr_user) {         $rurl = $_SERVER['HTTP_REFERER'];         if(!is_wp_error($wperr_user) || !$wperr_user->get_error_code()) return $redir1;             switch($wperr_user->get_error_code()) {                 case 'incorrect_password':                  case 'empty_password':                  case 'invalid_username':                  default: wp_redirect($rurl); }             return $redir1;          }      This code courtesy of http://projectivemotion.com/2011/12/16/redirect-failed- login-attempt-wordpress/#comment-653 The function I want to execute after redirect is:               add_action('genesis_before_post', 'force_open_modal_1');     function force_open_modal_1() { ?>         <script type="text/javascript">         jQuery(document).ready(function($){             $('#loginmodal').reveal();         });         </script>     <?php }      Is this possible?


title: Google Authorship on a multi-author blog?

text: I hav been having some difficulties getting authorship set up for a multi- author blog. Everything appears to be set up correctly, but I am wondering if having multiple rel="author" tags on the home page is preventing the Google+ Profile of the main author from appearing in search results. By default, the wordpress theme I am using uses 'the_author_posts_link()' when linking to other blog posts on the home page. and internal pages.(this automatically adds 'rel="author"' to the link). Although, there is only 1 author profile who is actually linking to his Google+ Profile could have so many `rel="author"` tags be preventing his blog posts from displaying his Google+ Profile photo in the search results? On the specific posts of the author who I am attempting to have Google authorship for, his link looks like this:                     this link appears in the author box at the end of the authors' post. When testing a url of a post by the said author in the rich-snippets-tool, everything looks great. However, it doesn't appear that way in the search results. I have tried several configurations of this, including using plugins and having the author link in the . Any advice or suggestions are much appreciated. thanks.


title: If Post Meta Equals Current Title Conditional Advanced Custom Fields

text: I would like to create a custom query loop to display data depending on the current post title. Pseudo-code:               if post title = custom filed          Show related content      I have a page called `artists` made up of custom fields and I would like to show the discography for that artist. By pulling only the posts with the artists name from the discography posts which are in another custom post type. I found this page which is close but not quite right. I have a custom post type called `discography`, and within this post type I have a custom field called `dis_artist`. I am stuck being able to say if the current artist "post title" = "dis_artist" then show other data. How can I do that? * * * Hi I tried but Im not sure I have the right syntax. This piece of code sits within the current post loop               <?php     $args = array( 'post_type' => 'discography', 'posts_per_page' => -1 );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post(); ?>                 <?php     if ( get_the_title() === get_post_meta( get_the_ID(), "dis_artist", true ) ) {   ?>     <?php the_title(); ?>     <?php }    ?>             <?php endwhile; ?>


title: Get date of last update outside of loop

text: I'm trying to figure out how to display the date that a post was last updated outside of the loop. I'm able to display the published date using `get_the_time()` but there doesn't seem to be a "loopless" function to get the date of the last update. Does anyone know hot to do this?


title: How to place an image into header.php?

text:
I'm trying to customize twentyten theme.   this is part of header.php:               <body <?php body_class(); ?>>

           //this img I cannot insert  !
      No errors. Simply - nothing happens.


title: How do I allow users to follow a post and then allow admins to email all users who have followed that post?

text: I'm looking to build out the following functionality, but I'm having trouble finding any help on it: user follows a post > user's email is pulled into an admin page and associated with said post > admin can then email all users who have followed a single post, updating them when a significant change has been made I'd appreciate any insights you have!


title: An alternative to Wordpress's built-in menu functionality

text: The main menu on my site contains about 30 items, and I am no longer able to save it. This seems to be a fairly common problem with bigger menus in Wordpress. I am on a dedicated server with very generous settings for PHP memory and execution time, but past a certain size, I just can't get menus to save. So, I need an alternative to Wordpress's built-in menu system. I want to keep the setup as flexible and quick to edit as possible. I can edit a flat file if need be, but the easier the better. ## Idea #1 Copy the menu's HTML into a static template file and replace calls to `wp_nav_menu()` with `get_template_part('my_menu_file')`. ## Problem I don't know how I would add `current-menu-item` class to the current menu item. I could live without the other utility CSS classes added by `wp_nav_menu`, but `current-menu-item` is pretty important. ## Idea #2 Since the menu is hierarchical, I could create one menu for the top-level items and separate menus for each dropdown, and then use a plugin like UberMenu to attach the submenus to their top-level items. ## Problem I would have to do a lot of tweaking and retrofitting to get the plugin- generated menu to look identical to the current menu. Are there other approaches or solutions that would make sense here?


title: Wordpress Categories from Plugin

text: I've got the Owl Carousel plugin installed, inside of it I can create some categories. Now I'd like to have these Owl Carousel categories displayed on the site, not the regular categories. What you see on the site right now is the regular categories such as 'Uncategorised' which is created from within the POSTS area of wp-admin. i tried using this but still just shows the wrong list of cateogies:               <?php wp_list_categories(               $args = array(               'post_type' => 'owl-carousel'              )      ); ?>       ![enter image description here](http://i.stack.imgur.com/RtKRC.png)   Regular categories page - ![enter image description here](http://i.stack.imgur.com/YTpDn.png) Owl Carousel Categories page   ![enter image description here](http://i.stack.imgur.com/faW7B.png)


title: Force multisite to use subdirectories on previous wordpress installation

text: Is it possible to force multi site to use subdirectories on the previous installation without affecting anything, as I am using godaddy shared hosting and it doesn't support subdomains on multisite on shared hosting. When I enabled multisite on the previous installation, it is only giving the options to multisite using subdomains & wordpress doesn't support it on shared hosting. Thus, i am unable to get multisite working on my wordpress blog.


title: Loop Navigation Problem

text:
currently I have a loop on my index page which is set to show upcoming posts in ascending order. This is an events listing page. However the pagination at the bottom of my page doesn't work, I am not sure why but clicking on page 2 or page 3 etc will change the URL to /page/x/ but it will still show the first page of results. here is my index.php
                      <?php function filter_where($where = '') {                      $where .= " AND post_date > '" . date('Y-m-d', strtotime('0 days')) . "'";                      return $where;                      }                 add_filter('posts_where', 'filter_where');?>                      <?php query_posts('&order=ASC'); ?>                 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                      <div <?php post_class('eventlisting') ; ?>>                              <?php if (has_post_thumbnail()) : ?>                         <?php the_post_thumbnail(); ?>                         <?php endif; ?>

<?php the_title(); ?>
                             <?php if ( get_post_meta($post->ID, 'event-subtitle') ) :  ?>
<?php echo get_post_meta($post->ID, 'event-subtitle', true); ?>
                             <?php endif; ?>                             <?php if ( get_post_meta($post->ID, 'event-guests') ) :  ?>
<?php echo get_post_meta($post->ID, 'event-guests', true); ?>
                             <?php endif; ?>
<?php the_time('D d M Y');?>

<?php the_time('H:i');?>

<?php the_excerpt(); ?>
                             <?php if ( get_post_meta($post->ID, 'event-venue') ) :  ?>
<?php echo get_post_meta($post->ID, 'event-venue', true); ?>
                             <?php endif; ?>                             <?php if ( get_post_meta($post->ID, 'event-city') ) :  ?>
<?php echo get_post_meta($post->ID, 'event-city', true); ?>
                             <?php endif; ?>                             <?php if ( get_post_meta($post->ID, 'event-price') ) : ?>
<?php echo get_post_meta($post->ID, 'event-price', true); ?>
                             <?php endif; ?>

                                  <a href="<?php the_permalink();?>">» More Info                             <?php if ( get_post_meta($post->ID, 'event-link') ) :  ?>                                   <a class="buynow" href="<?php echo get_post_meta($post->ID, 'event-link', true); ?>">Buy Tickets                             <?php endif; ?>

                           <?php endwhile; ?>                          <?php numeric_pagination(); ?>                          <?php else : ?>
Nothing Found

Sorry, but you are looking for something that isn't here

<a href="<?php echo get_option('home'); ?>">Return To Homepage
                          <?php endif; ?>
       and here is the function I am using for my pagination.               // ************************************     // NUMERIC NAVIGATION     // ************************************          function numeric_pagination() {              if( is_singular() )             return;              global $wp_query;              if( $wp_query->max_num_pages <= 1 )             return;              $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;         $max   = intval( $wp_query->max_num_pages );              if ( $paged >= 1 )             $links[] = $paged;              if ( $paged >= 3 ) {             $links[] = $paged - 1;             $links[] = $paged - 2;         }              if ( ( $paged + 2 ) <= $max ) {             $links[] = $paged + 2;             $links[] = $paged + 1;         }              echo '

' . "\n";              /** Link to first page, plus ellipses if necessary */         if ( ! in_array( 1, $links ) ) {             $class = 1 == $paged ? ' class="active"' : '';                  printf( '
%s
' . "\n", $class, esc_url( get_pagenum_link( 1 ) ), '1' );                  if ( ! in_array( 2, $links ) )                 echo '
…
';         }              /** Link to current page, plus 2 pages in either direction if necessary */         sort( $links );         foreach ( (array) $links as $link ) {             $class = $paged == $link ? ' class="active"' : '';             printf( '
%s
' . "\n", $class, esc_url( get_pagenum_link( $link ) ), $link );         }              /** Link to last page, plus ellipses if necessary */         if ( ! in_array( $max, $links ) ) {             if ( ! in_array( $max - 1, $links ) )                 echo '
…
' . "\n";                  $class = $paged == $max ? ' class="active"' : '';             printf( '
%s
' . "\n", $class, esc_url( get_pagenum_link( $max ) ), $max );         }              echo '

' . "\n";          }      Any help would be greatly appreciated.


title: Limit comments per user per post

text: I use this code to limit the comments to 1 for registers users and works fine. The problem is that when i click to "go back" button in the browser i can comment again. Is there any effective way to limit the comments? Thank you!               global $current_user, $post;     $args = array( 'user_id' => $current_user->ID, 'post_id' => $post->ID );     $usercomment = get_comments( $args );     if ( 1 <= count( $usercomment ) ) {         echo 'disabled';     } else {         comment_form();     }


title: How to close tab automatically if URL has specific word?

text: help me today. Is it possible to close the tab automatically after loading/few seconds after checking if URL address has specific words? e.g; `http://mysite.com/post.php?deleted=1` Here `?deleted=1` is the word I'd like to check. I'm on wordpress. Thank you.


title: __() translation function throwing error when used within an associative array

text: This is what I am trying to do :               $meta_display_data = array(         'azc_publication_date'  => array('placeholder' => __('Date de l\'article', 'azc-publication')),         'azc_publication_title' => array('placeholder' => __('Titre de la revue', 'azc-publication')),         'azc_publication_link'  => array('placeholder' => __('Lien vers l\'article', 'azc-publication')),     );      But on line 2, 3 and 4 (the content of my associative array) Apache returns :               Parse error: syntax error, unexpected '(', expecting ')'      I am not sure why this wouldn't work. Is there a specific way to use the `__()` function to populate an associative array in Wordpress? Outputting the strings directly, the code is working fine, so the parenthesis issue does come from the `__()` function. Thanks a lot for clarifications.


title: How to add custom taxonomy terms to posts in bulk

text: I have a taxonomy called Teams. Now I want to assign different teams to posts based on their tags. For example, all posts with tag "LA Lakers" should be assigned the taxonomy term "LA Lakers"


title: Uploaded Images not re-sized to ( Thumbnail, Medium, and Large ) size

text: I have a WordPress site that was working perfect before moving to a new server, The problem is when I upload any image it uses the original size in all places in my website ( means no re-size for the image - Thumbnail, Medium, and Large), I use FTP to access the Upload folder and I found the original image only without (Thumbnail, Medium, and Large size). I checked my Media Setting and its okay without any problem, I hope someone could help.


title: Intergrating agile carousel to wordpress: how to write the ajax_callback function

text:
json is totally new to me how to write an ajax_callback function for agile carousel to work in wordpress? Below is the jason data format that I need to write as php arrays for it could be parsed by $.getJSON() function.                [{           "content": "

",           "content_button": "

 Place Holder
"     }, {           "content": "

",           "content_button": "

 Place Holder
"     }]      Or do I even have to convert the data into php arrays?


title: Enqueue jQuery UI Tabs In Admin Area

text: Does anyone know how to enqueue the script "Jquery UI Tabs" in admin area? I want to use it inside my theme options page. Already read the related wordpress documentation but with no results... I have added UI Tabs to the front-end and works fine but I cant add it in the admin area... Thanks in advance.


title: How can I add (custom) modules to Appearance -> Menus?

text: Does anyone know how I can add (custom) modules to Appearance -> Menus? (Or has a link with explanation on how to do this) so that when people change their menu in the backend they can choose what to add to their menu (Pages - Post - Links - Categories - Tags - [custom module]) I ask this question because I want to build a one-page theme. I want to be able to add `<section>`s to the templates to separate the different 'pages'.   The (rough) idea I have, is create a function which 'scans' trough the templates, isolates the section ID's of these sections, and add them as a menu module to the backend. That way people would be able to add a menu item to one of these sections to their menus.


title: Looking up WordPress account information from Host or php files

text: I recently started working at a company where they would like their webpage to be updated. Unfortuantely, I only have the hosting information and the files that are associated with the FTP manager. The webpage loads and is running, but no one knows the WordPress account that it is linked to. The one they thought it was is not the the right one. It is for this website, http://adventcapitalpartners.com. Their company has a lot of email addresses, and I have tried entering a few different ones into Wordpress to see if they could recover the username/password without any luck. They use a theme purchased from ProPhotoBlogs.com and I do have all the coding files there. Is there a way that I can look up the username or email through the coding files? Or even the MySQL files? Kind of desperate for some ideas here, as nothing seems to be working! lol


title: Please help me to win the battle with 2 column loop by category

text: I need help with this code. How can I change the code so that the posts from one category to be arranged like the this scheme. scheme picture                   <?php query_posts('cat=3&showposts=1'); ?>         <?php while(have_posts()) : ?>         <?php         $postcount++;         if( ($postcount % 2) == 0 ) : // skip 'even' posts             $wp_query->next_post();         else :         ?>         <?php the_post(); ?>                                  <?php if ( function_exists( 'get_the_image' ) ) { get_the_image( array( 'custom_key' => array( 'post_thumbnail' ), 'default_size' => 'full','image_class' => 'alignleft', 'width' => '120', 'height' => '120' ) ); } ?>                   <?php endif; ?>         <?php endwhile; ?>         </div>              <?php $postcount = 0; rewind_posts(); ?>              <div class="even-column">         <?php query_posts('cat=3&showposts=2'); ?>         <?php while(have_posts()) : ?>         <?php         $postcount++;         if( ($postcount % 2) != 0 ) : // skip 'odd' posts             $wp_query->next_post();         else :         ?>         <?php the_post(); ?>                                  <?php if ( function_exists( 'get_the_image' ) ) { get_the_image( array( 'custom_key' => array( 'post_thumbnail' ), 'default_size' => 'full', 'image_class' => 'alignleft', 'width' => '60', 'height' => '60' ) ); } ?>              <?php endif; ?>         <?php endwhile; ?>         </div>


title: Missing tabs in my dashboard

text: I am a newbie to wordpress and I am trying to create a theme from scratch. Some tabs (e.g Users, Appearance->Widgets) are missing in the dashboard. I have manually added admin user via phpmyAdmin and I have added the following value for `wp_capabilities`               a:1:{s:13:"administrator";s:1:"1";}.       I have also added `wp_user_level` with a meta value of `10` How can I make the tabs to display


title: List Sub-Categories of a Parent Category

text: I need to be able to list categories that are the sub-category of a specific category that is a sub-category of a primary category. So something like this: Print Categories where ParentCategory = 'Parent' And ParentCategoriesParent = 'Main Parent' So I guess it's a depth of 2. Kind of a complicated category i'm going for but it will help my users navigate the site much easier.


title: How to create several Post pages

text: I have a question regarding the Posts.. When I create a new Post it will display on the Home page and not for ex. in the photogallery page where I want to have it... Is there any way how to define where I want to situate the post? Sorry if this is too easy but I´m beginner with wordpress.. I have bought a theme(site) Photopassion from the themeforrest, we have installed Wordpress and also the theme and it works fine just this is not clear to me.. Could you help please? Thank you in advace Lenka


title: Querying the DB to get sum of column from custom meta box (only published posts)

text: I am trying to get the SUM total of a custom meta box, from all published posts, from a custom post type. By using `$wpdb` I am able to get the sum from all of the posts (published and otherwise), but how do I extend my `$wpdb` query to fetch only the published posts?               global $wpdb;     $meta_key = 'rsvp-qty';     $all_guests = $wpdb->get_var( $wpdb->prepare(         "             SELECT sum(meta_value)             FROM $wpdb->postmeta             WHERE meta_key = %s         ",         $meta_key     ) );


title: Disappearing items in menu

text: I have problem with disappearing items in menu. I added               php_value max_input_vars 7000     php_value suhosin.post.max_vars 7000     php_value suhosin.request.max_vars 7000      to my .htaccess but it doesn't help. Can you help me?


title: Hard coded main navigation

text:
Theme twentyeleven Version 1.5 * * * # HELP PLEASE _I have received an answer from @Mayeenul Islam but this has not resolved my question, if I can't make the navigation show active that's not the end of the world but I would really like to resolve the **title** and **name** issue below using what I have coded._ I have tried my hardest to find the answer myself. PHP Novice ;o/ * * * As I can't find a way to style the blogs main navigation to match clients main site I have removed this:
<?php _e( 'Main menu', 'twentyeleven' ); ?>
                 <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?>

<a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?>
                 <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>                 <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>                   and replaced with this:

<a href="<?php echo esc_url( get_permalink( get_page_by_path( 'the-blx' ) ) ); ?>">Home

|

<a href="<?php echo esc_url( get_permalink( get_page_by_path( 'what-the-blx-does' ) ) ); ?>">What The BLX Does

|

<a href="<?php echo get_category_link( get_category_by_slug( 'business-finance' ) ); ?>">Business Finance

|

<a href="<?php echo get_category_link( get_category_by_slug( 'business-general' ) ); ?>">Business General

|

<a href="<?php echo get_category_link( get_category_by_slug( 'blx-news' ) ); ?>">BLX News

|

<a href="<?php echo get_category_link( get_category_by_slug( 'book-of-blx' ) ); ?>">Book of BLX

|

<a href="<?php echo get_category_link( get_category_by_slug( 'johns-rant' ) ); ?>">John’s Rant

                   The BLX is set in the reading settings> A static page> Post page. Now I have three issue: **STYLING** 1) The #access ID in style.css was setting the font as bold when on that page but has stopped working.               #access .current-menu-item > a,     #access .current-menu-ancestor > a,     #access .current_page_item > a,     #access .current_page_ancestor > a {     font-weight: bold;     }      **CODING** For Page and Category - instead of have What The BLX Does (page) or Business (category)                   1) I would like to pass the page title         2) I would like to pass the a href title tag      So it would be something like this.
<a href="<?php echo esc_url( get_permalink( get_page_by_path( 'what-the-blx-does' ) ) ); ?>" title="<?php get_page_by_title( );?>"><?php get_page_by_title( );?>

<a href="<?php echo get_category_link( get_category_by_slug( 'business-general' ) ); ?>"  title="<?php get_category_by_title( );?>"><?php get_category_by_title( );?>
      Any help would be greatly appreciated. Thanks Dave


title: get_post_meta with WP_query

text:
I know this is a convoluted loop (inherited from someone else), and this must be pretty simple: `the_permalink` and `the_title` display OK, but why doesn't my post meta `eventdatestart` echo?.               <?php     $queryObject = new WP_Query( 'post_type=events&posts_per_page=5' );     if ($queryObject->have_posts()) {     ?>

Events

             <?php         while ($queryObject->have_posts()) {             $queryObject->the_post();             ?>
          <a href="<?php the_permalink(); ?>"><?php the_title(); ?>          <?php echo get_post_meta(get_the_ID(), 'eventdatestart', true );?>
         <?php         }         ?>

         <?php     }     ?>


title: Hide WooCommerce out of stock product attribute items

text: I've created an attribute for WooCommerce products: size, it has three items, size1, size2 and size3. I can use `get_terms('pa_size', 'orderby=name&hide_empty=1');` to get size attribute items. Now size3 is out of stock but get_terms function returns it. How can I get only items that are in stock(only size1 and size2)?


title: Can posts_nav_link show post titles?

text: I have an index.php page that is only displaying 1 post at a time with a query. (found this code online, but it does work)               $page  = (get_query_var('paged')) ? get_query_var('paged') : 1;          // if we are paging     if ($page == 1) {         query_posts('order=DESC&posts_per_page=1&paged=$page');     } else {         $numposts  = get_option('posts_per_page');          // work out offset     $offset = (($page -1) * $numposts); // i.e. page 2 - 1 = 1 * 10 (10 for the number of posts)          query_posts("&order=DESC&offset=$offset&paged=$page&showposts=$numposts");      } This correctly shows one post per page, and it displays the navigation on the bottom of my template when I put a `<?php posts_nav_link(); ?>` in there. Is there anyway to change the "Next Page" and "Previous Page" links to be the titles of the posts themselves?


title: Adding upload button in metabox

text:
I want to add upload image button for the images and retrieve url. Can someone pls help me, i have been trying this for quite a few days. I'm using code from this thread Create more Meta Boxes as needed.               add_action( 'add_meta_boxes', 'dynamic_add_custom_box' );          /* Do something with the data entered */     add_action( 'save_post', 'dynamic_save_postdata' );          /* Adds a box to the main column on the Post and Page edit screens */     function dynamic_add_custom_box() {         add_meta_box(             'dynamic_sectionid',             __( 'Client Information', 'myplugin_textdomain' ),             'dynamic_inner_custom_box',             'page');     }          /* Prints the box content */     function dynamic_inner_custom_box() {         global $post;         // Use nonce for verification         wp_nonce_field( plugin_basename( __FILE__ ), 'dynamicMeta_noncename' );         ?>
         <?php              //get the saved meta as an arry         $ourwork = get_post_meta($post->ID,'ourwork',true);              $c = 0;         if ( is_array( $ourwork ) ) {             foreach( $ourwork as  $track ) {                 if ( isset( $track['thumb'] ) || isset( $track['client-img1'] ) || isset( $track['client-img2'] ) || isset( $track['client-img3'] ) || isset( $track['client-img4'] ) || isset( $track['client-desc'] ) ) {                     printf( '
Thumb Image  : <input type="button" name="ourwork[%1$s][thumb]" value="%2$s" size="50" />

Client Image 1 : <input type="button" name="ourwork[%1$s][client-img1]" value="%3$s" size="50" />

                     Client Image 2 : <input type="button" name="ourwork[%1$s][client-img2]" value="%4$s" size="50"/>

                     Client Image 3 : <input type="button" name="ourwork[%1$s][client-img3]" value="%5$s" size="50" />

                     Client Image 4 : <input type="button" name="ourwork[%1$s][client-img4]" value="%6$s" size="50" />

                     Client Link     1 : <input type="text" name="ourwork[%1$s][client-link1]" value="%7$s" size="50" />

                     client Description :
<textarea id="elm1" class="tinymce_data" name="ourwork[%1$s][client-desc]" cols="75" rows="6" >%8$s</textarea>
                     %9$s
', $c, $track['thumb'], $track['client-img1'], $track['client-img2'] , $track['client-img3'], $track['client-img4'], $track['client-link1'], $track['client-desc'],  __( 'Remove Section' ) );                     $c = $c +1;                 }             }         }         ?>          <?php _e('Add Section'); ?>
<?php          }          /* When the post is saved, saves our custom data */     function dynamic_save_postdata( $post_id ) {         // verify if this is an auto save routine.          // If it is our form has not been submitted, so we dont want to do anything         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )              return $post_id;              // verify this came from the our screen and with proper authorization,         // because save_post can be triggered at other times         if ( !isset( $_POST['dynamicMeta_noncename'] ) )             return;              if ( !wp_verify_nonce( $_POST['dynamicMeta_noncename'], plugin_basename( __FILE__ ) ) )             return;              // OK, we're authenticated: we need to find and save the data              $ourwork = $_POST['ourwork'];              update_post_meta($post_id,'ourwork',$ourwork);     }


title: Facebook Comment Count

text: I am a bit of an amateur when it comes to PHP and WordPress but I have rigged up the following code:               function fb_comment_count($url = 'some url here') {     $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url);     $json = json_decode($filecontent);     $count = $json->$url->comments;     if ($count == 0 || !isset($count)) {         $count = 0;     }     echo $count;     }      What it does is it retrieves the comment count from the Facebook Graph and displays it on a page. For it to work, I have to manually declare the url for each call. What I'm having a hard time with, is setting it up so that when you call the function in the template, it defaults to the post's permalink. I honestly have tried everything that has come to my mind. get_permalink() doesn't work when you declare the arguments in the function. Any help would be GREATLY appreciated. Thanks!


title: Get list of all registered post types slugs

text: I'd like to get a list (array) of all the post types I registered. Precisely I would like to retrieve their slugs. Could someone help me? thanks!


title: How To Disable Add new users On Subsites In Multisite?

text: How To Disable "Add new user" On Subsites In WordPress Multisite ? ![enter image description here](http://i.stack.imgur.com/oLINx.png)


title: Image upload callback in new 3.5 media

text: I am using new 3.5 media uploader in my theme frontend (base on this example). It is very simple when you want to do something with images after the `'Select'` button is pressed:               file_frame.on('select', function() {         // Get all attachments         var attachments = file_frame.state().get('selection').toJSON();              // Do stuff with attachments     });      But what if I want to do something with attachments just after they were upload? Something like:               file_frame.on('upload', function() {         // Do stuff with attachments     });      I didn't find anything useful in `'wp-includes/js/media-models.js'` or `'wp- includes/js/media-views.js'`. I have tried to attach a lot of events found in those files:               'add', 'url', 'select', 'ready', 'escapeHandler', 'keydown', 'attach', 'open', 'close', 'escape', 'recordTab', 'updateIndex', 'activate', 'dismiss', 'remove', 'reset', 'uploading', 'deactivate', 'create', 'render', 'change:content', 'scan', 'prepare', 'content:render:upload', 'content:render', 'content', 'updateIndex', 'recordTab', 'change:uploading', 'finish', 'done', 'upload', 'uploaded', 'save', 'saved','change:compat', 'compat'      But all these events fires not when I need this. Thanks!


title: Sorting a specific taxonomy by archive date using URL

text: OK, so I'm looking for a way to sort a specific taxonomy by archive date using the site URL. Say the custom taxonomy ("sort") value is "fruit" then then you would currently get all the posts marked as fruit with a link like this:               http://mysite.com/sort/fruit/          And to filter by archive date you will use:               http://mysite.com/date/2013/          The question is, is there a way to combine these 2 urls to just get posts marked as fruit in 2013? I tried `/sort/fruit/date/2013` and `/date/2013/sort/fruit/` and in both cases it just gives me an empty page. Any ideas?


title: Pre Get Posts / Multiple Meta Keys / Orderby Single Key

text: Tried more than a few variances to enable my `pre_get_posts` callback function to display posts that possess one, or both, of 2 separate meta_keys, upon display to then `orderby` a single meta_key. Here is a pastebin of the various attempts Namely I am able to display correctly via 2 separate keys but am unable to then orderby a single one of them, what am I missing to do this?


title: Building an email signup form. Where should the information be saved in the DB?

text: I would like to try build a simple plugin that collects and stores the name and email address of the person who filled in the form. I realize there are probably dozens of plugins out there that do this already but would like to build my own, for practice. If the user enters their name and email address, where should this be stored? Should it be created as a "subscriber" custom post type or a whole new table in the WP database? What are your thoughts? I'd like to eventually export the data to a .csv file if that influences where it should be stored.


title: Pass custom css class to add_menu_page

text: My theme currently uses add_menu_page() in order to display the theme options sections on the left hand admin menu. I would like to be able to attach a parent css class to the main menu item in order to selectively show/hide the menus for advanced users. I don't see this documented in the codex so I'm asking here to find out if there is a workaround or undocumented feature that I can utilize. Any help, much appreciated. The basic idea is that I have one main menu item and about 8 submenu items. Currently, all the menu items are displayed in the menu. I would like to use custom css to toggle the visibility of the submenu items, however, there is currently no custom id or class that I can use to target my menus.


title: use single form to enter multiple profiles

text: I want to allow users to add a business profile to their accounts. I have setup a form that posts the business profile information into user meta, and displays that info as part of their main profile. The challenge: some users will want to create more than one business profile. How can I use a single form to enter multiple business profiles into the database? I thought about using a counter to increment the user meta key name, but maybe there is a more efficient way?


title: Why can't I login to my "network sites"?

text: I have a Multi Site install that looks like this: main.dev.domain.com testsite.dev.domain.com dcdc.dev.domain.com on main.dev.domain.com I can login as admin and do all the regular stuff (like change themes) but then when I go to the dashboards of the other sites, all I get is a login box where NOTHING works. I know in Network Admin I need to add the user to that domain and I've done that and the sites under "users" I see that user is enabled. However, when I go to testsite.dev.domain.com/wp-admin (the way to get to the dashboard of the site) I get a login box where no username and password work (not the one that I made when I setup the new site or admin which I enabled). Is this by design? I finally changed the theme but I had to do it in edit site/setting where there is a long list of options and I just pasted in the theme path in there somewhere.


title: Wordpress Cron Job Counting Up and Not Down

text: I'm having a strange problem in which a WP Cron Job is counting "up" and not "down". Thus the job never runs. What I mean exactly should be clear from these outputs: > [19-Sep-2013 23:33:51 UTC] next sync: 0 hours, 0 minutes, 0 seconds   >  [19-Sep-2013 23:34:01 UTC] next sync: 0 hours, 0 minutes, 10 seconds   >  [19-Sep-2013 23:36:35 UTC] next sync: 0 hours, 2 minutes, 44 seconds   >  [19-Sep-2013 23:36:42 UTC] next sync: 0 hours, 2 minutes, 51 seconds   >  [19-Sep-2013 23:37:39 UTC] next sync: 0 hours, 3 minutes, 48 seconds   >  [19-Sep-2013 23:37:40 UTC] next sync: 0 hours, 3 minutes, 49 seconds Here is the code that sets the cron job:               function add_scheduled_interval( $schedules) {         $schedules['minutes_5'] = array('interval'=> 5*60, 'display'=>'Once 5 minutes');         $schedules['minutes_10'] = array('interval'=> 10*60, 'display'=>'Once 10 minutes');          return $schedules;     }     add_filter('cron_schedules', 'add_scheduled_interval');          function podio_plugin_activate() {         // Set up cron jobs for data integration         wp_schedule_event( time(), 'minutes_10', 'podio_plugin_sync' );     }      In the wordpress settings, the timezone is set to UTC+0. I've tried setting it to something else and saving; then setting back and saving again. Then I have deactivated and reactivated the cron job. Same results each time. I've looked around on the web and not been able to find anyone else reporting such a problem. Does anyone have any clues/ideas?


title: Links on the page, when being printed, have the URL next to them

text: I'm attempting to create a print.css stylesheet for my site and I'm running into an interesting problem. When I print any page on my site, all the links on the page are printing the URL directly next to it and it's causing all kinds of styling issues. At first I thought it might be my browser or printer, but other sites don't have this issue. Is there some setting in the admin section to remove these? I'm using the Boilerplate theme, which may be causing this issue.


title: wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query

text: How can I use wp_get_object_terms() to get a list of all the terms attached to all posts in the current query? For example, for the current query I want to get an array of the terms from the "Alfa" taxonomy that are contained in all the queried posts.               wp_get_object_terms($wp_query, 'alfa');      But that only seems to be returning one item in the array... I am doing this to build an array to cross check one taxonomy with another for a navigation menu, and am currently doing this with the following code but I think there must be a better way. Please help! Thanks!               $queried_terms = array();     if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();         $postid = $post->ID;               if( has_term( '', 'alfa', $postid) ) {             $terms = get_the_terms( $postid, 'alfa' );             foreach($terms as $term) {                 $queried_terms[] = $term->slug;             }         }          endwhile; endif;     rewind_posts();     wp_reset_query();          $queried_terms = array_unique($queried_terms);


After long time am here,I have one question. I Installed my wordpress in localhost and i moved to live,while i forgot the admin password,so i reset it by phpmyadmin(using md5).now i try to login by using with correct password it's redirect to This page and shows **You do not have sufficient permissions to access this page.** please anyone help me to solve this problem.


title: Dynamic page outside Wordpress

text: I have some data that I'm pulling from an XML source and would like to display it in Wordpress. One solution would be to take the static markup that my theme generates and spaghetti-code my page with some PHP that grabs the data from the XML and prints it in the page. Easy enough, but now every time I make a change to the theme I have to re-apply it to this page. Is there a more elegant solution that would allow me to inherit the whole site look n' feel and just append my data to it? Thanks


title: Why do some core functions get wp_ while others do not? What's the rule?

text: Is there some guideline or rationale behind why some WP code functions are prefixed with `wp_` ? eg: `wp_insert_post()` vs. `update_post_meta()`


title: Code in custom widget queries all posts, when it should only query the current post

text: I have a query in a custom widget (my first one!) which, if it's of custom post type `book`, retrieves the post ID. This then gets used in a WP_QUERY to retrieve data about the page. This works perfectly when in the static sidebar.php, but not in either a dynamic PHP Widget or as a custom widget in functions.php. In those, it retrieves the relevant field from all examples of post type `book`. Here's the offending code.                           <?php              if('book' == get_post_type()) :                  $ww_book_id = $post->ID;                  else :                      $ww_book_id = $default_book; //this is pulled in from the widget admin options form and works perfectly.             endif;                   $testimonial_args = array(                 'post_type' => 'book',                 'p' => $ww_book_id                  );             $main_testimonials = new WP_Query($testimonial_args);             if($main_testimonials->have_posts()) : while($main_testimonials->have_posts()): $main_testimonials->the_post();                    echo the_title(); //I actually do much more stuff than this, but it works for testing purposes.                  endwhile;          wp_reset_postdata();          endif;               ?>      Many thanks!


title: WP ecommerce - How do I change the product image for each product variation?

text: I would like to have the functionality for image to change when the user selects a different variation. ie, If I'm selling a T-shirt and have create two variations (Red and White). I would like for the main product image box to the image when the user selects a color. The Red shirt image should be displayed when the Red "Color" variation is selected. On the backend there is an area to add product thumbnails for each variation but that does not correspond with any change to the product image on the frontend.


title: wpdb->insert multiple record at once

text: So after I have created the table 'settings-table' i want to add a couple of records to it. This is how I want to do it, not the best way, so I need a better way to do this because I will add more records to the table. EXAMPLE 1                $wpdb->insert('settings-table', array('option_name'   => 'name-1',                                             'option_value'  => 'val-1',                                             'option_created'=> current_time('mysql'),                                            'option_edit'   => current_time('mysql'),                                            'option_user'   => 'user-1'                                             ));          $wpdb->insert('settings-table', array('option_name'   => 'name-2',                                             'option_value'  => 'val-2',                                             'option_created'=> current_time('mysql'),                                            'option_edit'   => current_time('mysql'),                                            'option_user'   => 'user-2'                                             ));      $wpdb->insert('settings-table', array('option_name'   => 'name-1',                                             'option_value'  => 'val-3',                                             'option_created'=> current_time('mysql'),                                            'option_edit'   => current_time('mysql'),                                            'option_user'   => 'user-3'       UPDATE this works(any other better solutions are welcome)               $wpdb->query("INSERT INTO settings-table                 (`option_name`, `option_value`, `option_created`, `option_edit`, `option_user`)                 VALUES                 ('name-1', 'val-1', current_time('mysql'), current_time('mysql'), 'user-1'),                 ('name-2', 'val-2', current_time('mysql'), current_time('mysql'), 'user-2'),                 ('name-3', 'val-3',  current_time('mysql'), current_time('mysql'), 'user-3')")


title: Custom Postype specific changes in admin panel

text: I have this small bit of code which does exactly what I need. But I want to limit its use to one Custom Post Type (CPT) only.               add_filter('sanitize_title', 'my_custome_slug');     function my_custome_slug($title) {         return str_replace('-', '', $title);     }      I've tried the following code with no luck:               function my_custome_slug($title){      global $post;         if ( $post->post_type == 'customposttype') {              return str_replace('*', '-', $title);              }         }      add_filter('sanitize_title', 'my_custome_slug');       Any help is appreciated. **EDIT:** Sorry i was not clear in my post. Wordpress is taking "Post Titles" and change them to "post-titles" in urls when we first enter the title in any new posts. My original question was , for a specific custom post type, i need to remove "-" in urls of the posts. So they will be "posttitles" ![enter image description here](http://i.stack.imgur.com/h8wx0.jpg) I thought the problem was using "sanitize_title" because every other example i found for custom post specific content loading in Admin panel works. But once i use sanitize_title in those examples, the result would simply make a blank url under the title field. The first code i've shared is doing this already. I've tried to limit it's function to a specific custom posttype but it simply didnt work. I need this feature and i saw its already possible. I just need to limit it to a specific custom post type. This is rather a backend problem (due to some internal structre) and not a frontend problem. Otherwise i would have tried it with htacess. So our main target is wordpress publish page on admin panel.


title: Display content from custom post type if match to main post category

text:
I solved the problem of displaying from a custom post type in a post with this solution, however, I want to filter even more and only display the posts from custom post type that match the main post's category (or to be more precise the slug, but there's no difference in solution). I get the slug of the main post by using this:               $category_main = get_the_category();     $cat_slug = $category_main[0]->slug;     echo $cat_slug; // This is just to see if I got the right output      I get the slug from the custom post type in the same way, but it's within a loop that loops through the custom post types.               $category_course = get_the_category();     $cat_slug_course = $category_course[0]->slug;     echo $cat_slug_course;      So, what I want now, is to only display the posts from the custom type that match the slug of the original post. In pseudo-code this would be something like:               If $cat_slug_course is equal to $cat_slug, display all custom type posts with slug $cat_slug_course and none other      This is the loop used to display the custom type posts.               $args = array( 'post_type' => 'Course', 'posts_per_page' => 2 );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();              $category_course = get_the_category();         $cat_slug_course = $category_course[0]->slug;         echo $cat_slug_course; // This is just to see if I got the right output         echo '
';             the_title();         echo '
';         the_content();         echo '
';     endwhile; ?>


title: Can somebody explain this mediaelement and audio tags

text: I'm using this built in audio tag. It works for mp3 but with wma I just get this "Download file" link. I read this: http://wordpress.org/support/topic/wmv-videos-are-not-playing but setting type="audio/vma" does not fix the problem. This is the link to some page that has the same problem as me: http://shastacosta.com/dwight/wp36-wma


title: Remove 'home' from nav menu

text: I moved my page navigation from the header to the footer and now I am trying to remove 'home' from the navigation. In functions.php I added this -                   register_nav_menus( array(         'primary' => __( 'Primary Menu', 'web2feel' ),     ) );     function wp_nav_menu_args( $args ) {           $args['show_home'] = false;           return $args;       }      which usually works, but hasn't this time. I couldn't work out how to put everything into JSfiddle, apologies. Here is my site.


title: Advanced Custom Fields Validation

text: Is there way to use custom validation on an advanced custom field? For example, I might not want a textfield to have a value that starts with certain prefix, or I might want a number field to have a value greater than 'x'. I might also want to run a regex against a value and return an error if it doesn't match.


title: Related posts meta_query CPT

text: i have two post type "Artists" and "Songs", in "Songs" i have a meta box with checkbox list of "Artists" names. i want to show related posts if any post have same value of post meta with artist name:               wp_reset_postdata();     global $post;     $artist_name = get_post_meta(get_the_ID(), "artist_name", true);          $args = array(         'post_type' => array('songs'),         'meta_key' => $artist_name     );          $query = new WP_Query;     return $query;      query should display posts with same value of meta box automatic. this is possible ?! more info: ![post type of artists names:](http://i.stack.imgur.com/iDsFH.jpg) ![Meta box of artists names in Songs post type](http://i.stack.imgur.com/pj1xF.jpg) ![Showing related songs by artists name in single page](http://i.stack.imgur.com/evxoX.jpg)


title: How to change taxonomy slug?

text: I have some registered taxonomies like this one:               /********************************* Género *****************************/          function genre_init() {         $labels_genre = array(         'name' => _x( 'Géneros', 'taxonomy general name' ),         'singular_name' => _x( 'Género', 'taxonomy singular name' ),         'search_items' =>  __( 'Buscar Género' ),         'popular_items' => __( 'Géneros Populares' ),         'all_items' => __( 'Todos los Géneros' ),         'edit_item' => __( 'Editar Género' ),         'update_item' => __( 'Update Género' ),         'add_new_item' => __( 'Añadir nuevo Género' ),         'new_item_name' => __( 'Nuevo nombre de Género' ),         'separate_items_with_commas' => __( 'Separa Géneros con comas' ),         'add_or_remove_items' => __( 'Añade o quita Géneros' ),         'choose_from_most_used' => __( 'Elige entre los Géneros más utilizados' )         );              // create a new taxonomy         register_taxonomy(         'Géneros',             'reviews',             array(                 'rewrite' => array( 'slug' => 'genre' ),                 'labels' => $labels_genre             )         );     }     add_action( 'init', 'genre_init' );          /**********************************************************************/      When using a plugin to show the links of each taxonomy value (e.g. "rock", "folk", ...) I saw the accent in the slug (`http://dcodedmagazine/?taxonomy=Géneros&term=rock`), so I tried to change the taxonomy name:               /**********************************************************************/          /********************************* Género *****************************/          function genre_init() {         $labels_genre = array(         'name' => _x( 'Generos', 'taxonomy general name' ),         'singular_name' => _x( 'Genero', 'taxonomy singular name' ),         'search_items' =>  __( 'Buscar Género' ),         'popular_items' => __( 'Géneros Populares' ),         'all_items' => __( 'Todos los Géneros' ),         'edit_item' => __( 'Editar Género' ),         'update_item' => __( 'Update Género' ),         'add_new_item' => __( 'Añadir nuevo Género' ),         'new_item_name' => __( 'Nuevo nombre de Género' ),         'separate_items_with_commas' => __( 'Separa Géneros con comas' ),         'add_or_remove_items' => __( 'Añade o quita Géneros' ),         'choose_from_most_used' => __( 'Elige entre los Géneros más utilizados' )         );              // create a new taxonomy         register_taxonomy(         'Generos',             'reviews',             array(                 'rewrite' => array( 'slug' => 'genre' ),                 'labels' => $labels_genre             )         );     }     add_action( 'init', 'genre_init' );          /**********************************************************************/      and now the in the plugin widget I have to choose "Genero" instead of "Géneros", but I'm still getting the same slug. I don't really understand why I'm not able to change the slug of a custom taxonomy created by me. Any idea of what I'm missing? **Edit:** Indeed, the other taxonomy slugs are: `artistas=alice-in-chains` and not: `taxonomy=artistas&term=alice-in-chains`. **2º Edit:** Debug mode was disabled. Enabling it I can see the next Notice for each "Géneros" field printed: `Notice: Trying to get property of non-object in /home/user/MyServer/project/wp-includes/taxonomy.php on line 3185`


title: How to change the default url for 'Posts' link?

text: I would like to change the default url `edit.php` to `edit.php?category_name=photos` when I click on "Articles". Thanks ![enter image description here](http://i.stack.imgur.com/g27fX.jpg)


title: Why I obtain different visualization when I run the website on my local machine and on remote server?

text:
I am finding a very strange behavior with a WordPress main menu into this custom theme that use BootStrap: http://onofri.org/WP_BootStrap/ As you can see in the horizontal main menu the background of the voice related to the current page is red (ok, this is the right behavior) The problem is that in the local version of the same website (use the same theme, I have uploaded it from my local web server to the previous onine web server) I have a different visualization of the menu (there is no the red brackground), here below I am attaching a picture of the local version: ![enter image description here](http://i.stack.imgur.com/Znlof.png) This is the code that generate this main menu:

                         <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">                             Toggle navigation                                                                                </button>                              <a class="navbar-brand" href="<?php echo home_url(); ?>">                             <?php bloginfo('name'); ?>
                     <?php                         wp_nav_menu(array(                             'menu' => 'primary',                              'theme_location' => 'primary',                              'depth' => 2,                             'container' => 'div',                              /*'container_class' => 'navbar navbar-default',*/                             'menu_class' => 'nav navbar-nav',                              'fallback_cb' => 'wp_bootstrap_navwalker::fallback',                              'walker' => new wp_bootstrap_navwalker())                         );                     ?>
                                What could be the problem? the theme is the same.


title: Is it possible to query all posts that don't have an attachment?

text: I want to get a list of all posts that don't have an attachment and delete them. This question takes about getting all posts that _have_ an attachment, but I want the reverse of it. The brute force way to do it is to get all posts and then loop through them individually and then check if they have attachement or not. But I want to avoid it if possible.


title: excerpt not showing up

text: I have a custom template for homepage and in it, i want to display excerpt from some category. but not even the simple `the_excerpt()` isn't working. i tried `the_title` and `the_content`, but only title display not content. The following is my code,am i missing something?                <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>            <?php the_excerpt();?>          <?php endwhile;?>            <?php endif; ?>


title: Hide images from anonymous user?

text: I'd like to set my WordPress (self-hosted) site up so that you can only view images if you're logged in. I want it to be impossible to view the images without being authorized as a user of the site. This plugin is exactly what I need, but it's been abandoned and no longer works. What I want is:   * All logged in users can view all images   * All anonymous visitors can view no images Something a bit more granular than the above would be nice (for example, authorizing a few specific images for public viewing,) but that's the baseline. In essence, I want the Visibility editor, which is available for Posts and Pages:   ![Post/Page Visibility](http://i.stack.imgur.com/Cpc2e.png)   ..to be available for Files as well.   I want the user to be able to view a post without the images if he's not logged in. Is there a plugin or modification that does this? Google returned nothing.


title: Why orderbyb meta_value_num won't affect the generated SQL Query order?

text: I've exhausted myself with this and I couldn't figure out why when I do this               $myposts = new WP_Query( array('numberposts' => 5,     'offset' => '0',     'post_type' => 'noticias',     'orderby' => 'meta_value_num',     'order' => 'DESC',     'post_status' => 'publish',     'meta_key' => '_countview'     ));      wordpress queries the db with the following SQL:               SELECT SQL_CALC_FOUND_ROWS wp_posts.ID      FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)      WHERE 1=1       AND wp_posts.post_type = 'noticias'       AND (wp_posts.post_status = 'publish')       AND (wp_postmeta.meta_key = '_countview' )      GROUP BY wp_posts.ID ORDER BY wp_posts.post_date ASC LIMIT 0, 5      did something change for 3.4 and i'm missing the syntax?


title: Schedule Page/CPT Revisions

text: I'm currently working on a wordpress installation that (ab-)uses wordpress Pages with extensive ammounts of custom fields to allow for simple handling of landingpages etc. Our users now asked for a simple solution that allows them to schedule changes to published wordpress for specific dates in the future. is there any plugin or wordpress functionality that enables this kind of behavior? thank you in advance!


title: Remove commas between tags

text: So I have been googling for quite some time now and I can't seem to solve this. A lot of sources refer to a file called `the_tags.php` but it's nowhere to be found. Can anyone point me in the right direction? Thanks.


title: Query_posts using two custom taxonomies not returning posts

text: If I remove `'relation'` and one of the taxonomy arrays the corresponding posts are returned for each taxonomy but when I add the `'relation' = 'AND'` no posts are returned. Is there a problem in my `$args`?               $queried_object = get_queried_object();      $taxonomy = $queried_object->taxonomy;     $term_id = $queried_object->term_id;     $term_slug = $queried_object->term_slug;     $term_name = $queried_object->term_name;          $args = array(         'post_type' => 'listing',         'posts_per_page' => '10',         'post_status' => 'publish',         'tax_query' => array(             'relation' => 'AND',             array(                 'taxonomy' => $taxonomy,                 'field'    => 'id',                 'terms'    => array($term_id),                 'operator' => 'IN'             ),             array(                 'taxonomy' => 'listings_categories',                 'field'    => 'slug',                 'terms'    => array('mortgage-loans'),                 'operator' => 'IN'             )         )         //'orderby' => 'meta_value',         //'meta_key' => 'listing_is_featured',     );          query_posts($args);


title: Get images uploaded to this post in popup on editor screen

text: I'm using the ZillaSortcodes plugin and add some functionality to build a shortcode to use the images uploaded to the post/page for an image grid. In the shortcode.class.php of ZillaShortcodes I use this code to retrieve all images uploaded to the post               $referer = parse_url($_SERVER['HTTP_REFERER']);     preg_match('/post=(\d+)&/', $referer['query'], $referedID);     $actual_post = $referedID[1];          $attachments = get_posts( array(         'post_parent'      => $actual_post,         'post_type'        => 'attachment',         'numberposts'      => -1,         'post_status'      => 'any',         'post_mime_type'   => 'image',         'order'            => 'ASC',         'orderby'          => 'menu_order',     ));      To get the post ID I have to be a little bit tricky and getting the ID from the URL. This works fine if the post/page is already saved and the shortcode popup looks like this. But this only works if the post is saved and there is a ID within the URL. Similar to the WordPress Media Manager where I can select "Uploaded to this post" I'm looking for a solution to get this to work even if this is a new post. Thanks for any tips


title: Exclude some authors from query

text: This script list users with their last post. How to exclude some authors from guery ?               <?php              //List of users sorted descending by date of lastest post written by user         $uc=array();         $blogusers = get_users_of_blog();              if ($blogusers)          {             foreach ($blogusers as $bloguser)              {                 $user = new WP_User( $bloguser->user_id );                 if ( !empty( $user->roles ) && is_array( $user->roles ) )                 {                     $userpost = get_posts('showposts=1&author='.$bloguser->user_id);                     $uc[$bloguser->user_id] = '';                     if ($userpost)                      {                         $uc[$bloguser->user_id]=$userpost[0]->post_date;                     }                 }             }             arsort($uc);             $i = 0;             foreach ($uc as $key => $value)              {                 $user = get_userdata($key);                 $post_count = count_user_posts($user->ID);                 if ($post_count && $i < 10)                  {                     $author_posts_url = get_author_posts_url($key);                          //preparing query for titles                     $args=array(                     'author' => $user->ID ,                     'post_type' => 'post',                     'post_status' => 'publish',                     'posts_per_page' => 1,                     'ignore_sticky_posts'=> 1,                     );                     $my_query = null;                     $my_query = new WP_Query($args);                          if( $my_query->have_posts() )                      {                         //echo 'List of Posts for ' . user->user_firstname . ' ' . $user->user_lastname;                         while ($my_query->have_posts()) : $my_query->the_post();           ?>


title: Wordpress loop for multiple custom post types

text: I want to loop through 3 custom post types + posts and display the latest post from each. This is what I have so far. This only takes the four most recent posts but not one only from each post type. Many thanks in advance               <?php $args = array(           'post_type' =>.  array('post','mixes','artists','releases'),           'posts_per_page' => '4',             );          query_posts( $args );     while ( have_posts() ) : the_post(); ?>            do stuff here                   <?php   endwhile; ?>


title: Custom Query Arguments

text: I want to run a query base on the following $args. My question that how to pass variable number of arrays to tax_query as currently i have two arrays within tax_query it can be 1 , 3 or 5 and so on. Is there any possibility ?               $args = array (                 'posts_per_page' => 10,                 'tax_query' => array(                     'relation' => 'OR',                     array(                         'taxonomy' => $Tax[0],                         'field' => 'slug',                         'terms' => array( $Tag )                     ),                     array(                         'taxonomy' => $Tax[1],                         'field' => 'slug',                         'terms' => array( $Tag )                          )                 ),                 'order' => 'DESC'                  );


title: Passing current cookies in wp_remote_get to get Draft Post Preview

text: I want pass current user cookies in wp_remote_get function to get a Draft Post Preview page content. I check already the questions:   * What URL do you pass to wp_remote_get to load the body of the current post's preview?   * How can I call "preview post" from wp_remote_get with authentication? But in either of them appears how I can get the cookies to the pass it to wp_remote_get function. I assume I can do what I want passing the cookies to wp_remote_get function, here in WordPress documentation mention how WordPress stores the cookies but how can I get them taking in care they use a hash value in the cookie name? What I want to do is given a Post ID get the content of the WordPress Post view page and analyse it. For the already published Posts all works fine, but for Draft Posts I get that the page doesn't exist. Here is the code simplified:               (...)     $post_permalink = get_permalink($post_id);     $response = wp_remote_get($post_permalink);     $whole_post_page = $response['body'];     (...)      This code is executed when the owner of the Post is editing it, so the user is already authenticated and the request is for a local Post. How I can accomplish that wp_remote_get returns me the Post Preview page content? as WordPress does when I go to the preview link in my browser. Thanks in advanced.


title: How to get 'Products' on home page?

text: I am using query post in loop.php               query_posts( array('post_type'=>array('product','post'),'paged'=>$paged ) );      So that the custom post 'product' (woocommerce product) can be displayed on home page. I am able to see 'product' & 'post' in home page of theme1 but not in theme2, what might be the problem?, suggest me place where I should check; What should I check?


title: How does WP handle multiple matching rewrite rules?

text: Here is my url to a custom type :               http://host/movie/my-slug      When I go to this link, I'm redirected to               http://host/movie/my-slug/?post_type=movie      which results in a 404 error. I use Rewrite Rule Inspector wordpress plugin for listing the matching rewrite rules. It appears that my url matches three rules : (regex new-url source)   * movie/([^/]+)(/[0-9]+)?/?$ index.php?post_type=movie&name=$matches[1]&page=$matches[2] movie   * (.?.+?)(/[0-9]+)?/?$ index.php?pagename=$matches[1]&page=$matches[2] page   * [^/]+/([^/]+)/?$ index.php?attachment=$matches[1] post Witch one Wordpress will choose for resolving my url ? Why do I have a 404 error ?


title: How To Find Out Wordpress Category Table in MYSQL?

text: I know WordPress stores all post data in `'wp_posts'` table. But here WordPress not define any category id or reference related with it. Please let me know, how 'wp_posts' table find out exact category? Please explain me in details.


title: 409 error (Conflict) when trying to insert an image into a post

text: I've uploaded a Wordpress site to the live server and I get this error whenever I try to insert an image into a post: > **Conflict**   >  The server encountered an internal error or misconfiguration and was unable > to complete your request.   >  Please contact the server administrator, root@localhost and inform them of > the time the error occurred, and anything you might have done that may have > caused the error.   >  More information about this error may be available in the server error log.   >  Apache/2.2.0 (Fedora) Server at www.sitename.com Port 80 Just to be clear - the error appears only when i try to **insert** the image into the page. I can upload it to Media just fine. Also, it happens with external images as well as local ones. It seems enough to have an IMG tag with something in the SRC attribute for this to happen. It's very weird, I've installed Wordpress on many servers and never had this happen before.


title: Does post_meta data need to be unserialzed?

text: Is it possible to unserialize data in the mysql query at the run time? i don't want to use unserialize() function of php. I need to fetch the value "mathematics" from the below serialized value saved in wp_postmeta table using mysql query.               a:4:{s:39:"wpcf-fields-checkboxes-option-223412915";s:7:"science";s:39:"wpcf-fields-checkboxes-option-499894518";s:10:"technology";s:40:"wpcf-fields-checkboxes-option-1474335177";s:11:"engineering";s:40:"wpcf-fields-checkboxes-option-1018405300";s:11:"mathematics";}          Array     (     [wpcf-fields-checkboxes-option-223412915] => science     [wpcf-fields-checkboxes-option-499894518] => technology     [wpcf-fields-checkboxes-option-1474335177] => engineering     [wpcf-fields-checkboxes-option-1018405300] => mathematics     )


title: Download Manager in a Multisite setup

text: I'm currently running a Wordpress Multisite (Network) and need a solution for a download manager. The specific requirement is that there should only be one file repository/db table that is used by all sites. So whenever a user adds a download in one of the subsites it should be available in all all the other sites as well. "Available" meaning it should be entered into a post by shortcode. Additionally, uploaded files should only be available for registered users. I have looked into a couple of available plugins (Download Monitor, CM Download Manger,WP Download Manger). They all offer "Multisite Support" but as far as I have seen only by providing an individual repository for each site that is separated from the other sites. Anybody already running a setup like this?


title: Get user role by using user_id in buddypress

text: I need to classify the user according to their role, so I need to find the user role by using the user_id alone (not only for logged in users but for all the BP users). Something like this `$user_role=role($user_id);`


title: Wordpress media uploader button is not working

text:
I'm developing my own plugin. for that i need to upload logo images. since i'm a newbie in wordpress i searched so many tutorials. the code i used is pasted below. the problem is when i clicks on the upload button nothing happens. but the demo plugin which i used as a reference performs well. can't figure out what may be the mistake. can anyone plz help me to sort this out. part of my plugin's code:               function ckt_admin_scripts()      {     if (isset($_GET['page']) && $_GET['page'] == 'my_custom_submenu_page')      {                          wp_enqueue_media();            wp_register_script('my-admin-js',CKT_RESULT_PLUGIN_URL.'my-admin.js', array('jquery'));            wp_enqueue_script('my-admin-js');      }      }      add_action('admin_enqueue_scripts', 'ckt_admin_scripts');               function my_custom_submenu_page() {            echo '

';         echo '
Add New Matches

';                 echo '<form id="form-options" action="" type="post" enctype="multipart/form-data">';                 echo 'Enter the Match title: '.'<input type="text" id="mname" name="mname"/>
';                 echo '
Enter Team1 details (First Batting)

';                 echo 'Name: '.'<input type="text" id="t1name" name="t1name"/>

';                 echo 'Logo:'.'<input type="text" id="upload_image"  value="" size="40" /><input type="button" id="upload_image_button" value="Upload Image" />';                 echo '

';                 echo '<input name="submit" id="submit_option" type="submit" class="button button-primary" value="Save Settings"/>';                 echo '</form>';     echo '
';              }      The Js file code:               jQuery(document).ready(function($){               var custom_uploader;               $('#upload_image_button').click(function(e) {              e.preventDefault();              //If the uploader object has already been created, reopen the dialog         if (custom_uploader) {             custom_uploader.open();             return;         }              //Extend the wp.media object         custom_uploader = wp.media.frames.file_frame = wp.media({             title: 'Choose Image',             button: {                 text: 'Choose Image'             },             multiple: false         });                   custom_uploader.on('select', function() {             attachment = custom_uploader.state().get('selection').first().toJSON();             $('#upload_image').val(attachment.url);         });              custom_uploader.open();            });               });


title: Single.php back button to parent category

text:
I want to add a back button that goes to the parent category of the actual single post that the user is viewing. How can I do that?
Return
      Thank you.


title: Programmmatically adding a Custom Post

text: I've added a custom post type, on the 'init' action, like so:               // Setup the 'Classifieds' Post Type         $labels = array(             'name' =>                   _x('Classifieds', 'post type general name'),             'singular_name' =>          _x('Classifieds', 'post type singular name'),             'add_new' =>                _x('Add New', 'classifieds'),             'add_new_item' =>           __('Add Classifieds Item'),             'edit_item' =>              __('Edit Classifieds'),             'new_item' =>               __('New Classifieds Item'),             'view_item' =>              __('View Classifieds'),             'search_items' =>           __('Search Classifieds'),             'not_found' =>              __('No classifieds found'),             'not_found_in_trash' =>     __('No classifieds found in Trash'),              'parent_item_colon' =>      '',             'menu_name' =>              'Classifieds'         );              // Configure the 'Classifieds' post type         $args = array(             'labels' =>                 $labels,             'public' =>                 true,             'publicly_queryable' =>     true,             'show_ui' =>                true,             'show_in_menu' =>           true,              'query_var' =>              true,             'rewrite' =>                array("slug" => "classifieds"),             'capability_type' =>        'post',             'has_archive' =>            true,              'hierarchical' =>           true,             'menu_position' =>          5,                                                           'supports' =>               array('title',                                             'editor',                                             'author',                                             'thumbnail',                                             'excerpt',                                             'trackbacks',                                             'custom-fields',                                             'revisions',                                             'comments',                                             add_theme_support( 'post-formats',                                                                  array('aside', 'gallery')                                                             )                                         ),             'taxonomies' => array('category', 'post_tag')         );         // Add the 'Classifieds' post type         register_post_type('classifieds', $args);      My problem is when I want to insert a custom post programatically, like so:               $cat_ID = get_cat_ID( 'calendar' );                      $data = array(                     'post_content' => stripslashes($output),                     'post_title' => stripslashes($title),                     'post_date' => date('Y-m-d H:i:s'),                     'post_category' => array($cat_ID),                     'post_status' => $statusPost,                     'post_author' => $post_author                 );                 $post_id = wp_insert_post($data);      The custom post is displayed under the Admin's generic 'Post' type post, not under the custom post type of 'Classifieds' which I created above. Does anyone have any suggestions?


title: TinyMCE Autoresize

text: Looking for a way to make the TinyMCE editor always relative to it's content so that the height of the editor changes accordingly to how much text/images it contains. There seem to be plugins for TinyMCE for this already, but I'm not sure on how to apply it for the Wordpress version: http://www.tinymce.com/wiki.php/Plugin:autoresize               function init_tinymce_autoresize($initArray){        $initArray['plugins'] = "autoresize";        return $initArray;     }     add_filter('tiny_mce_before_init', 'init_tinymce_autoresize');      Does not work. Ideas?


title: Order posts by ID in the given order

text: In the back-office of my theme, the users can choose which posts to display in the front page, and they can also choose **in which order the selected posts should appear**. I have tried like this:               $aPostsIDs = array(1,3,2); // Note the 3 should appear before the 2     query_posts(array('post_type' => 'page',                        'post__in' => $aPostsIDs,                       'order_by' => 'FIELD(ID, '.implode(',',$aPostsIDs).')'));      But as expected it doesn't work. The right way to do it according to the codex is:               add_filter('posts_orderby', 'edit_posts_orderby');     function edit_posts_orderby($orderby_statement) {         global $aPostsIDs;         $orderby_statement = 'FIELD(ID, '.implode(',',$aPostsIDs).')';         return $orderby_statement;     }      But that still doesn't work! The posts are ordered by ID (1, 2, 3) instead of the given order (1, 3, 2). Where should I look? Thanks


title: Blog page won't show Blog template

text: I set my "Blog" page to a Blog template I created in Pages (in the dashboard). Also, in Settings > Reading, I set my Home page (home template) as my Front page and my Blog page as my Posts page. However, when I navigate to my Blog page, it shows the home template. Yet, the body class of the Blog page is `blog logged-in`. I am confused. How can I make my Blog page show my Blog template? I pasted my Blog template here for reference: http://pastebin.com/6ML30D7N


title: What is a good member directory plugin?

text: I'm working on a site for a local homeschool group, and they'd like to have a page(s) with a member directory on the site. Any suggestions? Something like the Business Directory plugin would probably be great, just more focused on listing individuals. Edit: I actually want a plugin that lets me create listings manually, as opposed to using the existing user/member list in WordPress. That will work better in this case.


title: Do stuff when editing or writing a certain custom post type?

text: I would like to add extra js file to a backend when editing or creating a custom post type. I found pretty good answer to it but it has a flaw, it wont work when editing the custom post type, only on create and archive view. Thank you :)


title: How to search for users based on added user metadata

text: I have added several new fields to the user profile (areacode, company, affiliate, etc) and I would like to present a way to search on these fields. Please point me in the right direction.