title: in jquery read a multidimensional array via wp_localize_script()

text: From PHP I am pushing a basic array to jQuery via `wp_localize_script()` and then using the array data in my script file. Now I have extended the array into a multidimensional array and can not figure out how to get the data out of the array to use in in the javascript file. Currently I'm extracting the data from the array is like this:               jQuery(document).ready(function($){          var optionA = theme_metadata.dataA;         var optionB = theme_metadata.dataB;      `theme_metadata` is the array that I built in PHP and push to jQuery via `wp_localize_script()`. `dataA` and `dataB` are keys in the array. My new array looks like this:               [theme_meta] => Array         (             [0] => Array                 (                     [dataA] => foo                     [dataB] => bar                 )                  [1] => Array                 (                     [dataA] => this                     [dataB] => that                 )         )      How do I setup my var in the script file to read `[theme_meta][0][dataB]`? Also how can I loop through the array? The numbered key index will not be known, i.e., `[0]- whatever [100]`? I could send over a `key=>value` on how big the array is as a stopping point for a loop, i.e., `'theme_meta_size' => 2` as in the sample array.


title: Handling an Ajax form submit

text: I am developing a wordpress plugin that will create a contact form and then submit the details through an ajax request.                       jQuery.ajax({                      type:"post",                 dataType:"json",                 url: ajaxurl,                 data: {action: 'submit_data', info: info},                 success: function(response) {                     alert("Success");                 }             });      This is the function that handles the ajax request:               add_action("wp_ajax_submit_data", "submit_data");     add_action("wp_ajax_nopriv_submit_data", "submit_data");          function submit_data() {               echo "";          die();     }      The link that the user will click to submit the form is :               $link = admin_url('admin-ajax.php?action=submit_data');         Submit      Once the submit link is clicked I recieve the Hello alert and then get taken to a blank page with the URL               http://localhost:81/wordpress/wp-admin/admin-ajax.php?action=submit_data      Why is it taking me to a blank page rather than updating the current page? EDIT ------------------------------------------------- Here is the full jquery function :               $(".button").click(function() {                      $(".error").hide();                      var name = $(":input.name").val();                 if (name == "") {                          $("label#nameErr").show();                     $(":input.name").focus();                     return false;                 }                      var email = $(":input.email").val();                 if (email == "") {                          $("label#emailErr").show();                     $(":input.email").focus();                     return false;                 }                           var phone = $(":input.phone").val();                 if ((phone == "") || (isNaN(phone))) {                          $("label#phoneErr").show();                     $(":input.phone").focus();                     return false;                 }                      var info = 'name:' + name + '&email:' + email + '&phone:' + phone;                      alert(info);                      jQuery.ajax({                          type:"post",                     dataType:"json",                     url: ajaxurl,                     data: {action: 'submit_data', info: info},                     success: function(response) {                         if (response.type == "success") {                                  alert("success");                         }                         else {                                  alert("fail");                         }                     }                 });                      return false;                       });


title: add_filter('the_content', '...') stops pagination from working

text: I have a function (it deals with using `preg_replace_callback`to replace Image URLs with URLs/paths to the uploads directory - lets call it `replaceImgUrls()`) which is then passed into `add_filter('the_content', 'replaceImgUrls')`. This works fine and stuff but on posts where I have added pagination (`<!--nextpage-->`), it stops this from working; it fails to split up the pages, but still shows the correct amount of page numbers at the bottom of the content, which you can still click on but each page shows the same content (i.e all the content which is in the post). Here is my function which replaces the image URLs:               add_filter('the_content', 'replaceImgURLS');     function replaceImgURLS($content) {         global $post;         $content = $post->post_content;         $newContent = preg_replace_callback(             '/<img.*src=[\'"]([^\'"]*)/i',              function ($match) {                 global $post;                 $imgURL = $match[1];                 $filename   = basename($imgURL) . "-" . $post->ID . ".jpg"; // Create image file name                 $upload_dir = wp_upload_dir();                 $postMonth = mysql2date('m', $post->post_date);                 $postYear = mysql2date('Y', $post->post_date);                 $fileURL = $upload_dir['baseurl'] . '/' . $postYear . "/" . $postMonth . "/" . $filename;                      return '<img src="' . $fileURL;             },              $content         );         return $newContent;     }      When I remove this function from my `functions.php` file, the pagination is restored and works as it should (i.e each page is split up separately). I have `wp_link_pages()` in my `content-single.php` template file. Thanks for any help :)


title: Changing custom taxonomy's slug as required?

text: I have a section in a plugin i am making where admin can add custom taxonomies and custom post types as required. the admin will create a custom taxonomy by selecting a name(that will be used as slug), then create a custom post type and select the above created taxonomy as it's parent. those are been added to a private DB table. On init `action('init',)`... i have a class that runs through this database and register the custom post type/ taxonomies create previously and `register_taxonomy_for_object_type` to connect things up. now my issue is. when the admin go back to the same screen and edit a taxonomy name(which also changes the slug) i update the DB according to the new changes. although my class see the changes and register them,when i refresh the page it doesn't seem to actually change. My question is: is there anything i need to do to update that taxonomy ? Sorry for the long text thanks.


title: wordpress is converting ?page=2 into /2

text: with this code               paginate_links(        array(        'base' => @add_query_arg('page', '%#%'),         'format' => '?page=%#%&a='.$a,         )     )      looks output like this               2      But when I click on it my url goes to `www.example.com/something/2/?a=1` is it possible to change it into `www.example.com/something/?page=2&a=1`? Thanks


title: Restricting Post Content Visibility with Custom Code - where to put it?

text: We are using custom code (or will be) to detect user groups from our forums to determine whether or not a post's content will be displayed. So if you are someone who has over 500 posts, you are placed into a certain user group via the forum software and can view certain articles on our front page. So the code we will be putting into Wordpress will be something like this: “If in X forum user group, show this; if not, show this message." My question is, where do we apply the coding for that across Wordpress? For example we have single.php which shows the news story pages, loop.php which shows the stories in the archives and search, etc. But is there a higher level to apply that code to insure that the news story content visibility is restricted in every possible place? For example, would we have to apply that code individually to the RSS feed too, or is there just one go-to place on a higher level to do it? Thank you so much! This place is such an invaluable resource.


title: Link Posts to External URL

text: I'm building a site which lets users to submit links using User Submitted Posts plugin. I want every post title to link to its URL something like reddit. Moreover, User Submitted Posts plugin add URL to each post in the posts meta table. How could I do that?


title: Modifying WP URL handing code?

text: I am trying to use mod_rewrite and modify WordPress' URL handling to allow for passing variables to PHP from the URL while maintaining "pretty permalink" functionality. (on WP 3.2.1) Something like this: http:/epiclasers.com/hello-world (normal with permalinks set to /%postname%) http:/epiclasers.com/state/hello-world (WP should display the same hello-world post as above, but also would pass the state string to PHP as a variable) http:/epiclasers.com/state/city/hello-world (WP should display the hello-world post, but would pass the state and city strings to PHP as variables) I added the following mod_rewrite directives to my .htaccess file:               RewriteRule ^(\w+)/(\w+)/ /index.php?state=$1&city=$2 [L]     RewriteRule ^(\w+)/ /index.php?state=$1 [L]      which kind of works. The variables are being passed, and PHP can grab them with: > $state = $_GET['state'];   >  $city = $_GET['city']; The problem is that WP is getting confused by the variables in the URL and isn't outputting the correct template file. URL's like these: http://epiclasers.com/arizona/phoenix/   http:/epiclasers.com/arizona/phoenix/hello-world   http://epiclasers.com/arizona/ are bringing up the 404 page not found template. How do I modify the WP URL handling code to ignore the /state and /city parts of the URL without also breaking URLs like: http:/epiclasers.com/category/category1   http:/epiclasers.com/tag/tag1   http:/epiclasers.com/category/category2/subcategory etc. Thanks,   Devin


title: Remove unwanted part of permalink custom structure from CPT url?

text: My site currently has regular posts (in a section called "Trend Watch"), as well as a Custom Taxonomy (called "Region"). My permalink settings have this Custom Structure:               /trend-watch/%year%/%monthnum%/%postname%/      which gives me these urls:   * `/trend-watch/regions/` (lists all terms in the Regions taxonomy)   * `/trend-watch/regions/europe/` (lists all posts with the term "europe" in the Regions taxonmy).   * `/trend-watch/2011/03/an-interesting-article/` (a single post). But now i'm adding a new Custom Post Type, called Reports. When registering this CPT, I set `rewrite => array('slug' => 'reports')`. But the urls are including "trend-watch/" first:               /trend-watch/reports/some-report/      How can I remove "trend-watch/" from the Reports CPT urls, but keep it for regular Posts (and the associated Custom Taxonomies).


title: difference between add_options and register_setting

text: I am confused. Want to save data for my plugin. There are people who use add_options and there are others who use register_settings. My question is What is difference between `add_options` and `register_setting`?


title: get_last_updated() not working - multisite loop

text: I am struggling to get the get_last_updated() function to work on main blog. I have a network site with about about 9 blogs on it. I am simply trying to loop all my blogs and find do some querying from each blog. But I can't seem to get this simple `get_last_updated()` loop to work. Can anyone please explain why this might not work? Thanks in advance.               $events = get_last_updated();     foreach ($events as $event)         {                  echo $event["blog_id"];                  switch_to_blog($event["blog_id"]);                  // do my stuff                  restore_current_blog();          }      * * * Let me confirm. Is the get_last_updated() meant to return the latest added blogs. Or is this function meant to check for latest post in within the blog and return the latest added blogs? The codex does not really say what it does. And it is confusing me very much as to why this is not working or not returning anything. It's like the function does not work - because if I do this...               $events = get_last_updated();          if ($events) {               foreach ($events as $event)         {                  echo $event["blog_id"];                  switch_to_blog($event["blog_id"]);                  // do my stuff                  restore_current_blog();              }          } else {              echo 'help';          }      It just echo's help.


title: How to make an archive page template using Wordpress 3

text: I have a suitable page, archives.php, located in the theme's root directory, but I cannot get it to show up as a page template. Is there something else I need to do so that it is recognized?


title: Limit the menu child levels under "admin > appearance > menus"

text: in my effort in making the WP backend as user friendly as possible, I'm looking for a way to limit the amount of child (or submenu items) of the menu(s) under "admin > appearance > menus". They idea is: when a theme doesn't support a second menu level, its should also not be possible in the backend to add (drag) items to this level. I guess to achieve this, I would have to dive in the jQuery UI library (and more specifically the jQuery sortable library). Preferably without having to edit WP's core. Does anyone has any idea or experience in this? Looking forward to your ideas.


title: Wordpress comments - delimiter "/" not found

text: Im using wordpress comments as a "chat". Not real time chat its more like comments with more flow. But when 4-5 or more members using coments at the same time i get this message: ![enter image description here](http://i.stack.imgur.com/ExDbwm.png) Not sure why this happens or if its because more than one user is using it at the same time. Is there anyone here who had the same problem or could lead me in the right direction ?


title: List of buyers for each product

text: I would like to know if it's possible to get the complete name of each buyers for a specific product or the orders list of a specific product ?


title: How do you remove the buddypress group avatar from the activity stream post?

text: When a member post to a group it shows up in the activity feed under “username posted an update in the group” then its followed by the group avatar then the group name. So I was wonder how I could remove the group avatar from the activity action. Is their anything I could add to the functions.php or bp- customs.php? I would rather not try hiding it through css.


title: taxonomy terms array not working

text:
I'm working on a solution to filter a custom post type by multiple terms in multiple taxonomies. Here is my code:               <?php $term = "peoria,adams"; ?>

                  <?php $term = explode(',', $term); ?>                  <?php $term_count = count($term);              $array_term = $term[0];             ?>                  <?php                  $i = 1;                 while ($i < $term_count) {                     $array_term = "'" . $array_term . "', '" . $term[$i] . "'";                     $i++;                 }                 ?>                  <?php echo $term = "array( ". $array_term . " )"; ?>                  <?php //echo $array_term; ?>                  <?php                 $args = array(                     'post_type' => 'property',                     'tax_query' => array(                         'relation' => 'OR',                         array(                             'taxonomy' => 'Status',                             'field' => 'slug',                             'terms' => array( 'Locked' )                         ),                         array(                             'taxonomy' => 'County',                             'field' => 'slug',                             'terms' =>  $term                         )                     )                 );                 $loop = new WP_Query( $args );                 while ( $loop->have_posts() ) : $loop->the_post();                     the_title();                     echo '
';                     echo get_the_post_thumbnail();                     the_content();                     echo '
';                 endwhile;             ?>      I echo `$term` and it display what it should display but it does not work when I call it in `'terms' => $term` it does not work but it will work if I replace it with `array( 'peoria', 'adams' )` it works. I have a suspicion I'm doing something stupid but I'm just missing it. Can someone give me a hand? Thanks in advance!


title: Store in media library image uploaded from url

text: Is there a plugin that when upload from url/web, it will also give an option to store the images locally and/or into the media library?


title: Gel all image from certain post type

text: I've found similar questions here, however I can't modify the answers to get images only from a certain post type - as the post type in those examples are "attachment" and not the name of a custom post type. Is there a way to declare a custom post type argument as well? Similar question, another similar question


title: How to use my own custom session value in Wordpress?

text: How can i use my own (custom) session value in Wordpress?   For example: `$_SESSION['myname']="4lvin"`   I've already inserted `session_start()` at all page i need as following.               <?php     session_start();     $_SESSION['myname'] = "4lvin";     ?>      But not working Global-wise.   Just working on the self page.   It is NOT call-able Globally from another pages (using same logic).


title: show all the posts thumbnails

text: I want to display all the posts by the featured image of each post. Is there a shortcode or can you give me some tips on how to achieve this ? Thanks!


title: Integrate ZOHO Recruit API?

text: I'm working with a client using ZOHO Recruit to manage his staffing agency. The form for candidates to submit their information is given by ZOHO as a simple embed code. However, for employers to submit their jobs, it must use ZOHO's API - which is beyond what i know how to do so far. I'm all up for learning and have been looking for tutorials, but I can't find a good starting place to learn. Here is what ZOHO sent - anyone around to give me a starting place to know what to do with this? http://www.zoho.com/recruit/api.html http://www.zoho.com/recruit/add- records.html


title: Sanitatizing when using the posts_where hook

text: I am altering the WordPress query, using the `posts_where` hook, when a (custom) query variable is set as follows:               add_filter('posts_where', 'my_posts_where' );     function my_posts_where( $where ){         global $wp_query;              if( isset( $wp_query->query_vars['customvar'] )) {             $custom_Var = $wp_query->query_vars['customvar'];             $where .= " AND wp_MyTable.Column ='".$custom_Var."' ";         }         return $where;     }      This works well, but I want to **sanitize** it. In particular, I've tried using `$wpdb->prepare()` method:               $where .= $wpdb->prepare(" AND wp_MyTable.Column = %s", $custom_Var);      But this doesn't work (I just get a blank page). Why is this and is there another / better way of sanitizing the variable?


title: post->post_content filter

text: I'm trying to determine if the REGEX I'm using is incorrect -- or if I'm missing something basic here. The following:               add_filter('the_content','wpdu_image_replace');     function wpdu_image_replace($content) {         global $post;         preg_replace( '//', 'Image file', $post->post_content );              return $content;     }      should look for any `<img>` within `post->post_content` (the post's content) and replace the entire tag with an `href` that simply links to the image file. In the end what I'm going to do with this is a bit more complex -- but I figured I'd start with the basics. Any help would be greatly appreciated. Thanks!


title: Making Media Library "Alternative Text" Field Required

text: I'm looking to make the "Alternative Text" field required in the Media Library, just like the "Title" field above it. Screenshot: ![enter image description here](http://i.stack.imgur.com/sMO4E.png)


title: Hiding a Categories content on just the Homepage 'Posts'?

text: Is there a way I can hide a certain categories content from just the homepage Posts section of my Wordpress Site? So, those posts are still posted and live; just not visible nor accessible from the homepage posts area. I'm calling the category twice on the homepage; once in the header within a plugin I'm using, and the other where the posts are created by default by Wordpress. How can I hide my 'featured' category in the main page content of recent posts on the homepage?


My basic question is **How do I make my wordpress page more friendly for mobile viewers?** I have seen some answers such as wptouch, wordpress mobile pack, and mobilepress http ://wordpress.org/extend/plugins/mobilepress/ . All great, however I enjoy my theme and was wondering if there is a way to not-autoload images, and if there are some more versatile themes which can scale to smaller screens. Thank you in advance for your help.


title: How I got jQuery Quicksand working with WordPress?

text:
I have been tryin to make this plugin work but I failed badly. I have the code like below: The `portfolio-terms` is filtering buttons:

<?php _e('All', 'framework'); ?>/
                         <?php                          wp_list_categories(array(                                 'title_li' => '',                                  'taxonomy' =>                                  'skill-type',                                  'walker' => new Portfolio_Walker(),                                 'show_option_none' => ''                             )                         ); ?>

            The `portfolio-items` is the images that need to be filtered:                        <ul id="portfolio-items" class="<?php if($magic_door) : ?>enabled<?php endif; ?> clearfix">                         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                              <li id="portfolio-<?php the_ID(); ?>" class="<?php echo $output; ?>visible">                                  <div <?php post_class() ?> id="post-<?php the_ID(); ?>">                                      <a class="entry-link" href="<?php the_permalink(); ?>">                                      <?php tz_featured_image(get_the_ID(), TRUE); ?>

                         <?php endwhile; endif; ?>
            I was using this jQuery code:                                     But does not work. here my theme test: http://stakk.it/ Can someone help me? Thank you!


title: Custom post type, permalinks & pagination, going wrong

text: i have a site (http://fashionlog.com.br) with a custom post type 'fotolog' as you can see on the right side. The posts and pagination of the blog (central column) work fine. But when it comes to the posts and pagination of my CPT it goes wrong. If i dont use **the flush_rewrite_rules( false );** function after my register_post_type() call in functions.php, i can see the posts but the pagination doesnt work. If a use the function it's the oposite, i can't see the posts (404) but i get the pagination! I've been trying lots of times to switch the permalinks structure for tests, i checked my .htaccess file and its permissions, i tryed to "play" with the 'rewrite' parameter of the register_post_type() function, i've read and tryed the solution written here, here and also here... So far no luck, or am i missing something super obvious? I'd really be grateful for some help.


title: Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?

text: Ok so i have a custom post type called 'profile' with a custom taxonomy called 'company'. The site has many profiles and companies defined, with profiles being associated with companies as necessary. I have created a taxonomy-company.php template and have the correct profiles being displayed, but i don't know how to get the name of the company being displayed so that i can put it at the top of the template. Is there a quick way, perhaps a variable or function call that gets me that? Thanks.


title: How can I troubleshoot why TinyMCE won't load custom plugins in the visual editor?

text: **Edit:** Found that the theme options panel set up (using a class) was causing the problem. Still not sure why - would still love know how to find out what the problem is - e.g. is it a JS or PHP issue. Going to try a different method of creating the theme options panel to see if it fixes the problem. * * * I am able to add extra TinyMCE buttons that are bundled (e.g. HR, anchor), but am unable to add custom plugins of my own. I have also noticed that other plugins (WP-Table Reloaded, cForms, TinyMCE Advanced) are also unable to load custom plugins. Disabling all other plugins does not solve the issue. What could be causing this, and/or how can I find the problem? When viewing source of an edit post screen, mceInit options do not list any plugins besides those defined as WP default. Altering the $initArray does work, but of course does not point to the correct location of added plugins.


title: Sorting/Filter posts from front-end in Wordpress blog

text: Here is the design I have mocked up http://enormo.us/clients/ischool/ The question is, how can I create a filtering system where the main blog area acts as the central feed and it combines the result of all three filters. I would know how to do one of those rows, but im having trouble with all three together. For instance clicking on ischool life, students, and comments; would bring up only posts that are in the category iSchool Life, written by students, and sorted by the most comments. Any help would be appreciated, even doing this type of thing not related to WordPress that would be cool too. I know it is used in eCommerce sites all the time. Thanks, Dave


title: wp_admin edit.php slow with lots of queries

text: I have about 4,000 posts. Currently when I click on All Posts (edit.php) it's taking about 10 seconds to load and I'm showing approximately 1000 queries! Most of them look like...               SELECT t.*, tt.* FROM wp_terms AS t      INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id      INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id      WHERE tt.taxonomy IN ('post_tag') AND tr.object_id IN (37336)      ORDER BY t.name ASC      If I deactivate Wordpress SEO, I can cut the number of queries in half but the page still takes approximately 7 seconds to load. Just for fun, I deactivated all my plugins to no significant performance improvement. I've tweaked MySQL and PHP in about every way I can think of. The issue is the exorbitant amount of queries. Any way to tweak Wordpress here to use less? I have tried deleting revisions, etc. Nada. Really could use some insight here. Thanks!


title: drop in qtranslate plugins on fresh install

text: How would I go about setting up a drop in config for fresh wordpress installs that would 1) install qtranslate (or other plugins for that matter) 2) configure qtranslate to use the languge settings i define? As i find my self setting this up for every site i make now and its just another thing eating time, I have seen a little about drop ins / MU's but unsure how to start .. thanks


title: Archive page showing wrong month

text: My site's archive page is echoing wrong Month name. Though the URL is `2012/11/`, it's echoing the month `December 2012`. I found nothing wrong with the code:               <?php     if ( is_day() ) :     printf( __( 'Daywise Posts: %s', 'theme-name' ), '' . "". get_the_date() . "" .  '' );     elseif ( is_month() ) :     printf( __( 'Month-wise Posts: %s', 'theme-name' ), '' . "". get_the_date( _x( 'F Y', 'monthly archives date format', 'theme-name' ) ) . "".  '' );     elseif ( is_year() ) :     printf( __( 'Year-wise Posts: %s', 'theme-name' ), '' . "" . get_the_date( _x( 'Y', 'yearly archives date format', 'theme-name' ) ) . "".  '' );     else :     _e( 'Archives', 'theme-name' );     endif;     ?>      It's WordPress 3.4.2 here.


title: How to allow visitors to filter posts by multiple taxonomies

text: I am trying to allow users to filter a custom post type list by multiple taxonomies. For Example lets say my custom post type is **clothing** and it has two custom taxonomies **brand** and **type** associated with it. I would like a visitor to first see all clothing posts, then they could click on a brand link that brings them to a listing of all clothing in that brand(I can do this part). From that list of clothing in the chosen brand, I'd like them to be able to further narrow down the list to a type of clothing such as pants, so that now they are seeing a list of pants made by the brand they previously chose. I've looked around, and I found an older post showing how to do this by creating some rewrite rules: but, I'm really hoping there's an easier way than using rewrite rules out there now. Can anyone point me in the right direction here?


title: By Default, Turn Comments Off for Pages & Leave Comments On for Posts

text: By default "Discussion: Allow comments." is checked when a new page or post is created. I know you can make "Discussion: Allow comments." unchecked by default on both pages and posts by going to "Discussion Settings" and unchecking "Allow people to post comments on new articles". I would like the default to be:   * On posts: Discussion: Allow comments. (checked by default)   * On pages: Discussion: Allow comments. (unchecked by default) I do not want to use a plugin and don't want to modify the main WordPress code. I was hoping I could make a function in my functions.php file to do this? Something like:               function disable_comments_on_pages() {          }     add_filter( '', 'disable_comments_on_pages' );


title: How to change the position of Jetpack sharing icons?

text: ![Jetpack Sharing buttons settins](http://i.stack.imgur.com/Y2Drn.png)   Typically Jetpack sharing buttons target the single page's `the_content()` function and echo the sharing icons just below the content. But for my site, I actually want it to **Disable** for `the_content()`, but to use it in some other `<div>`. I know I can check the "Disable CSS and JS" checkbox to disable the built-in functionality, but I actually don't want to code more and I like the default CSS of Jetpack sharing icons. I simply want a Javascript code to alter the target of Jetpack so that instead of showing under the `the_content()` I can show it under another custom `<div>` of my choice. Is it possible with any filter or hook? P.S.: I just renamed the "Posts" to "Products" for my project. It's nothing to worry about. :)


title: Redirect & permalink problems after moving multisite to a new server

text: I just moved my subdomain multisite to a new server and I'm having some trouble with permalinks & redirects. One difference post-move is that I have moved core WP files into it's own directory `/wp` (see roots/bedrock folder structure. Now when I try to access `/wp/wp-admin`, I am redirected to `/wp- login.php?redirect_to=...` which comes up as a 404 of course because that file does not exist. However, if I comment out the multisite constants in the config, I am able to access wp-admin as a non-multisite without issue (which is how I was able to make sure I have the right .htaccess below - from Tools > Network Setup). I have `.htaccess` setup with the rules instructed by WP for multisite:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^(wp-(content|admin|includes).*) wp/$1 [L]     RewriteRule ^(.*\.php)$ wp/$1 [L]     RewriteRule . index.php [L]      The other problem is that even with multisite off, I get a 404 when trying to go to any page other than the homepage. I've read that multisite stores some path info in the DB, so perhaps a search/replace is necessary? * * * # Update 1 I was able to resolve* the problem I had with the redirect to 404 when trying to access wp-admin. This was simply due to changes that needed to be made in the database for the `siteurl`. I was of the understanding that this value was superceeded by the WP_SITEURL constant. This does not seem to be the case with Multisite - probably because it has to be different for each site. Once I corrected the `siteurl` in the options table for each site, that site would work (wp-admin could be reached). ## 2 Problems remain   1. **Permalinks are still not working as they should.** Now that I can access wp-admin, I have gone in, and resaved to update the permalink structure which seems to have no effect. By not working, I mean I get a 404 when navigating to anything away from the front page of that site.   2. **Network admin is inaccessible via the admin bar.** The URL for Network admin it's giving me is missing the `/wp` directory. If I access it directly, `/wp/wp-admin/network/` \-- it works. For some reason, the generated URLs in the admin bar are missing this and are broken. If I change `define('PATH_CURRENT_SITE', '/');` to `define('PATH_CURRENT_SITE', '/wp/');`, those URLs are correct, but trying to access them fails. That does not seem like the right thing to do in this case as one would expect that to be shown under `/wp-admin/network/setup.php`. After some digging, I found that these links are generated by `network_admin_url()`. Essentially the responsible line of code is `set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );` from `network_site_url()`. * * * # Update 2 I was able to resolve the permalink issue. As it turns out it was actually the virtual host configuration in apache! I had `AllowOverride none` set for my site's `<Directory>` directive, which I think was preventing any of the .htaccess rewrite rules from being applied. I should've realized earlier that this was the case as the 404 I was getting was from apache, not wordpress... The only remaining weirdness at this point is the wrong url generated by `network_admin_url()`. Will post an answer if I figure this out.


title: File permissions for wp-minify plugin

text: I am worried on installing Wp-Minify plugin. But it needs 777 permission for the cache directory located inside wp-uploads directory. Isn't it a security issue?


title: Can I use Woocommerce to take orders but not handle payment?

text: I would like to create an ecommerce website. In this website the customer will browse the product catalog, add the desired products to his cart, maybe create an account, and during the checkout phase, will leave a phone number along with his shipping information and address. I will then manually review every order made (and be notified via email for new orders), call the person and handle it from then on. Is this possible or do I have to let woocommerce handle the payments using a gateway like PayPal? If it is possible, can someone please guide me how to set it up like so?


title: How to display post permalinks instead of pages?

text: I am working on a website for comics, and whenever you go to it, it should open the latest POST. I have no pages, I deleted them all. All the website has, is posts. So I want that whenever people start going "Next" to the next posts, it will display the permalinks (fancy URL) of posts, not weird page URL such as:               www.example.com/?p24


title: Custom content for Custom Post Type parent page?

text: I'm looking to set a static page as the parent for a custom post type. Right now the parent page is showing all archives for that custom post type. For example `http://mysite.com/cpt` would show content from page ID 20. Is this possible? Edit: I created a new Page with the slug `/cpt`, it did not override the custom post type archive parent.


title: Does WP search natively return results sorted by type (post, post type, page, category...)?

text: I found many solutions to sort search results by type, yet in default WP theme twentythirteen (and probably any other), search results seem to be already sorted by type. I would like to get confirmation that native WP search indeed sorts results by type and if so how does it do that?


title: Wordpress audio link not working

text: I'm trying to add an audio file to a page. I've added the audio file to my media library, and added it to the page using the "Add Media" button. It added the following text:               [audio mp3="http://mydomain.com/wp-content/uploads/2014/01/6.mp3"][/audio]      The problem is that on the page itself, this generates a link, that leads to that same page, without passing along the file. I've changed the domain name in the above snippet because the domain name the site is currently on is temporary while my domain registrar is updating dns settings.


title: Remove the first occurrence of a sub-site slug from URL

text: I have a multisite install with about 30 sub-sites. I want to know if it's possible to remove the sub-site slug if there are more than two occurrences of it in the URL. For instance:   * `http://example.com/subsite1/` \- That URL is okay   * `http://example.com/subsite1/subsite1-about/some-content` \- I would like to remove the first occurrence (from the left). I'm not sure how to do this and not sure if using Regex or `mod_rewrite` is better suited. Any thoughts and suggestions are appreciated.


title: Registering a stylesheet inside my WordPress widget

text: I did see the other topic similar to this but I cannot get mine to work. I am using WordPress 3.8 and am creating a custom widget for a site. I need to style it a certain way so I need to load an external stylesheet. I have tried:               function widget($args, $instance)       {         wp_enqueue_style( 'gamestats-style', plugins_url('css/styles.css', __FILE__) );               //Widget content       }      with no luck. I have the css file located in the css directory of my plugin directory "game-stats" so i believe the url is correct. plugins/game-stats/css/styles.css if I embed the styles in the php by way of `<script>....styles...</script>` it works fine but this is really bad practice. What am I doing wrong? Any help would be greatly appreciated.


title: WordPress/jQuery pagination plugin for multiple lists

text: I have 3 shortcodes. Each of them will be displaying a list. PS> the lists do NOT contain wordpress posts/pages. Is there any WordPress plugin that can achieve the purpose? OR Please suggest me a jQuery plugin that uses Ajax to fetch subsequent paged data and can work with my scenario.


title: Remove Sidebars from page

text: If I wanted to remove 1 or more sidebars when a certain page is called what is the best way to go about doing that?


title: Custom PHP App with a wordpress site

text: I have created a new 'page template' and (this is probably not the right way to do this, but this is the way I have got it working), and created a new page using that template. Within the page template (PHP file) I have made, I have put lots of PHP which makes the page function, like it has a simple login an view information from a SQL table. The problem is, I need to be able to send $_GET data to the page. I can send POST fine, but not GET, and I dont know what the URL is. For example, I would like to have clean URLs (that is what I have set wordpress to) i.e.: domain.com/teaching-portal/mygetdata The name of the page template is teaching-portal, and I would like to get `mygetdata` into PHP. But currently anything passed after teaching-portal results in a 404 page. How can i achieve this?


title: WP e-Commerce Gold Cart with Plugin Built Into Theme

text: I am using this theme on our site. http://themeforest.net/item/icarus- business-ecommerce-theme/1535471 It has the wp e-commerce theme built into the theme in the /wp- content/themes/icarus/plugins/wp-e-commerce directory. I want to know how to install Gold Cart with this theme. I have tried just installing Gold Cart normally to the wp-content/plugins directory, but if I remember correctly it caused the white screen of death when I tried to activate (I'd have to try it again to confirm that's what happened). Then I tried moving it to the same directory structure as WP e-commerce (/wp- content/themes/icarus/plugins/gold-cart-plugin-2.9.7.2), but it doesn't seem to be recognized. I don't see any new options in wp e-commerce; I am expecting to see additional gateway options. Can anyone tell me how to get gold cart to work with this set up? Also, can you tell me how to update wp e-commerce independently from updating the theme? Do I just copy the new version into the /wp- content/themes/icarus/plugins/wp-e-commerce directory? Thanks so much!!


title: How can we set up a solid test site with Network mode (sub-domains) enabled?

text: **Update:** I came by a reasonable alternative to the approach explained below, instead using a GIT repo and a WordPress Multisite plugin: Deploymint: a staging and deployment system for WordPress. Sites:   * jmonkeyengine.org   * test.jmonkeyengine.org We have created a separate folder on our server, like `/root/sitetest/wwworg/`, for the test.jmonkeyengine.org sub-domain (not multisite, just a custom created sub-domain). We've also set up Webmin on the dedicated server hosting our sites. One of our developers has constructed a really handy script in Webmin's "Custom Commands"; at the click of a button an exact copy is made of our live site and moved over to test.jmonkeyengine.org where we can play around in a live environment at no risk. We'd like to enable WordPress Network, but it seems very likely that doing so would make it difficult, if not impossible, to maintain this method of site testing. I'm not a very technical guy, but I'm seeing two possible options:   1. We do a sub-directory install. This should hopefully enable the cloning script to go about its business as usual, as there's no tricky domain changes involved. If we still wanted to apply sub-domains, I suppose maybe we could still do that by using the MU Domain Mapping plugin, or by setting up our own masks(?). I don't know how well that would go over with various SEO plugins though, e.g. analytics & sitemaps. Furthermore, our site is not "new", which apparently is required in order to make a sub-directory install possible.   2. We do a sub-domain install (preferred). However instead of reassembling the cloned sites on test.jmonkeyengine.org (I assume we couldn't easily copy `jobs.jmonkeyengine.org` to `jobs.test.jmonkeyengine.org`) we'd point it to some new top level domain like jmonkeytest.org, that could handle sub-domains. Maybe some changes would have to be made in .htaccess and so forth either in the script or by hand. Whether or not it'd be worth the otherwise convenient test setup remains to be seen. Does anyone have any experience with this type of setup?


title: Function to echo (or display?) wordpress tags in the head section

text: I can't figure this out but I'm trying to echo the post Tags of the post in the `<head>` section. This code resides in the `<head>` section of the site. Basically I want the post tags to appear between the quotes.               ados_setKeywords('');      I've tried using `wp_get_post_tags()`:               ados_setKeywords('<?php echo wp_get_post_tags() ?>');       However this only gives me 'Array'. I need to either display the post tags or nothing.


title: Add URL field to wordpress taxonomy

text: Like the title states I'm trying to add a URL field to taxamony.               function create_post_type() {       register_post_type( 'brands',           array(               'labels' => array(                   'name' => __( 'Brands' ),                   'singular_name' => __( 'Brands' )               ),           'public' => true,           'menu_position' => 5,           'supports' => array('title', 'editor', 'thumbnail'),         'rewrite' => array('slug' => 'brands')           )       );       }           add_action( 'init', 'create_post_type' );           function partner_taxonomy() {          register_taxonomy(           'partners',           'brands',           array(               'hierarchical' => true,               'label' => 'Partners',               'query_var' => true,               'show_ui' => true,             'rewrite' => array('slug' => 'partners')           )       );       }       add_action( 'init', 'partner_taxonomy' );      From here how do I add an URL field to "Partners" taxonomy? Also code to be added to the taxonomy.php page for display. Thanks


title: Custom taxonomy huge list not loading properly in select box

text: I have custom post type "Book" and custom taxonomy "Author" associated with books. I have used remove_meta_box to hide default UI for taxonomy, because it was like tags where you can add multiple tags and select multiple tags for post. What i want was that only one author is associated with book. So i used add_meta_box to create select box for authors where admin can select one author from list. Now authors list has grown beyond 3000 authors and select box does not seems to load it properly..... I don't want to go back to original UI like tags.... Is there any thing where i could give search, pagination and add functionality(add only one taxonomy) in meta box.... This is code i am using..               remove_meta_box('tagsdiv-book_author', 'book', 'normal');          add_meta_box('custom-taxonomy-author-dropdown','Author','author_dropdowns_box','book','side','high');          function author_dropdowns_box( $post ) {         wp_nonce_field('custom-author-dropdown', 'author-dropdown-nonce');         $terms = get_terms( 'book_author', 'hide_empty=0');         $object_terms = wp_get_object_terms( $post->ID, 'book_author', array('fields'=>'ids'));               echo "Author:";         echo "<select id='bauthor' name='bauthor[]'>";         echo "<option value='0'>None</option>";         foreach ( $terms as $term ) {                      if ( in_array($term->term_id, $object_terms) ) {                     $parent_id = $term->term_id;                     echo "<option value='{$term->term_id}' selected='selected'>{$term->name}</option>";                 } else {                     echo "<option value='{$term->term_id}'>{$term->name}</option>";                 }              }         echo "</select><br />";          }          add_action('save_post','save_my_custom_taxonomy');


title: Custom Post Type Slug prefix that includes the path of a post from another custom post type

text: Let's say I have the following post types:   * secondary   * episode I have a post named "Episodes" in post type "secondary" (to talk about and list recent episodes), its url would be: http://www.example.com/secondary/episodes/ **Now, the problem is** I want posts of type "episode", e.g. "First Episode", to have the following URL; http://www.example.com/secondary/episodes/first-episode/ Specifying /secondary/episodes/ as the custom post type slug doesn't work and returns a 404, probably because WordPress at that level is expecting only /page/1/ or subposts of post "episodes". How would I override this or reverse the priority so that it follows the "episode" post type rule before worrying about the default "secondary" subpost rules? Let me know if I didn't explain myself well and there are any doubts. (I know I could use a custom post type archive to list custom posts and get the same URL slug prefix, but due to the navigation structure in this site I must stick to one physical post for post archives, to show it on a menu automatically).


title: Wordpress search page doesn't work with either $_GET or $_POST

text:
I'm trying to create a general search page. I've created a search page template and a new search page, and set the form's action to the URL of this page. When I access the search page directly it fetches the right template, but when I try to send a form to this URL, be it via $_GET or $_POST, I am directed to the default index.php template. Form code:               <form action="<?php echo get_permalink(359); ?>" method="GET">                    <input name="s" type="text" id="search_box">                    <input type="submit" value="submit" style="visibility:hidden;">                      </form>      Search page code:               <?php // Template Name: חיפוש      get_header(); ?>
     <?php          $search = new WP_Query(array('s'=>$_GET['s']));          if ($search->have_posts() ) : while ( $search->have_posts() ) : $search->the_post(); ?>
<?php the_title(); ?>
     <?php the_excerpt();     endwhile; ?>          <?php else: ?>          <?php endif; ?>     ?>
     <?php     get_footer();


title: Translation-readiness of Koi theme

text: I am migrating a (non-English-language) blog using the Koi theme on WordPress.com to a self-hosted environment, but see that certain strings are no longer being translated. For example, if my wp-config.php file contains `define ('WPLANG', 'de_DE')`, then _most of the theme is indeed translated to German, but "Leave a Comment" remains in English. After downloading the 'koi-wpcom-1-1.zip' file from WordPress.com, and digging around in the theme's code, I have the following questions:   * On one hand, the theme's code shows evidence of translation-readiness in that all strings are wrapped by the `'__()'` function. For example: `__( 'Leave a Comment', 'ndesignthemes' )`.  On the other hand, nowhere do I see any use of `'load_theme_textdomain()'`! Might that mean that parts of the theme are getting translated because the corresponding strings have already been translated for the WordPress core, but no theme-specific translations are being performed due to "missing pieces" at the theme level?   * I have tried fixing/completing the translation by doing the following, but so far no success:     * Explicitly added `load_theme_textdomain( 'ndesignthemes', get_template_directory() . '/languages' );` to functions.php     * Visited WordPress.com's German translation project for the Koi theme (GlotPress), and downloaded the corresponding 'wpcom-themes-koi-de.po' and 'wpcom-themes-koi-de.mo' files. Also verified that the *.po file explictly contains a translation for "Leave a comment" ("Hinterlasse einen Kommentar").     * Per my understanding, renamed the above files to 'ndesignthemes-de_DE.po' and 'ndesignthemes-de_DE.mo', and copied them into 'wp-content/languages/themes' directory.     * After the following failed to cause "Leave a comment" to get translated, tried all variations of renaming the *.mo/*.po files to 'koi-wpcom-de_DE.*', 'koi-de_DE.*', 'wpcom-themes-koi-de_DE.*', and 'de_DE.*'; and/or to copying them instead to their 'wp-content/themes/koi-wpcom/languages' theme-installation directory.  ... but nothing helps. Can anyone help me understand what is the problem and how to fix it?


title: update_post_meta() not working in save_post

text: I have added some text input fields to metabox in my custom post. Now whenever I put some data in those text fields in admin panel and click 'save', all data vanishes. Here is the code:               <?php     function swpd_render_info_fields()     {         ?>         <label for="swpd_comany_addr">Company Address</label>         <input type="text" name="swpd_company_addr" id="swpd_company_addr" />         <?php     }     /* * Process the custom metabox fields */     add_action( 'save_post', 'swpd_save_info_fields',99 );     function swpd_save_info_fields($post_id) {         global $post;         if(isset($_POST['post_type']) && ($_POST['post_type'] == "swpd_directory")){             update_post_meta( $post->ID, 'swpd_company_addr', $_POST['swpd_company_addr'] );         }     }     ?>      I have checked the data passed to update_post_meta() and it seems o be fine, $post->ID containes the post ID and $_POST['swpd_company_addr'] containes the string I want to save to meta. I really did a thorough search and none of the solutions fixes my problem. What can be wrong?


title: Should I install blog on subdomain or subdirectory?

text: Which is better? If I install it on a subdirectory how do I go about doing that? Create a subfolder named blog and install a new copy of wordpress to that? My site currently uses wordpress, so I am not sure how this would work out.


title: single.php not pulling in any data from database

text:
My single.php doesnt seem to be fulling any information through from the database for the current post. here is my single.php code:               <?php get_header(); ?>

          <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Stats for <?php echo get_the_id();?><?php the_title(); ?>
                   <?php endwhile; else: ?>
 <?php _e('Sorry, no posts matched your criteria.'); ?>
     <?php endif; ?>
                            <?php get_sidebar();?>

                <?php get_footer();?>      Any ideas what the issue could be?


title: Merge two custom post types into one admin page?

text: I am building a site with 4 custom post types. To make things easier for our client/admin, I'm wondering if there is a way to merge those custom post types into one list in the backend? Like if you look at normal backend admin page with the list and columns of posts, can a page like that pull in 3 other post types for easy sorting/searching? I can't combine the CPTs into one, they must remain seperate outside of one 'viewing' page in the admin area if possible. Any thoughts on how to do this?? Or even where to start looking/thinkging of how to develop this?


title: Custom Content Slider stop duplicate

text:
I have been working on this now for little while, I have four post displaying in the carousel, this is fine. when you click the next slide in the carousel the same four posts are displaying Any ideas what I did wrong? Thanks

                  <?php $query = new WP_Query(array('post_type' => 'post', 'posts_per_page' => -1,)); while ( $query->have_posts() ) : $query->the_post(); ?>                  <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

           <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

          <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

           <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

             <?php endwhile; wp_reset_postdata(); ?>

                                                          R                L
          <?php get_sidebar(  ); // right ?>


title: Work-around for fatal memory error in BackupBuddy job to Dropbox on shared host?

text: I am trying to configure BackupBuddy to transfer a 250MB backup set to Dropbox on a shared host (DreamHost). DreamHost runs a process monitor that automatically kills any process that exceeds a certain threshold (seems to be somewhere between 128MB and 256MB, from my tests). BackupBuddy uses a PHP oAuth Dropbox API call that requires the entire backup set zip file to be held in memory and transferred in a single call. Below are the configuration and results of one test case run for two blogs (both failed). A similar test case after increasing memory_limit to 256MB also fails - I believe in that case the host's monitor kills the process. Any advice on how to get these three vendors (BackupBuddy, DreamHost, Dropbox) to "play nice" together would be much appreciated. Aside from a limited amount of leeway I seem to have in adjusting the memory_limit, I don't think I have anything else I can configure to resolve the failure. The simple answer would be to get a refund of the $100 BackupBuddy purchase, but at least so far that refund request is being denied. BackupBuddy techs are confident that there is a solution within the given constraints but I can't find it. **Configured in phprc (php.ini):**               max_execution_time = 60     memory_limit = 128M      **Size of backup file:** about 35MB **From the BackupBuddy debug log:** > [Feb 20, 2012 10:34:52 -5-all] Setting greedy script limits.   >  [Feb 20, 2012 10:34:52 -5-all] Launching remote send.   >  [Feb 20, 2012 10:34:52 -5-all] Starting Dropbox transfer.   >  [Feb 20, 2012 10:34:52 -5-all] About to put object (the file) to Dropbox > cron. **From the PHP error log:** > [20-Feb-2012 15:34:53] PHP Fatal error: Allowed memory size of 134217728 > bytes exhausted (tried to allocate 35834605 bytes) in /home/xxxx/wp- > content/plugins/backupbuddy/lib/dropbuddy/pear_includes/HTTP/Request2/Response.php > on line 210 **Size of backup file:** about 252MB **From the BackupBuddy debug log:** > [Feb 20, 2012 10:34:52 -5-all] Setting greedy script limits.   >  [Feb 20, 2012 10:34:52 -5-all] Launching remote send.   >  [Feb 20, 2012 10:34:52 -5-all] Starting Dropbox transfer.   >  [Feb 20, 2012 10:34:52 -5-all] About to put object (the file) to Dropbox > cron. **From the PHP error log:** > [20-Feb-2012 15:40:35] PHP Fatal error: Allowed memory size of 134217728 > bytes exhausted (tried to allocate 253171937 bytes) in /home/xxxx/wp- > content/plugins/backupbuddy/lib/dropbuddy/dropbox_api/API.php on line 336


title: Get array of posts based on custom field values

text:
I'm looking to pull up an array of posts based on custom field values:               function GetPrimaryLinks($product){     echo '
';     $args = array(                    'product' => $product,                    'meta_key' => 'primary_link',                    'meta_value' => array(                                         'home',                                          'obj_handling',                                          'standalone_doc',                                          'advantages',                                          'weaknesses',                                          'top_comments') );     $primarylinks = get_posts( $args );     foreach ($primarylinks as $post) :  setup_postdata($post);     echo '
'.the_title().'
';     endforeach;     echo '
';     }      Therefore, I can reuse the function on various products to pull up the pages for 'Home', "Obj. Handling", etc. and only use one SQL query each time. This script obviously doesn't work because it's looking for posts with an array of meta_values, but I'm wondering if there's a way to write the function in one SQL query, rather than breaking up the meta_values into individual queries.


title: Get the number of comments awaiting moderation

text: Is there any 'official' way to get the number of comments, awaiting moderation? I've taken a look at get_comments_status \- is it what I need or are there other methods?


title: How to synchronize user profile fields in multisite?

text: I'm using wordpress multisite. I installed Multisite user management plugin. If a user register in my main sites then that user automatically added in all my sites. My problem it doesn't copy the profile datas. I don't want my users to fill the same data in all 50 sites. So is there any code available to sync the datas? I mean if a user fill the profile fields in main sites all sub sites should be updated with the same value. Likewise if the user edit the profile in `site10.example.com` it should be synced and updated in all sites. Is it possible? Thanks


title: How to include editable PDF in wordpress

text: I need to include a Existing PDF in website, where user can either fill or download it. I tried to use visual form generator, but it doesn't like actual form and I need to allow a user signature. Consider form is Similar to passport application. Any suggestions or Idea would be useful.


title: Update Old Links To Pretty Permalinks Custom Post Type

text: I'm looking for a plug-in or bit of php that will go through about 300 posts that use hyperlinks in the old p format:                     and automatically replace them with their %postname% pretty permalink. Eg:                     For whatever reason, these posts don't auto-magically do this when we changed Permalink structure so we're currently going through one by one. Thousands of links. I -think- the problem is that we originally imported them from static HTML pages. I'm wondering if the fact that they don't automatically re-write is because we're using a Custom Post Type? OR, is there a problem with the way we set up the taxonomy that prevents the automatic rewrite? If so, can someone provide some suggestions. Here's our taxonomy for this Custom Post Type (docs)               //helpdocs taxonomy     add_action( 'init', 'create_docs_post_type' );     function create_docs_post_type() {     $labels = array(         'name' => __( 'Documentation' ),         'singular_name' => __( 'Documentation' )       );         $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'show_in_menu' => true,         'query_var' => true,         'rewrite' => true,         'capability_type' => 'page',         'has_archive' => true,         'hierarchical' => true,         'menu_position' => 50,         'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt',         'comments',     'custom-fields', 'revisions','page-attributes','post-formats' )       );              register_post_type( 'docs', $args);     }     function docs_init() {     // create a new taxonomy     register_taxonomy(         'docs_tax',         'docs',         array(             'label' => __( 'Documentation_Tax' ),             'sort' => true,             'args' => array( 'orderby' => 'term_order' ),         'hierarchical' => true,             'rewrite' => array( 'slug' => 'docs' )              )     );     }     add_action( 'init', 'docs_init' );      TIA, \---JC


title: Can WP give a value a post ID?

text:
So I have queried out some data from another DB and obviously they're not a `post` which means I can't use the standard `permalink` to link them to an existing page with it's `post type`. So I thought that if WP could just generate an let's say "artificial" post ID to link to a certain generated page like any other `custom post type`. So basically a generated page like when you do `the_permalink` but for data from another database that is and will not go into the Wordpress DB as a `post` or whatsoever, the question would be if this is possible? My code so far:               $result    = $newdb->get_results("SELECT ".$column1.",".$column2."  FROM ... LIMIT 1 ");         <?php                foreach ($result as $results) {                  echo '
' ;?>             <?php echo $results->member_name; ?>           <?php                 echo '
' ;             } ?>      EDIT: I think I got a little further the link now updates into `localhost/wordpress?1` . It refreshes the page but I need it to go to it's unique page(for ex and empty page with only the css) This is the code now:               $result    = $newdb->get_results("SELECT ".$column1.",".$column2."  FROM ... LIMIT 1 ");             foreach ($result as $results) {                  echo '
' ;?>                 <a href="<?php echo '?id='.$results->memberID.'';  ?>"><?php echo $results->member_name; ?>               <?php                 echo '
' ;             }


title: How to pass multiple checkbox values to wordpress query?

text:
I am working on a website that has multiple check boxes and I want to show results based on what user has selected. There are about 16 check boxes for music, 8 check boxes for venues and 6 radio buttons for area. The user can check a maximum of 3 check boxes from Music category, a maximum of 3 from Venues and 1 from Area. How do I accomplish this wordpress query that would show posts only from categories that are selected. For example, If a user has selected House, Techno and Dubstep in Music, Miami as Area, and they want to search for events, music festivals, and live venues, How can I get that using wordpress query?               if(!empty($_POST)){                 global $names;                 $names  = $_POST['music'];                 $music = implode(",", $names);                 $echo $music;       }      That will echo out all the selected checkboxes as house, dubstep, Miami, music festivals. Now I want to show posts that are in caegories of house, dubstep and are in music festivals category, and in miami area. What I've used is                $args = array (           'category_name' => $music,           'posts_per_page' => 12,           'orderby' => 'title',           'order' => 'ASC',          );     $posts = query_posts($args);      But this will show all the posts from house, dubstep which is fine but it also shows all posts from music festivals that are not even in house and dubstep category. Here is my `HTML` code for `checkboxes`

Area:

All of London<input type="radio" name="area" value="london" checked="london"/>

North<input type="radio" name="area" value="north" />

East<input type="radio" name="area" value="east" />

South<input type="radio" name="area" value="south" />

West<input type="radio" name="area" value="west" />

Central<input type="radio" name="area" value="central" />

Music:

House<input type="checkbox" name="music[]" value="house" />

Techno<input type="checkbox" name="music[]" value="techno" />

Trance<input type="checkbox" name="music[]" value="trance" />

Electronica<input type="checkbox" name="music[]" value="electronica" />

Drum and Bass<input type="checkbox" name="music[]" value="drum-and-bass" />

Garage<input type="checkbox" name="music[]" value="garage" />

Dubstep<input type="checkbox" name="music[]" value="dubstep" />

Trap<input type="checkbox" name="music[]" value="trap" />

Hip-Hop<input type="checkbox" id="music" name="music[]" value="hiphop" />

R'n'B<input type="checkbox" name="music[]" value="rnb" />

Rock<input type="checkbox" name="music[]" value="rock" />

Indie<input type="checkbox" name="music[]" value="indie" />

Reggae<input type="checkbox" name="music[]" value="reggae" />

Retro 80's/90's<input type="checkbox" name="music[]" value="retro" />

Party Bangers<input type="checkbox" name="music[]" value="party-bangers" />

Chart Hits<input type="checkbox" name="music[]" value="chart-hits" />

Search Type:

Nightclubs<input type="checkbox" name="occasion[]" id="nightclub" value="nightclub" checked="checked" />

Events & Tickets<input type="checkbox" name="occasion[]" value="club-guide" checked="checked" />

Live Venues<input type="checkbox" name="occasion[]" value="festivals" checked="checked" />

Artist Interviews<input type="checkbox" name="occasion[]" value="artist" checked="checked" />

                              </form>       Thanks in advance for your help.


title: How to reorder meta box position?

text: I have a custom post type which have a lot of custom field that categories in meta box. The problem is how do I sorting the meta box in the order that I desired? As I know there is only 'high','core','normal' and 'side' for positioning the meta box, which is not a practical way to sorting the meta box. Let's say if I set 'high' position for two meta boxes, how do I know which one is on the top?? Thanks


title: Conference website with ticket-sales + sponsorship sales with WordPress?

text: I am considering moving away from Drupal and drupal-cod due to the lack of good themes. The two major features I am looking for are:   1. Ticket sales (PayPal), with receipts sent to attendee   2. Sponsorship sales (PayPal with different options: Gold, Silver, Bronze by price-range) Secondary features:   * StackOverflow style forum accessible by users within a specific role   * Facility to send newsletter to all attendees **Can you recommend a good set of free plugins, preferably built into one project for WordPress?**


title: Buddypress Full documentation

text: I have searched alot for finding the list of Full documentation for buddypress Hooks (action, filtrs) and functions but not satisfied with that limited documentation provided by Buddypress. Like if i want to find the detail about **bp_directory_groups_search_form()** there is no specific detail about this mehtod and same for buddypress hook also... So anybody know the exact location of full documentation available.


title: Displaying year once in category.php

text: I want to be able to make my category.php display like this:               2013     Title 3     Title 2     Title 1          2012     Title 3     Title 2     Title 1      It's already been done for displaying ALL posts but how do I get it to display only the category being viewed? Any assistance would be appreciated. Thank you!


title: How To Only Allow Users To View Their Own Buddypress Profiles?

text: I am currently developing a social-network sort of site using Wordpress + Buddypress and the client has asked that profile pages not be publicly visible for the time being. Basically the client is okay with logged in users viewing their own profiles, but if they try viewing a profile page of another user it should redirect to the homepage. I found the function: bp_is_my_profile() and tried using the following code at the top of the members/single/profile.php file to redirect users away, but it doesn't appear to be working. Any pointers?               <?php     if ( !bp_is_my_profile() )     {         wp_redirect(site_url(), 302);     }     ?>


title: get author in blog posts?

text: What do I need to do in order to have the author name in the blog posts on my wordpress blog? currently when I view a post it doesn't have the author that wrote the post.


title: How navigation works in custom loop within shortcode?

text:
I am using a shortcode to display a custom query. The shortcode is use in page. Everything is fine, only the navigation that I can't get it working correctly. Here is the function that I use to display the query calling by the shortcode:               $the_query = my_custom_query();     if($the_query){     if ($the_query->have_posts()) :       while ($the_query->have_posts()) : $the_query->the_post();         echo ''.get_the_title().'
';            endwhile;            next_posts_link(); previous_posts_link(); //here I can't get it right.            else : $return_string =  'no result';             endif;      }else{ echo 'ordinary page';}      The `previous_posts_link()` and `next_posts_link()` not showing up. Is it because the shortcode been inside the page main loop? **Update** this is the function to get the custom query               function my_custom_query(){              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                  $args = array(             'post_type'=>any,             'posts_per_page'=> 1,             'max_num_pages'=> 10,             'paged'=>$paged,             'meta_query' => array('relation'=>'OR',array(                         'taxonomy' => 'tax1',                     'field' => 'slug',                     'terms' => 'tax1term'                     )),             'tax_query' => array('relation'=>'OR',array(                     'key' => 'metakey',                     'value' => array(5,30),                     'compare' => 'compare'                        ))               );                 $custom_query = new WP_Query( $args);             return $custom_query;          }      **UPDATE 2** Now I can get the `next_posts_link(); previous_posts_link();` to display. But the problem is, it linked to a wrong page. The query results remain same posts on every page (regardless if it is Next or Previous page).               $the_query = my_custom_query();     if($the_query){     if ($the_query->have_posts()) :       while ($the_query->have_posts()) : $the_query->the_post();         echo ''.get_the_title().'
';            endwhile;            previous_posts_link('Previous',$the_query->max_num_pages); next_posts_link('Next',$the_query->max_num_pages);  //here I added $the_query->max_num_pages,and they shows up.        else : $return_string =  'no result';             endif;      }else{ echo 'ordinary page';}


title: separate home page into separate pages

text: I was recently asked to help out with a site where, as you can see, all the content is on one page. As it's less than elegant, I'd like to separate things out but I've looked around the menus and settings, I can't find anything obvious. If I click the "pages" link on the left side, I'm taken to a list of seemingly separate pages. When I click the "edit" button that appears after I roll over the page, I can edit just the content associated with that page (tho again, it's all on one page on the site - maybe I'm misunderstanding terminology). However, if I click "view" I get a server error. In fact, I get a lot of server/404 errors when clicking around the dashboard/other menu items. For example, if I click "Page Order" and then reorder pages and then click "Click to Reorder Pages" I'm taken to the site but with a "Four Oh Four Error". Another error - if I change the Settings > Reading Settings setting `Front Page Displays` from `Your Latest Posts` to `a static page` I get another server error. I could go on, but I'll leave it at that for now. (I can always add more to the comments.) Any help or pointers would be much appreciated. And if you feel like throwing in a link that will help me understand WordPress's structure, that'd be great. I come from an Programming background which should hopefully help.


title: Conditional Display of Links in Widgets

text: I want the links widget in my sidebar to display links based on the page the user is on. For example, if the user is on the home page I want it to display link1, link2 and link3. But if the user goes to the 'About' page I want the links widget to display link4 and link5. Is there a way to specify conditional display of links depending on the page id? Thanks


title: WP_Query with the "offset" argument

text: I'm making a custom query for posts using something like:               $p = new WP_Query();      $p->query(array('offset' => 30, 'posts_per_page' => 10));      If I have 36 posts on the entire blog, `$p->post_count` will return the number of posts that were retrieved, 6 in this case. I need to get the post count just like I would if I omitted this 2 arguments (so I can calculate the remaining post count). How can I do that, without making another query?


title: Display price range on woocommerce product variations

text: I am working on an online store using Woocommerce, many products have variations in size and price. Is there a way to have the range of prices (highest to lowest) of the variations on the product page?


title: How to edit caption for images and exclude it from excerption query?

text: I have 2 questions for caption for images: \- how to edti them with bold, italics and so on? I do it, but it doesn't work. \- if the image is first, how to exclude caption from excerpt in query especially for frontpage?


title: Steps for Moving Multiple WordPress Installs to a Multisite Install?

text: _( **Moderator's Note:** Original title was: "Steps to move multiple wordpress installations to a WP MU installation")_ Any tips on moving multiple WordPress installations to a single Multisite[1] installation? [1] _Multisite is the new name for WPMU._


title: Display All Sticky Post Before Regular Post

text: I would like to display all of my sticky post and then regular post thereafter. I am new to WordPress and not sure how to do this. Any help would be greatly appreciated.               ---------                    Sticky 1                     ---------      ---------                    Sticky 2                    ---------       ---------                    Sticky 3...                     ---------       ---------                    Normal 1                     ---------     ---------                    Normal 2....                     ---------


title: List posts with same tag?

text: Is there any way to list my posts by tags ? i need to alter the URL too... like **mysite.com/tags/mytag** will list all the posts having ' **mytag** ' as tag.


title: Permalinks on post is working, on pages 404 error

text: I am having troublle with setting my permalink in wordpress site. I changed the permalink from default to custome : `%postname%`. In this case my posts are working perfectly, but the pages are not. They generates a error 404 page not found. I've changed the .htaccess file permission, did everything, but nothing is working. Any suggestion to solve this?


title: Any kind of custom post type in the front page and in the archive listing

text: I have a custom post type:products to have my post from my custom post type i have changeed these codes               <?php         $post_count = 1;     ?>     <?php if (have_posts()) : while ( have_posts() ) : the_post() ?>      to               ?php         $post_count = 1;        $args = array(          'post_type' => 'products'       );      $products = new WP_Query( $args );     ?>     <?php if ($products->have_posts()) : while ( $products->have_posts() ) : $products->the_post() ?>      I have done same things for the archive.php also. But Now what i want to do i wont to get posts from different post types on my front page. Not any. And when i chose a category to get posts i want to get from different post types. Not any thispart inside of archive.php How we can do that.


title: Shortcut to widget/sidebar editing on the admin menu?

text: We have a sidebar consisting of some text. The client/owner will want to change the sidebar text occasionally. Out of the box he'll have to do this by navigating: -> Admin menu   -> Appearance   -> Widgets   -> look past the "Available Widgets" (all of which are irrelevant to him) to **Primary Sidebar** on the right hand side   -> Dropdown   -> _now he can edit the content_ He's going to be baffled that he can't edit this type of content as quickly and easily as he can a "Page". Or he'll forget where to find it. Is there a way to add a link to our Primary sidebar to the main admin menu?


title: How can I upload to wp media library by foundation zurb ajax

text: I am using zurb ajax image uploader. it works fine to upload to specific folder in FTP. but I can't really find how to add on wordpress media library. I have to get the thumbnail ids. Where I can find how to upload wp upload folder and add in database(wp-post, wp-post-meta) as attachment post. Basically, this is for users photos such as "my more pictures". I believe it should be in wp-user-meta table. any tips, tutorial? Thanks,


title: sidebar hierarchical menu category & custom post type

text: I'm working on a site with courses. I've created a custom post type "Course" and need to create a sidebar menu with the list of courses under the active category and then with anchor links to the custom fields within the course. The easiest way to see what I'm trying to achieve is to have a look at the mock up the designer created here: http://sharebucketapp.com/mMTk2YjRhNjNlMTAyNTk ![enter image description here](http://i.stack.imgur.com/jz9Kq.png) I'm at a complete loss as to how to go about this. I'm proficient in php but Wordpress is new to me and I'm having difficulty getting my head around it. Any help on this would be greatly appreciated. Thanks, Rob.


title: updated plugin 'plugin-list-category-post' is adding a non-linked item

text: > **Possible Duplicate:**   >  First item in each category list is not a link I did the update to the 'list-category-post' plugin, and now every page that I have this working on is showing a non-linked post title (seems to be randomly chosen) at the top of each of these pages. The item does seem to be a part of the category, but it is out of order, and doesn't have the list bullet and doesn't have a link. When I inspect the area I see the item thrown in before the li /li posts but after the ul As I said, this started with the update. Wordpress is the latest. Theme is Platform Pro


title: Getting post meta data, while editing a post in wp-admin panel

text: is there any chance of getting post meta data while editing post in wp-admin? For example -               $price = get_post_meta($post->ID, 'price', true);      isn't working, and it won't return post meta data, while editing post. I tried entering value and saving everything, but still it returned nothing.


title: Using WordPress functions on other sites

text: I have WordPress, set to multisite with subdirectories, installed at /, and a phpBB forum at /forum. Both sites are visually integrated, and share a common login process. I'd now like to integrate them further, for my ease of administratio; I want to use WordPress' header image, menu, footer and a few other theme related functions on my phpBB forum.   1. Is it even possible to embed WordPress in other pages?   2. How would one use them in the phpBB template files? (bonus question) (this question isn't fully tagged, since I don't have enough rep to make new ones yet).


title: How can I remove the comment form on one or more specific pages in twenty eleven?

text: I would like to remove the comment form on one specific page. Is this possible?


title: query_posts and sub pages?

text: I have a Page layout like this               Parent Page     - Sub page 1     -- sub sub 1     -- sub sub 2     -- sub sub 4     - Sub page 2     -- sub sub 1     -- sub sub 2     -- sub sub 4      I want to query every single child page, regardless of how deep I go. This is my query but it only returns direct children(sub page 1 and 2)               query_posts('post_type=page&order=ASC&orderby=menu_order&depth=4&post_parent='.$post->ID);      How can I do this?


title: Is file_exists() compatible with timthumb.php?

text: I'm using the latest timthumb script to generate my post thumbnails and include them along with the excerpt. Though I only want the thumbnails to load if their files actually exist, otherwise I don't even want the image placeholder to load. I'm going to be using this on a multi-user network, which is still in the early stages of development. And I want to test if the posts author has neglected to properly add the "thumb" custom field, which if they have, would normally return a 404 not found error. So I've put the following code in my loop which first determines if the post has any images then using the file path for the first image listed in the post checks if the file exists.               <?php     $content = $post->post_content;     $searchimages = '~]* />~';     preg_match_all($searchimages, $content, $pics);     $iNumberOfPics = count($pics[0]);     if($iNumberOfPics > 0){         $blogTemplate = get_bloginfo('template_directory');         $imgSrc = get_post_meta($post->ID, "thumb", $single = true);         $imgSrc = $blogTemplate . "/scripts/timthumb.php?src=" . $imgSrc . "&w=300&zc=1";              if(file_exists($imgSrc)){ ?>             <a href="<?php the_permalink(); ?>" class="thumb" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php echo $imgSrc; ?>" alt="<?php the_title(); ?>" /><?php                       }     }     ?>      I've tested the $imgSrc string that's outputted which is valid, it is an existing file though the my file_exists($imgSrc) function always returns false. I'm left wondering if the timthumb script is compatible with the file_exists() function?


title: Custom admin menu for a selection of pages

text: I have a site with 30-35 pages. The customer only needs to edit 3 of them on a regular basis. So to make it simpler and easier for them in the backend, I would like to create a new admin menu item and place those 3 pages under it. How do I do that? Been thinking on custom post types but don't want to make it more complicated than necessary.


title: Migrating data from ACF to WordPress custom meta boxes

text: I’m currently re-developing a theme for WordPress Multisite. The homepage and gallery template both use the Advanced Custom Fields plugin. So I can fully maintain the theme moving forward, I would like to replace ACF with native WordPress custom meta boxes. For those already using the theme on Multisite, is it possible to migrate the data from ACF to my new custom meta boxes? I'm not looking for quick a solution, just any advice you can give me on migrations of this type.


title: Using a page as a custom post type's parent

text: My site is set up to have a landing page for each section of the site. Each section of the site uses a separate CPT. Is it possible to designate a parent page of a custom post type? For instance, I have a page 'Executive Events' and a cpt 'event'. When I view an individual 'event' the url is "www.website.com/event/event-single" where I want "www.website.com/executive-events/event-single" In short, for certain CPTs, I want the base of the permalink to be a page, not the archive as it is by default.


title: How to get a list of post types that "support" various things such as page-attributes?

text: When you register a post type you can pass an array of arguments that it "supports." (For example, "page-attributes," "author," "editor," etc.) I see that get_post_types has some args you can filter by, but how can I filter those that "support" specific features such as "page-attributes" or "author"? I realize I could run a loop to filter after the fact, but can this be done without an extra step? Thanks.


title: remove_action or remove_filter with external classes?

text: In a situation where a plugin has encapsulated its methods within a class and then registered a filter or action against one of those methods, how do you remove the action or the filter if you no longer have access to that class' instance? For example, suppose you have a plugin that does this:               class MyClass {         function __construct() {            add_action( "plugins_loaded", array( $this, 'my_action' ) );         }              function my_action() {            // do stuff...         }     }          new MyClass();      Noting that I now have no way of accessing the instance, how do I unregister the class? This: `remove_action( "plugins_loaded", array( MyClass, 'my_action' ) );` doesn't seem to be the right approach - at least, didn't seem to work in my case.


title: Is it too late to use a CDN?

text: I've got several blogs and a couple of them are pretty visited, with around 1,5 million uniques per month. I've never used a CDN on them, but I'm considering trying to set up an account on some of the platforms available that have good support in WordPress through plugins and a nice user community. I wonder though if this is a good moment to do this, because until now all the images are hosted on the server, and I guess after setting up the CDN all the images should be loaded on the CDN servers through the adequate plugin. I guess that from that moment on, all the articles and posts we publish would benefit from the images loaded through the CDN, but the past articles would not benefit from that. I wonder if:   1. Is there some easy way to use the CDN for the old posts too?    2. What happens if I decide I want to run my blog again from my own server (for any reason)? Would I have to re-publish everything with the images I already had in the CDN servers? Is there an easy way to recover all the images and make them load "locally"? The main problem for me is knowing that if something goes wrong I can have avoid big problems if a I switch off the CDN and decide to run everything back from my servers. What happens with al the content I was serving from the CDN? I hope you understand the question.


title: Sync comments between two WP installs

text: Either with a SQL script or a plugin, I'm looking to create a copy of a site and to syncronize the comments between both sites. One of the sites will have certain comments that are private so they will not be synced. I was deciding whether to go with Intense Debate so that I could somehow configure a comments template to sync across pages. Can this be done across separate sites? Or would a third-party plugin be a better choice? * * * Updated Question: How can you use:               comments_template($file)      Where ($file) lives on a different server? Obviously I'm going to run into security problems but is there a way you can access a different WP database?


title: How to remove CSS file in the header using Wordpress functions?

text: I want to remove a CSS from loading in the header, this is the code that appears:               <link rel='stylesheet' id='my-css'  href='http://test.tld/wp-content/themes/mytheme/my.css?ver=3.5' type='text/css' media='all' />      I tried using these functions but it didn't work:               wp_dequeue_style('my-css');     wp_deregister_style('my-css');      Is there other ways that the above CSS line can be removed without manually editing it in the template? Thanks.


title: cannot access subsites in wordpress multisite

text: Hi I installed wordpress multisite using instructions given on codex and created a site. But I cannot access any other than base site. As you can see in the screenshot below multisite is installed and I have created multilang/de/ but it is not accessible. ![enter image description here](http://i.stack.imgur.com/zkWCv.png)


title: Plugin could not be deleted due to an error: Unable to locate WordPress Plugin directory

text: I have moved my Wordpress site to a new host, because of performance problems on the old host. I have updated wp-config.php with the new host's values, but when I try to delete a plugin from wp-admin, I receive > "Plugin could not be deleted due to an error: Unable to locate WordPress > Plugin directory." I have defined FTP_BASE correctly in wp-config.php. Where else would I need to set the value of local file system root folder?


title: Adding Custom Fields to Search

text: I'm trying to add custom fields to my search so that it can be refined by meta values. Currently I have added some select lists to my normal search:               <form role="search" action="<?php echo site_url('/'); ?>" method="get" id="searchform">         <input type="hidden" name="s" value="carcpt" /> <!-- // hidden 'products' value -->              <select name="price">             <option value="">Nothing</option>             <option value="500.00">500.00</option>             <option value="100.00">100.00</option>             <option value="50.00">50.00</option>         </select>              <select name="year">             <option value="">Nothing</option>             <option value="2011">2011</option>             <option value="2007">2007</option>             <option value="1991">1991</option>         </select>              <input type="submit" alt="Search" value="Search" />     </form>      and at the top of my `search.php` I have this conditional:               $q = get_search_query();     if($q = 'carcpt'){              $price = $_GET['price'];         $year = $_GET['year'];              $search = new WP_Query(             array(                 'post_type' => 'carcpt',                 'meta_query' => array(                     array(                         'key' => '_price',                         'value' => $price                     ),                     array(                         'key' => '_year',                         'value' => $year                     )                 )             )         );     }      That's the scenario - I have 2 questions: **1)** This seems like a very 'hacky' way to add and refine my search results by custom fields - is there a better / more widely accepted way to do this? **2)** The problem with the query above is that if the user does not enter a price or year - it will run the query and return only post with empty price/year meta. In my query is there a way to determine if a meta is empty and modify my query accordingly - not including a switch?


title: User's Comments Number: Storing it in a meta field for different uses

text: As I am building a new website where tracking users' information is key to engage, etc..., I found it important to be able to store users' number of counts as a meta. The main reason for storing the information in users' meta is to allow for **smoother integration** with external services. In my case, I already have a plugin that pushes users' meta to an external e-mail marketing service. There, I plan to run automated campaigns that include sending thank you and other gifts or perks based on the number of published comments for a user. Here is the code I am currently using to store the number of comments made by users. This is based on this other post. I am no coder and I know there are areas for improvement, but I thought I would post this code here incase others are interested in doing this. Therefore, this could be their starting code. **If anyone have optimized/improved versions of the code, please do share :).** Thanks!


title: Number/ Position of a Comment

text: Does anyone know a good way to get the count number or position of a comment under a post? In the known comment array there is only the `related_post_ID` not the relative number in the affected post. Of course within a comment loop I can make some `$i++` stuff, but if i only got the ID of a comment - how do i get the "position" in all comments of its related posting? Is there a WordPress function for this?


title: Multi-page posts do not get indexed by Google due to canonical URLs

text: I've just noticed that on my paginated posts, only the main page gets indexed in Google. The paginated posts "post-title/2" and "post-title/3" for example, do not get indexed. On closer inspection, it appears that Wordpress creates the same canonical URL for all pages in a paginated sequence. So, the canonical for page 2 is the same for page 1, etc. So when google crawls page 2+, the canonical directs them back to the first page. Any clues how to go about resolving this to get a more intelligent canonical url on paginated posts and pages?


title: Multiple parameters in a custom post type url rewrite

text: I have a custom post type called `venues` currently they display through the url format:               http://mywebsite.com/venue/{venue-name}      I would like to have the format:               http://mywebsite.com/venue/{venue-suburb}/{venue-name}      But the suburb doesn't actually have any relation to pulling the `venue` custom post type. Names are always unique. What would need to happen is at the time of rewrite, it pulls the `{venue- suburb}` based on the `{venue-name}` or id and rewrites the url with that information in it. Is this something that is possible and if so how might I go about starting it? **Update:** Here's the code I've been able to put together after some research. The result: `http://mywebsite.com/my-venues/{venue-suburb}/{venue- name}/{post_id}`               add_action('init', 'myposttype_rewrite');     function myposttype_rewrite() {         global $wp_rewrite;         $queryarg = 'post_type=venue&p=';         $wp_rewrite->add_rewrite_tag('%cpt_id%', '([^/]+)', $queryarg);         $wp_rewrite->add_rewrite_tag('%suburb%', '([^/]+)', $queryarg);         $wp_rewrite->add_rewrite_tag('%title%', '([^/]+)', $queryarg);         $wp_rewrite->add_permastruct('venue', '/my-venues/%suburb%/%title%/%cpt_id%', false);     }          add_filter('post_type_link', 'venue_permalink', 1, 3);     function venue_permalink($post_link, $id = 0, $leavename) {         global $wp_rewrite;         global $wpdb;              $post = &get_post($id);         if ( is_wp_error( $post ) )             return $post;              $newlink = $wp_rewrite->get_extra_permastruct('venue');              $sql = "             SELECT meta_value              FROM " . $wpdb->postmeta . "              WHERE post_id = " . $post->ID . " AND meta_key = 'address'";         $address = $wpdb->get_var( $sql );         $address = unserialize( $address );         $suburb = str_replace(" ", "-", strtolower($address['suburb']));         $title = str_replace(" ", "-", strtolower(get_the_title( $post->ID )));              $newlink = str_replace("%suburb%", $suburb, $newlink);         $newlink = str_replace("%title%", $title, $newlink);         $newlink = str_replace("%cpt_id%", $post->ID, $newlink);         $newlink = home_url(user_trailingslashit($newlink));         return $newlink;     }      Removing the section for %cpt_id% makes the page come up as a 404. Rewriting %cpt_id% to "" also makes the page come up as a 404. Anyone know how to remove the post_id?


title: Update wordpress Core Remotely

text: Im doing a project that needs to update the wordpress blog remotely like:   1. updating wordpress core   2. updating plugins   3. and updating themes any help would be appreciated thanks!


title: I would like my posts to pull my custom cropped thumbnail instead of creating its own thumbnail from Featured Image

text: Firstly, I'm not a developer, mostly a website designer and CSS hacker. I'll try to explain better: I'm using a grid theme that creates a thumbnail out of the featured image to display as a post teaser. My previous theme would do the same, but would use the custom thumbnail that I created in the Thumbnail Setttings in the Media Library. I imagine this is a simple change, maybe in the functions.php file? I looked in the existing posts, but could not find a suitable answer. Feel free to link me to an existing thread discussing this.


title: Homepage custom recent news

text: Is there anyway of telling wordpress, by some plugin or whatever, not to show Recent news from Category X, on my home page? Or I may do it only by modifying the `home.php` code?