title: Im using a right approach to use this class inside WordPress theme?

text: I'm using a class to retrieve values from custom tables that I need to use in different files of my WordPress Theme and im not sure which is the best approach for this. This is the class i got right now (dont blame as im a bit noob :D)               class Plans {              public $free_plans;         public $purchased_plans;              private $free_count;         private $purchased_count;                   public function __construct(){             global $current_user;             $this->user_id= $current_user->ID;             $this->free_plans();             $this->purchased_plans();         }             public function free_plans($debug=false){             global $wpdb;             $free_plans =  database query here;             $this->free_count= count($free_plans);             if($debug) $this->debug_wpdb();              $this->free_plans= $free_plans;         }              public function purchased_plans($debug=false){             global $wpdb;             $plans_purchased= database query here;             $this->purchased_count=count($plans_purchased);             if($debug) $this->debug_wpdb();              $this->purchased_plans= $plans_purchased;         }              private function debug_wpdb(){             global $wpdb;                 $wpdb->show_errors();                   $wpdb->print_error();              }              public function get_pplans_count(){                      return $this->purchased_count;         }              public function get_fplans_count(){                      return $this->free_count;         }              public function get_purchased_plans(){                      return $this->purchased_plans;         }              public function get_free_plans(){                      return $this->free_plans;         }          }      I need to use this functions all around my theme (header.php , page- custom.php, etc) and i just want to use one instance of the class as i dont want to query database every time i need one value because querying just two like i do when i create the class is enough. Now where should i call this class? I thought that by creating the class in functions.php....               $p= new Plans();      .... I was going to be able to access $p everywhere but it seems that im wrong. What would be the best approach ? On my case for example i need in header.php               $p->get_fplans_count();      On page-plans.php               $p->get_purchased_plans();      And so on.... **EDIT:** I dont want php help, i just want to know how to use a php class properly in WordPress. It seems that its a bit confusing for me to explain it (English is not my native language) Really Thanks for all your help


title: Front-end Register Form

text: I'm looking for an easy way to place the user registration form on the front- end of a WordPress site. I've already used wp_login_form() to place the login form on the front end, but now I need to do the same with the signup form. Any ideas?


title: Obfuscating Email Addresses in Form Fields

text: I'm writing a WP Theme where registered users can email post authors sending them en email from the post's page itself. So I created a contact form in which I get the user and author infos and emails and I put them in hidden input fields to pass them to the php mail function. Does WordPress have a way to obfuscate the post author's email address, to protect it from scrapers? Is there a better way to implement this functionality, other than outputting the author email address in the form field? Thanks!


title: How to add a Rewrite Rule / Category Structure

text: I'm currently trying to use `add_rewrite_rule()` to create a rewrite (duh!), for a custom taxonomy page. I've added the rewrite tag "sort" with the following code:               add_rewrite_tag('%sort%','([^&]+)');      The issue is I'm not very familiar with the rewrite structure and I'm struggling.. I have a rewrite rule that is getting close, but still not quite working.               add_rewrite_rule('^vehicle-make/([^/]*)/?','index.php?page_id=40&sort=$matches[1]','top');      The problem is it's pulling in the wrong page; I'm needing to show the taxonomy archive for the specific term. So instead of a page ID I'm guessing I just need to pull in the taxonomy name and current term archive.


title: Sorting multiple custom post types without a meta key/value pair by sort order

text: At this current moment. is it possible to sort multiple custom post/page types without a meta key/value? I'm looking to just sort the posts by page attribute order: ![enter image description here](http://i.stack.imgur.com/D6gb0.jpg) **What have i done so far? I've created a query like so and no luck**                 <?php       // query for videos in the home page category       $args = array(        'post_type' =>array('videos', 'podcasts'),         'category_name' => 'Videos on Homepage',         'post_per_page' => 4,        'order' => 'DESC'        );       $loop = new WP_Query($args);       // etc....            ?>


title: Get List of Registered Meta Boxes and Removing Them

text: Is there a function for getting a list of registered Meta Boxes and removing them? I see there is a method for adding, and removing. http://codex.wordpress.org/Function_Reference/remove_meta_box http://codex.wordpress.org/Function_Reference/add_meta_box


title: Not able to call class in NHP framework

text: I have downloaded fresh framework and installed on my local server. I copied options folder and `nhp-options.php` inside my theme directory. Then I called the class globally by               global $NHP_Options;      When I try to call copyright information in the footer               get("copyright_footer");      I get the following error > Fatal error: Call to a member function get() on a non-object in > C:\xampp\htdocs\word\wp-content\themes\mCube\footer.php on line 19 Why is that, and how can I make it work?


title: Append jquery script for each [partners] shortcode with specified values

text:
I'm trying to do a shortcode which will add additional jQuery script to `wp_footer`. So this gonna be an example shortcode:               function partners($atts ) {         global $extra_options, $pslider;         extract(shortcode_atts(array(                   'ids' => null,                 'extra_options' => null             ), $atts));                $pslider = 'partners-slider'.rand(100,999);         $ids = explode( ',', $ids );         $output = '

';         foreach($ids as $id) {             $img_attr = wp_get_attachment_image_src( $id, 'full' );         $alt_text = get_post_meta( $id, '_wp_attachment_image_alt', true);         $output .= '

';             }         $output .= '

';         return $output;       }            add_shortcode('partners', 'partners');      From the above function I need to get variables and place them in a jQuery script:               function print_partners_scripts() {         global $extra_options, $pslider;         echo '' . "\n";     }          add_action( 'wp_footer', 'print_partners_scripts' );      Ok, at the moment I have a shortcode which can return working slider. But, what if I try to use this shortcode again on the same page? I've checked, the jQuery script will append only once. I would like to generate this jQuery script for every [partners] shortcode. For example:               [partners extra_options="something: true"]     [partners extra_options="something: false"]      First one should add this script to `wp_footer`:                     It worked.   The second one should add the same script with different variables:                     Unfortunately this one was not added. Really need your help!


title: Conditional menu display

text: I have the line of code below with the intention to display the called menu in every other page except the home page but it still shows up on the home page. Any ideas what the problem could be.                   <?php if (!is_home()) {         wp_nav_menu (array('menu'=>'sideBar','menu_class' => 'navbar'));      } ?>


title: Ajax Slideshow in Post

text:
Is there a way to make an ajax slideshow like this? Each slide contains an image and description and is loaded via **ajax** call. I suppose an easy way for an author to make up such slideshow post is to use the following shortcode markup:               [slideshow]         [slide1]
desc 1
         [/slide1]         [slide2]
desc 2
         [/slide2]         [slide3]
desc 3
         [/slide3]     [/slideshow]      There is also one more idea that would make life of authors even easier:
desc 1

desc 2

desc 3
      How can I achive anything like this?


title: after_setup_theme is called three times

text: Trying to find an issue with my theme that is not related with this question, I've started the debugger and enabled a breakpoint to the first line of a function hooked to `after_setup_theme`. Here I've realized that the function is called three times, before the page is rendered. Is that normal? Isn't this action supposed to be called only one time? Here's an excerpt of the functions.php (`after_setup_theme` is the only hook in functions.php):               function get_theme_text_domain()     {         $theme = wp_get_theme();         return $theme->get('TextDomain');     }          //This is the function that is called 3 times when opening any page of the site     function tamtando_theme_setup()     {         load_textdomain(get_theme_text_domain(), get_template_directory() . '/languages');         //[...]     }          add_action('after_setup_theme', 'tamtando_theme_setup');      To clarify, checking the value of $wp_filter['after_setup_theme'], I've found 2 hooks: one is from my theme, the other, from the "Event Organiser" plugin, calling a different function (I wonder why the developer is using this hook, but this doesn't relate to this issue).


title: Custom database table question

text: So I have a question regarding creating a new database table for my plugin, the Easing Slider, which is getting a major overhaul. Up until now, I've relied on `update_option`, `get_option`, and those various functions to save, edit and get plugin settings. It has worked well, but I've hit a slight snag. So the plugins bigger, "premium" brother allows you to have more than one slideshow. This is done through saving a multi-dimensional array in a single option. I then have a function that select a specific array by the ID specified, which acts as the focal point for getting a specific slideshows settings. The problem is, this plugin allows unlimited slideshows, each with unlimited images. Many users have been creating hundreds of slideshows, and the odd few are having problems at this point. As you can imagine, (for example) a 100 slideshows, each with 20 images, and each image with about 20 different settings, the one database option can get very large. As a result, for unknowns reasons, the odd user experiences issues and suddenly cannot create new slideshows or images, even though `'update_option'` is reporting back true, letting us know that it has succeeded. One can only assume this is because the database option has hit its limit (possibly wrong, I've no idea why). So I am looking into changing the way things work and using a custom database table. However, the one thing I can't get my head around is actually creating the table dynamically. The nature of the plugin is such that new features are added often, as well as removed. Filter hooks also allow users to add their own new features/settings easily. Each setting would ideally have its own column. As a basic example, I could easily compile the ID's of the various settings into a single array. But could the database table be created from an array as simple as this?               $array = array( 'option_one', 'option_two', 'option_three' );


title: Ability to edit image via WYSIWYG

text: In the wordpress post WYSIWYG, you can easily add images from the media library. But, once the image is inserted into the post, it is not intuitive to edit the image's source to a different image in your media library. You have to remove the image completely, and then add another one in it's place. So what I am asking is twofold:   1. Can the tinyMCE editor plugins (in this case wpeditimage) be overridden via functions.php or a plugin? Or can I totally override it with my own?   2. Do you agree with me that this is a usability issue in WP, or am I just smoking something? Any feedback or suggestions highly appreciated


title: Custom seperate Single.php

text:
In my site I have a blog where each posts loads single.php like normal wordpress installation. I also have a "shop" custom page where each links also loads single.php but the permalink is different. For normal blog post the permalink goes like this:               http://www.mysite.net/2012/07/02/blah-blah-blah/      For custom shop page the permalink goes like this:               http://www.mysite.net/shoppage/blah-blah-blah/      What I am trying to do is not load default single.php when clicking on individual post from shoppage template. I want to load a custom single.php with my own changes added. Is it possible? Relevant part for index.php:
                                 <a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                                 <?php echo __('Posted on ', 'wizy') . get_the_date(); ?> <?php _e('in ', 'wizy'); echo the_category(', ');?> by <?php the_author(); ?>
                                             relevant part from shoptemplate.php:

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                                      <a href="<?php echo $thumb_src[0]; ?>" class="project_thumb zoom">                                 <?php if( has_post_thumbnail() ) : ?>                                     <?php the_post_thumbnail('project_thumb_midd'); ?>                                 <?php else : ?>                                     <img src="<?php echo TIMTHUMB; ?>?src=<?php wizy_assets_uri(); ?>/images/image_placeholder.png&w=300&h=250&zc=1" alt="<?php the_title(); ?>">                                 <?php endif; ?>
                                     <?php the_content('',FALSE,''); ?>
                                                                       <?php if( $pos = strpos( $post->post_content, '') ) : ?>                                     <a href="<?php the_permalink(); ?>" class="more_link"><?php _e( 'View Project →', 'wizy' ); ?>                                 <?php endif; ?>
      I know my way around with wordpress, but not so much with php


title: query_posts: how to show all 'meta_value' containing a specific word?

text: How could you display all the post in a loop with a (custom) meta_value containing a word/phrase? for exemple get al the post where meta contains 'test'.               query_posts('post_type=SOME&category_name_2=SOME&meta_value= 'Cotains the word 'test' ??? ');       so when the meta tags are 'test movie' or just 'test' you get them both.?


title: Use custom posts as taxonomy term meta replacement?

text: Taxonomies are very useful for all sorts of things. But as many have pointed out they suffer from their lack of ability to carry metadata. Assuming I have only posts that don't have 'natural' parents on my site, why shouldn't I just taxonomise my posts by attaching them to a post_parent, and store my metadata in the parent's post_meta? **FOR EXAMPLE** I have a CPT 'birds' and a taxonomy 'user_bird_collection'. I have a user, Jack, and I want to add the Canary to his collection. **With a taxonomy** I create (or append to) a term in the user_bird_collection called 'Jack' (or something more unique like his UID), adding the Canary to the term. When Jack goes to mybirds.com/my_collection I show him all the birds in his term. If he wants to go one better and name his canary, I'm in a pickle because I have to add metadata to the _relationship_ between the canary and Jack's collection. **With post_parents** I create a new post with Jack as the author, whose post_parent is the ID of the canary. When Jack goes to the collection page I show him all the posts that belong to him, and I cleverly divert all the demands for bird details, images etc up to the original canary. When he wants to name his canary, all I need to do is add metadata to Jack's post - effectively his 'own' copy of the canary, a sort of wrapper around it. **OBVIOUS ADVANTAGES**   * Querying is just as easy.   * I can add as much metadata as I like to the original bird OR the personalised bird using post_meta.   * I'm not tied to one of several competing implementations of term meta.  What's the problem with doing it this way?


title: why the posts queried from sql is more than those showed on the page?

text: i am using WordPress multisite, the issue i face is that the posts queried from sql is more than those showed on the page, the details is as follows:               mysql> select count(*) from wp_137_posts where post_type='post';     +----------+     | count(*) |     +----------+     | 32 |     +----------+     1 row in set (0.46 sec)      here i find there is 32 posts to the blog whose id is 137 but in fact when i open that blog, i can find only 30 posts including both published and draft posts. why there are not 32 posts when i open my blog?


title: Lightword Theme - only one menu item

text: Since I am pretty new to WP and the whole stuff i ran into a problem. I am using the pretty-well known "Lightword" Theme. And today i've upgraded to the newest version. It's now possible to add/edit the menu items through the theme-settings. Although I like this very much I am not able to display more than one additional menu-item. When I go to "wp-admin/nav-menus.php" I am able to select a menu item in a box (the english titel of the box is probably: "Position in theme") on the left- side. But I am only able to select one. So what can I do to show up all created menus? Thanks for your help


title: How to implement friend system for Wordpress?

text: At the moment my users posts are only viewable to them. I would like to implement a system where they can choose to share any post with other users they know. The problem I'm having is, how do I make the connection between users? The best I came up with is to create a table in the db and store their friends by user id's. Example:               user_ID 2   friends_ID 5,9,34,85          user_ID 87   friends_ID 67,2,99,100,58,309      I want to be able to retrieve their friends list so I can use it later in various parts of the site. I know this will not be simple, but I am fully open to ideas, suggestions or similar plugin. Thank you all in advance.


title: Using theme options to change a border-radius value

text: I'm developing a theme where I'm using theme options to allow users to set various things -- text size, background colour, link colour, etc. The basic code I'm using for the options is in header.php and looks like this:               <?php      $options = get_option('mytheme_theme_options');          if( isset( $options['backgroundcolour'] ) && ( !empty( $options['backgroundcolour'] ) ) )        printf( "body {background: #%s;}", $options['backgroundcolour'] );          if( isset( $options['linkcolour'] ) && ( !empty( $options['linkcolour'] ) ) )        printf( "a, a:link {color: #%s;}", $options['linkcolour'] );          ?>      One of the options I want to set is a border radius for some chunks of content, which requires multiple declarations of the same value to work in all modern browsers:               .post {-webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px;}      So, how do I get the PHP above to declare the same value three times in my CSS? I should add that I'm not normally a PHP person; feeling a bit out of my depth here. :) Thanks.


title: Bulk Image Uploader to create new post from each image

text: Is there any plugin which creates a new post from each image I upload/select with it? I want to create many posts with one image per post. Currently I select, upload all images. Then create new post, name it same as image file name, insert image from media library and then save to draft/publish it


title: How to view all posts (on site, not admin) that are uncategorized?

text: I had a horrible problem a long time ago that had me end up importing a backup of most of my posts. I'm now using WordPress 3.3.2 and I would like to view all of the uncategorized posts from the site view, not in the admin. I have attempted to use http://www.southfresh.org/uncategorized http://www.southfresh.org/category/uncategorized Both with capitalized and not. But those come up as bad pages. Is there any way to view just these posts?


title: Blogroll entry generates hundreds of 'Links to Your Site' in Google Webmaster Tools for the linked site

text: I recently noticed that Google Webmaster Tools counts the blogroll link on every page of a Wordpress blog as a separate entry in 'Links to Your Site'. If the Wordpress site has 100 posts that all show the blogroll (which is typical), that will generate 100 separate entries in 'Links To Your Site' in Google Webmaster Tools for each site linked from the blogroll. Given recent news that Google is starting to penalize sites with 'unnatural' incoming links, I'd like to figure out how to prevent a Wordpress blogroll from doing that. Frankly, I think GWT should be smart enough to figure this out, but I don't have much hope that Google will rationalize this. It's also not clear that this kind of thing will actually be penalized, or whether Google is able to make the distinction. But who wants to take the chance? Aside from configuring the sidebar with the blogroll to appear only on the home page, is there any way around this? Would 'nofollow' help? Then again, I've heard that use of 'nofollow' may also be penalized. Geez, Google. Here's a link to one of the recent stories making the rounds: http://www.seroundtable.com/google-link-spam-notifications-13652.html


title: ajax call in wordpress front end

text:
In my plugin i'm using two ajax calls in back end. that worked well. but to provide the same functionality in front end i loaded the copy of these two functions with another names and my code is: in my plugin main file:               function my_action_callback(){       global $wpdb;      if (@$_POST['id']) {              $daty = $wpdb->get_results("select eemail_id,eemail_content,eemail_subject  from " . WP_eemail_TABLE . " where 1=1 and eemail_status='YES' and eemail_id=" . $_POST['id']);         //echo "select eemail_id,eemail_content,eemail_subject  from ".WP_eemail_TABLE." where 1=1 and eemail_status='YES' and eemail_id=".$_POST['id'];              if (!empty($daty)) {             foreach ($dat as $datt) {                 echo $datt->eemail_content . "_" . $datt->eemail_subject;                 die();             }           }          }         }       add_action('wp_ajax_nopriv_my_action', 'my_action_callback');      and in my settings.js               function showEntryfront(id)        {               jQuery(document).ready(function($) {              var data = {             action: 'my_action',             id: id              };               jQuery.post(ajaxurl, data, function(response) {             //alert('Got this from the server: ' + response);             var n=response.split("_");               jQuery('textarea#mail_contents').text(n[0]);             $('#mail_subject').val(n[1]);             // jQuery('textbox#mail_subject').text(n[1]);               });            });        }      and the plugin page which fires this showEntryfront() is:               <select name="eemail_subject_drop" id="eemail_subject_drop" onchange="showEntryfront(this.value)">                     <option value="">Select Email subject</option>                     <?php echo $eemail_subject_drop_val; ?>                 </select>                 <input type="hidden" name="send" value="" id="send" />
                  <textarea   name="mail_contents" id="mail_contents" rows="4" cols="40" ></textarea>
      The second function is doing the same. only the db table is different. Still my firebug console shows               ReferenceError: ajaxurl is not defined     jQuery.post(ajaxurl, data, function(response) {      and the textarea is not filling up with the db data from the table WP_eemail_Table. Please not that this functionality worked in wp-admin backend. i know the ajax call in admin will automatically load by admin- ajax.php. but how can i implement the same in front end. any mistake in my code??


title: Get all image IDs from the Media Library

text: I'm fairly new to PHP and I believe this is a fairly basic question. I've spent hours searching for an answer but can't quite seem to get things right. So any help would be appreciated. I'm trying to create a gallery page on my site that automatically includes any newly uploaded images in it. My ultimate plan is using Justified Image Grid as my gallery manager. This requires putting the image ID in the JIG shortcode. In my template page I want to 1st - get all images IDs from the media library. 2nd - call the JIG shortcode and insert the IDs as the gallery images. From there I will set up filtering inside JIG. From my understanding I can't get the image IDs directly from wordpress. I have to first get their URLs and then extract their IDs. If there is a more efficient way to do this please let me know. So far I have this code to get all the image URLs (from this discussion: Get All Images in Media Gallery?):               $query_images_args = array(         'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,     );          $query_images = new WP_Query( $query_images_args );     $images = array();     foreach ( $query_images->posts as $image) {         $images[]= wp_get_attachment_url( $image->ID );     }      This works fine when I print the array. Next I have this code to return the image ID from URL (From https://philipnewcomer.net/2012/11/get-the-attachment-id-from-an-image-url-in- wordpress/):               function pn_get_attachment_id_from_url( $attachment_url = '' ) {          global $wpdb;     $attachment_id = false;          // If there is no url, return.     if ( '' == $attachment_url )         return;          // Get the upload directory paths     $upload_dir_paths = wp_upload_dir();          // Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image     if ( false !== strpos( $attachment_url, $upload_dir_paths['baseurl'] ) ) {              // If this is the URL of an auto-generated thumbnail, get the URL of the original image         $attachment_url = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url );              // Remove the upload path base directory from the attachment URL         $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );              // Finally, run a custom database query to get the attachment ID from the modified attachment URL         $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $attachment_url ) );          }          return $attachment_id;     }      This works fine for one URL. What I can't figure out is how to loop through all the URLs returned by the $images array and return all the IDs. Can someone help or show me another way to tackle this problem?


title: Enqueue script in Widget

text: I am trying to use wp_enqueue_script inside function widget of the Widget class. But it seems like when I print html it doesn't handle the javascript functions which I enqueue before. This enqueue script works well if I use for shortcode inside shortcode and later print html. Is there any workaround for using enqueue inside widget function that will properly handle my html also?


title: comments_template not working correcly in custom template files

text: In a template file that I am using as page, I want to allow only 2 users to post comments and allow to all other users to only see these comments( not allow them add comments). my template file is:               <?php get_header();  ?>          <?php      if (get_current_user_id()==1 or get_current_user_id()==2 ) {          comments_template( '', true );                         }     else     {     comments_template( '/comments-with-no-form.php', true );          } ?>          <?php get_footer(); ?>      Normally, when I remove `comments_template` from single.php, or just remove the `<?php comment_form(); ?>` from comments.php, changes apply. But in separate template file, nothing is working. The file `comments-with-no- form.php` is never executed (only style of comments.php changes). Your help is appreciated.


title: 70.000 custom posts on my site

text: My site have more than 70.000 custom posts. Admin panel not show all posts. how to fix it ? ![More than 70k post](http://s29.postimg.org/id0bpu3pz/Untitled.png) Month filter: more than 4.000 posts. it's normal. ![4.000 post](http://s30.postimg.org/hpn7z48ht/Untitled.png)


title: How to enqueue stylesheet after rtl.css?

text: When you use rtl language by default wordpress enqueue rtl.css file at the end of all stylesheets. what I need is how to enqueue a stylesheet after rtl.css stylesheet so the result should be like the following?               <link rel="stylesheet" href="http://example.com/wp-content/themes/mytheme/rtl.css" type="text/css" media="screen" />     <link rel="stylesheet" href="http://example.com/wp-content/themes/mytheme/responsive-rtl.css" type="text/css" media="screen" />      Thanks


title: is_search not working on search results page

text: Having an extra submenu with this code in sidebar:               <?php if(is_404() || is_search()) : ?>     <?php echo 'zou leeg moeten zijn'; ?>     <?php else : ?>     <?php       if($post->post_parent == '68')       $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");       else       $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");       if ($children) { ?>       <ul>       <?php echo $children; ?>       </ul>       <?php } ?>     <?php endif; ?>      I have a problem with the first line: Working fine on 404 page and on searchpage if you search for something that doesn't exist but when you look for something that does exist the sub menu is popping up in the sidebar. What is wrong with this code? Ariane


title: Have lots of meta for posts, is it better to get at all at once or each individually

text: I have a directory website and am doing a bit of a redesign/restructure. I have quite a few meta fields for each entry, i.e. address, city, country, website, where to buy their products, social links, background and so on. I don't display all the meta data in the same place in my layout. So my question: Is it more efficient to use `get_post_meta($id,$key,false)` and have all my meta values stored in a `$variable`, or is it better to get each individually? I would assume it is the former, but wanted to get some feedback.


title: Users cannot post when editor or admin on more than 1 site on multisite

text: Just upgraded to 3.6.1 last week. I have rolled back and re-upgraded 2 times. When I roll back everything works. I've Turned off plugins, changed to 2012 theme. Tried 3.7 with same issues. Users can create posts in post-new page no problem UNLESS they are editor, admin etc on another blog in the multisite. If I remove a user from a second site they can immediately post in the first and vice versa. They can use quick press from the dashboard to add a post and are able to edit without issue. The post object is not created or fails to create when the user is on two blogs.               Notice: Trying to get property of non-object in D:\Websites\wp-admin\includes\post.php on line 471 stdClass Object ( [post_content] => [post_title] => [post_excerpt] => [post_name] => )      Notice: Undefined property: stdClass::$ID in D:\Websites\wp-admin\post-new.php on line 73     Notice: Undefined property: stdClass::$post_date in D:\Websites\wp-admin\edit-form-advanced.php on line 52      Notice: Undefined property: stdClass::$post_date in D:\Websites\wp-admin\edit-form-advanced.php on line 65      Notice: Undefined property: stdClass::$post_status in D:\Websites\wp-admin\edit-form-advanced.php on line 90      Notice: Undefined property: stdClass::$post_status in D:\Websites\wp-admin\edit-form-advanced.php on line 124 Notice: Undefined property: stdClass::$post_type in D:\Websites\wp-includes\taxonomy.php on line 169      Notice: Undefined property: stdClass::$post_type in D:\Websites\wp-includes\taxonomy.php      Any suggestions or ideas are greatly appreciated.


title: Multsite blogs' menu shows Main site menu

text: I have a site (WIP) that was working perfectly fine until I updated to 3.7 a few days ago. Since the update, I can visit the sub-sites (blogs) homepage's fine, but the menu that appears (on all blogs) is the main site menu. I have checked the wp-config.php and .htaccess file and cannot see what could be wrong? Any help would be appreciated. Thanks in advance. Linky: http://hartwoodgroup.co.uk/


title: Ordering posts by metadata

text: In my plugin, I use these instructions to obtain a list of posts:               $args = array(         'numberposts'     => -1,         'offset'          => 0,         'meta_query' => array(             array(                 'key' => 'metadata1',                 'value' => '80',                 'compare' => '<=',                 'type' => 'UNSIGNED'             ),             array(                 'key' => 'metadata2',                 'value' => '4.6',                 'compare' => '<=',                 'type' => 'DECIMAL'             ),         ),         'post_type'       => 'post',         'post_status'     => 'publish',         'suppress_filters' => true );          $posts = get_posts($args);          foreach ($posts as $post) {         // some work on $post     }      How can I order these posts by `metadata1` ascending or by `metadata2` ascending? (Note that `metadata1` is an unsigned integer number, and `metadata2` is a decimal number.)


title: wordpress imported images not working for featured image

text: To import images into my wordpress site, I added the actual image into the correct month's folder in the uploads directory and I created a post as type attachment with that image name and url. When I go to a post and press Set Featured Image, I see all the images I imported there. If I select one of them, it doesn't work - just closes the media library and acts as if nothing happened. When I select a different image it does work, so it's something wrong with the images that I imported and not with the uploader. Any ideas what could be wrong?


title: Completely disable categories

text: Is anyone aware of a plugin that disables categories in WP? By this, I mean completely hiding the feature from view automatically, for existing and new users alike. In particular:   * the WP admin menu   * the posts list, its screen options, and its filters   * the post editor and its screen options   * the widgets screen   * the writing and permalink settings screens I've run into a variety of aging hacks to do part of this, namely and mostly code to disable meta boxes and a handful of plugin to disable the permalink prefix. I'm turning to SO in the hopes that some web designer or developer might have the entire set of features on hand. If not, might there be new APIs from the past 3-4 years that make the process simpler (my WP skills are getting rusty), or is seeing it through going to be an awkward output buffer manipulation-related hack?


title: Show top-level parent with submenu menu walker

text:
I've used the menu walker below to display dynamic submenus with great effect in the past. It displays 2nd- or lower-level menu items IF the current page is a parent, sibling, or descendant of the page. For example if the menu hierarchy is:   * a   * b      * 1        * i       * ii It will show, 1, i, and ii if on pages B, 1, i, or ii. What I want to do is add the parent item (B in the example) to that so that the top-level parent also appears. I've read up on walkers, tried to make sense of this code, but am still stuck even on where to begin.               // Show only the child pages of a menu     class child_menu_walker extends Walker_Nav_Menu {         var $found_parents = array();              function start_el(&$output, $item, $depth, $args) {             global $wp_query;                  if( $wp_query->is_single && !in_array( get_option('page_for_posts'), $this->found_parents ) ) {                 $this->found_parents[] = get_option('page_for_posts');             }                  //this only works for second level sub navigations             $parent_item_id = 0;                  $indent = ($depth) ? str_repeat("\t", $depth) : '';                  $class_names = '';             $classes = empty($item->classes) ? array() : (array) $item->classes;             $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));             $class_names = ' class="'.esc_attr($class_names).'"';                  #current_page_item             // Checks if the current element is in the current selection             if(                 strpos($class_names, 'current-menu-item') ||                  strpos($class_names, 'current-menu-parent') ||                  strpos($class_names, 'current-menu-ancestor') ||                  ( is_array($this->found_parents) &&                      in_array($item->menu_item_parent, $this->found_parents) )             ) {                 // Keep track of all selected parents                 $this->found_parents[] = $item->ID;                 //check if the item_parent matches the current item_parent                 $item_output = '';                 if ($item->menu_item_parent != $parent_item_id ) {                     $output .= $indent.'
';                          $attributes = !empty($item->attr_title) ? ' title="'.esc_attr($item->attr_title).'"' : '';                     $attributes .= !empty($item->target) ? ' target="'.esc_attr($item->target).'"' : '';                     $attributes .= !empty($item->xfn) ? ' rel="'.esc_attr($item->xfn).'"' : '';                     $attributes .= !empty($item->url) ? ' href="'.esc_attr($item->url).'"' : '';                          $item_output = $args->before;                     $item_output .= '';                     $item_output .= $args->link_before.apply_filters('the_title', $item->title, $item->ID).$args->link_after;                     $item_output .= '';                     $item_output .= $args->after;                 }                 $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);             }         }              function end_el(&$output, $item, $depth) {             $parent_item_id = 0;                  $class_names = '';             $classes = empty($item->classes) ? array() : (array) $item->classes;             $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));             $class_names = ' class="'.esc_attr($class_names).'"';                  if(                 strpos($class_names, 'current-menu-item') ||                  strpos($class_names, 'current-menu-parent') ||                  strpos($class_names, 'current-menu-ancestor') ||                  (is_array($this->found_parents) &&                      in_array($item->menu_item_parent, $this->found_parents))             ) {                 // Closes only the opened li                 if (is_array($this->found_parents) && in_array($item->ID, $this->found_parents) && $item->menu_item_parent != $parent_item_id) {                     $output .= "
\n";                 }             }         }              function end_lvl(&$output, $depth) {             $indent = str_repeat("\t", $depth);             // If the sub-menu is empty, strip the opening tag, else closes it             if (substr($output, -22) == "
\n") {                 $output = substr($output, 0, strlen($output) - 23);             } else {                 $output .= "$indent
\n";             }         }     }


title: Taxonomy in URL

text: I have a huge problem: I want to have nice URL's on my Homepage. I got a custom post type and taxonomies. Now I want to have a URL like that: > www. mydomain .com/videos(Category)/funny(Taxonomy)/the-video(Post) or > www. mydomain .com/videos(Category)/sport(Taxonomy)/the-video(Post) How do I get this? I am searching for about a year now...


title: Multisite wordpress config on multidomain

text: I have to create multisite on wordpress network. maindomain.com its base for all, but it only crossroad for users. Links from maindomain.com redirect to domain1.com, domain2.com and domain3.com for this tree domain i need to make wordpress network. The biggest question is, how can i do that? All of this domain will be on the same server. Any ideas for help mi with?


title: Calling a plugin in theme development

text: I am trying to call plugins on a theme page. Specifically I am after the 'User Avatar' theme but their will be other later. How do I call a plugin on a theme? Presumable something linke `<?php` ...plugin name... `;?>` but that isn't it. Any ideas. Marvellous


title: How to modify template tags function

text: By default, get_user_meta returns an array, a single value or false. I want to change the return value somehow. How to do that? I want to modify the return type of a template tag get_user_meta inside the class only. How to do this? I am trying this:-               class modifyUserMeta {         function modifyUserMeta(){             add_filter('get_user_meta',$this->modifyMeta);         }         function modifyMeta(){         //how can i modify the return type of get_user_meta?         }     }


title: How to display login form anywhere, when user isn't logged in, without redirecting?

text: I'm currently using Theme My Login, and I'm building a membership website where nothing is accessible to anyone, unless they're logged in. When a user, who isn't logged in, enters anywhere on the site, they should be prompted with the _Theme My Login_ login form, which essentially is designed as an individual page. How do I get rid of the URL extension (www.example.com/login), which is where the user normally would be redirected to, and simply just showing the page template no matter where the user enters the website (e.g. _/about_ , _/contact_ , etc.), when he/she isn't logged in?


title: Ajax category pagination problem

text:
I want to make a pagination or load more button for my ajax category display. Here is my attempt, I have no idea how it can work out. Any ideas?               add_action( 'wp_ajax_nopriv_load-filter', 'prefix_load_cat_posts' );      add_action( 'wp_ajax_load-filter', 'prefix_load_cat_posts' );               /*main function of fetching the category selected*/     function prefix_load_cat_posts () {     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $temp = $DamonQuery;     $DamonQuery= null;     $DamonQuery = new WP_Query();          $cat_id = $_POST[ 'cat' ];     $args = array (         'cat' => $cat_id,         'posts_per_page' => 10,         'orderby' => rand,         'post__not_in' => $do_not_duplicate,         'paged' => $paged,         'order' => 'DESC'     );          $total = 14;          $thumbnailno = array();          for($x=0;$x<$total;$x++) {         $thumbnailno[$x] = "http://www.chandamon.com/home/wp-content/uploads/nothumb" . $x . ".png";     }          $DamonQuery->query($args);          $max_page = $DamonQuery->max_num_pages;          ob_start ();          if ( $DamonQuery->have_posts() ) {         while ( $DamonQuery->have_posts() ) {             $DamonQuery->the_post();             if ( has_post_thumbnail( $DamonQuery->post->ID ) ) {                 $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),      'large');                 echo '
ID . '" title="' . the_title_attribute('echo=0') . '" >';                 echo get_the_post_thumbnail($post->ID, 'array(255,255)');                 echo '
';             }             else {                 echo  '
' . '';                 echo  '
';             }         }            /*pagination here*/              $big = 999999999;               echo paginate_links( array(             'format' => '#',             'current' => max( 1, get_query_var('paged') ),             'total' => $DamonQuery->max_num_pages          ) );                      wp_reset_postdata();              $DamonQuery= null;         $DamonQuery= $temp;     }          echo '
';          $response = ob_get_contents();     ob_end_clean();          echo $response;     die(1);     }


title: How to disable pagination on a gallery template?

text: With the pagination activated in the Options panel and when using different gallery templates, is there a way to disable pagination on a specified template? If I have more than one gallery on a page, and have pagination turned on for the thumbnails, then the pagination on one gallery also controls the pagination on the other galleries on the page Any idea? Thanks


title: Send batch of posts as HTML Email?

text: Looking for a little help getting to grips with a quote, part of which is producing quarterly reports consisting on all the posts from that quarter. My question is two fold - Is there a plugin that can do this sort of thing? Or of not, any clue as to where to start coding it? Cheers


title: Completely replacing the login form

text: I need to completely replace WP's login form with the login form of an external service. The actions and filters I've found (eg login_form, login_head) seem to rely on WP's login process starting. I suppose I could do a redirect from here, but is there a cleaner way of sending a user to another URL if they attempt to browse to a WordPress login page.


title: Is it still not possible to show separate submenu with "Custom Menu"?

text: Well, the title says it all. Is it still not possible to show separate submenu with the "WP Custom Menu"?


title: Hide Admin menus per role in Wordpress

text: I am trying to hide a certain amount of menus for a client. Right now I am using the following code and it is doing its job well, but it removes it for everyone as far as I can tell. As in all roles.               function remove_menus () {     global $menu;         $restricted = array(__('Dashboard'), __('Media'), __('Links'),      __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Profile'),__('Plugins'));         end ($menu);         while (prev($menu)){             $value = explode(' ',$menu[key($menu)][0]);             if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}         }     }     add_action('admin_menu', 'remove_menus');      What is the line I would use to have this call out only an editor or an author etc? Thanks much


title: How do I dequeue a parent theme css file?

text: My parent theme (Starkers) adds a CSS file that I'm trying to remove (I want to use @import instead so I can override styles more easily). Starkers has the following in its functions.php:               add_action( 'wp_enqueue_scripts', 'script_enqueuer' );          function script_enqueuer() {         wp_register_script( 'site', get_template_directory_uri().'/js/site.js', array( 'jquery' ) );         wp_enqueue_script( 'site' );              wp_register_style( 'screen', get_template_directory_uri().'/style.css', '', '', 'screen' );         wp_enqueue_style( 'screen' );     }      I've tried the following in the child functions.php, but the link and script tags still show up in the head section.               add_action('init', 'removeScripts');     function removeScripts() {         wp_dequeue_style('screen');         wp_deregister_script('site');     }      I've double checked to see if they are hard coded in the parent header and they are not. Thanks for the help!


title: What are the benefits of using wp_enqueue_script?

text: Is there any real benefit to using wp_enqueue_script on small self-managed sites? For instance, Modernizr, why enqueue it through a function rather than call it directly inside the document head? I can see the benefit on large sites, where you may move around directories or have multiple people mucking around in the files, or in a publicly available theme with numerous unknowns, but what's the benefit on a small site like a personal blog that never - or rarely - changes and has a single user? It just seems like extra lines of code in that case.


title: Insert custom postmeta when custom post type published

text: I'm trying to populate the postmeta table with a custom value when a custom type ('my-solutions') is published. I've read a few threads, the Codex and Pippin's blog on this matter and tried many variations, but can't get this to work. If anyone can add or correct anything that would be great.               function run_when_my_solution_published( $post ){         global $wpdb;         $id = $post->ID;         if($post->post_type == 'my-solutions'){             $wpdb->insert('wp_postmeta', array( 'meta_id'     => NULL       ,                                                 'post_id'     => $id        ,                                                 'meta_key'    => 'my_json'  ,                                                 'meta_value'  => 'json'     ),                                          array( '%d' , '%d' , '%s' , '%s' )             );                   }     }     add_action('new_to_publish', 'run_when_my_solution_published');


title: How to Insert Shortcodes into Theme?

text: I have content locker plugin. For locking contents, im using this shortcode: **[wp-like-locker]** Your locked content here... **[/wp-like-locker]** and I need lock every post on my blog. How could I instert this shortcodes into theme and lock: **Thank you very very very much for your answer and time!**


title: Create a custom admin page for custom post type + taxonomies + metas

text: I'm writing a plugin that realies on custom post types, new taxonomy and few custom fields. All this data will be private (not queryable or searchable). I'd like to provide an admin page to the user, to add and edit this data in a more suer-friendly way. For instance, the custom post type will have only a title and the excerpt field, one taxonomy and the custom fields. I know how to add meta boxes to a custom post type, but this is not enough to me. I'd like to make a completely custom html interface that will take care of adding/saving/deleting che custom post type and handle the taxonomy and metas. Just to be clear, I know already ho to write a normal plugin and handle plugin's options. I don't know how, with this plugin I can:   * Add a new menu item in Wordpress admin menu   * In this menu item, handle, _with a custom interface_ , the custom post type There is some how-to out there that could help me achieving this?


title: Custom search function not finding posts with tax terms even thought the association exists

text: I have a custom hierarchical taxonomy called "destination_category" with terms like so: Cultural   * Museum   * Historic I have a custom post type with posts associated with all three "Cultural" (parent), "Museum" (child), "Historic" (child). When my custom search function searches for posts with "Museum" and "Historic", it works and includes the post. However, when I include the parent term "Cultural". The post is NOT returned. So, it seems that my query is ignoring the fact that my post is associated with the parent term "Cultural", and it has something to do with it being a parent term. Here is what my search function looks like:               function advanced_search_query($query) {          if($query->is_search()) {              $query->set('post_type', 'destinations');              // tag search         if (isset($_GET['termlist']) && is_array($_GET['termlist'])) {             $tax_query_args = array(                 array(                     'taxonomy' => 'destination_category',                     'field' => 'slug',                     'terms' => $_GET['termlist'],                     'operator' => 'AND'                 )             );                  $query->set('tax_query', $tax_query_args);         }              return $query;     }      }


title: W3C validation errors (trailing slashes)

text: My site is throwing up a few errors typically due to trailing slashes being added. eg. wordpress is adding in:               <meta name='robots' content='noindex,nofollow' />      my doctype is:               <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">      If my understanding is correct the validator is seeing those trailing slashes as being xhtml but is getting worried as the doc type doesn't state it. I don't want it to be an xhtml doctype as that causes me lots of other problems. My code is fine but its bits like that meta tag that wordpress is putting in that is causing the problem. How do I solve this? the trailing slash is making the validator think things are closing so its then throwing up errors on stupid stuff like my closing head and opening body tags.


title: custom taxonomies label in hebrew

text: I'm trying to add a custom taxonomy. using the following code:                   function cities_custom_taxonomies() {         register_taxonomy(             'city', // internal name = machine-readable taxonomy name             'post', // object type = post, page, link, or custom post-type             array(                 'hierarchical' => false, // true for hierarchical like cats, false for flat like tags                 'label' => 'City', // the human-readable taxonomy name                 'query_var' => true, // enable taxonomy-specific querying                 'rewrite' => true // pretty permalinks for your taxonomy?             )         );     }     add_action('init', 'cities_custom_taxonomies', 0);      As long as I use label name in English, all works fine. Once I try to label it in Hebrew, I don't see the new taxonomy menu. any Idea ?


title: How can you develop on a live WordPress installation that is using W3 Total Cache?

text: Or to make it easier: you just want to disable the caching in order to see your changes in realtime. Any solution that would allow you to disable caching based on IP, logged user or cookie will be acceptable.


title: Change page template programmatically ?

text: I have two page templates and Qtranslate installed. I want to choose one or another depending the language selected. Can I do something like this ?               if($q_config['lang'] == 'en'){     // load page-template_en.php     }else{     // load page-template_de.php     }      Any idea ? Thanks!


title: Contributor disable seeing others' posts

text: How can I disallow contributors on my site from seeing what other posts are published on the site, and only see their own?


title: Defer Parsing of Scripts

text: this is my first time to try this "Defer Parsing" thing, and I don't really have an idea how to do it. ![enter image description here](http://i.stack.imgur.com/4fJnH.jpg) Using PageSpeed tool, I found out that one of the reason why my page is loading too slow (currently 92/100) are the scripts. And the PageSpeed suggested that I need to Defer Parsing all those scripts. Is there anyone that can help me with this. Thanks.


title: Translated my theme (translation not showing up)

text: I read a lot about what is the optimal to translate your website (french and english in my case) I set up a Multi site where I created two site one french mywebsite.com/fr and one in english mywebsite.com/en I am now in the process of translating my theme(in french by default) I added this to my theme function.php:               load_theme_textdomain('INTERluminaires', get_template_directory() . '/languages');      then modified my template files in order to be able to translate some text               <?php _e("Design et conseils", "INTERluminaires"); ?>      created a po and mo file with poedit, everything goes well. I uploaded those files in my theme folder /languages those files are named en_CA.po and en_CA.mo (I tried INTERluminaires-en_ca.po and mo to no avail) when I change my theme language in settings general and refresh my website nothing is translated. any idea what could be wrong here? btw I managed to translate a plugin I installed without any problem.


title: I am trying to grab the title and put it in a paypal form select option

text:
I am trying insert the title of a post in the option value of a form for paypal purchase, so I know what item they have chosen. But when I do this paypal gives me a error message that something is wrong with my site. Am I doing this wrong I am trying to insert the title of a post in a option value below.               <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">     <input type="hidden" name="cmd" value="_cart">     <input type="hidden" name="business" value="7MNYTPNDKMZS6">     <input type="hidden" name="lc" value="CA">     <input type="hidden" name="item_name" value="Tshirt">     <input type="hidden" name="button_subtype" value="products">     <input type="hidden" name="tax_rate" value="0.000">     <input type="hidden" name="shipping" value="0.00">     <input type="hidden" name="add" value="1">     <input type="hidden" name="bn" value="PP-ShopCartBF:cart.png:NonHosted">

<input type="hidden" name="on0" value="Tshirt">Tshirt

<select name="os0">         <option value="<?php the_title();?>">Deer $20.00 CAD</option>     </select>

<input type="hidden" name="on1" value="sex">sex

<select name="os1">         <option value="female">female </option>         <option value="male">male </option>     </select>

<input type="hidden" name="on2" value="T-shirt Style">T-shirt Style

<select name="os2">         <option value="Crew">Crew </option>         <option value="V-neck">V-neck </option>         <option value="Deep-V">Deep-V </option>         <option value="Tank">Tank </option>     </select>

<input type="hidden" name="on3" value="T-shirt size">T-shirt size

<select name="os3">         <option value="XS">XS </option>         <option value="S">S </option>         <option value="M">M </option>         <option value="L">L </option>         <option value="XL">XL </option>     </select>

<input type="hidden" name="on4" value="Effect">Effect

<select name="os4">         <option value="faded">faded </option>         <option value="rainbow">rainbow </option>         <option value="gradient">gradient </option>         <option value="glow">glow </option>     </select>

<input type="hidden" name="on5" value="T-shirt colour">T-shirt colour

<input type="text" name="os5" maxlength="200">

<input type="hidden" name="on6" value="Design Colour">Design Colour

<input type="text" name="os6" maxlength="200">

     <input type="hidden" name="currency_code" value="CAD">     <input type="hidden" name="option_select0" value="Deer">     <input type="hidden" name="option_amount0" value="20.00">     <input type="hidden" name="option_index" value="0">     <input type="image" src="http://goodmorningmoon.ca/wp-content/themes/Good-Morning-Moon/images/cart.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">          </form>


title: Custom post type pagination 404 fix?

text: Been trying to get this working all day but haven't had any luck... I have a custom post type called 'news' and an archive template (archive- news.php), here I'd like to show 2 posts with pagination, which works fine, until I try to go to the 'next page' (/news/page/2) which returns an error 404. Any idea how to fix this / what I'm doing wrong? I've literally spent all day trying to find a solution to this by searching Google and the WordPress forms, I found lots of solutions, none of which have worked so far. My custom post type function: http://pastebin.com/uG1L6YNu   My rewrite rules print: http://pastebin.com/jbaDANYr


title: show list of latest comments for each post in a loop

text: I want to show the last 5 comments for each post on my index page loop of posts. What Im using now is only showing the same comments for every post. How should I set this up and how can I add an avatar to each comment. What have this obviously isn't working..               <?php       $args = array(     'status' => 'approved',     'number' => '5',        );       $comments = get_comments($args);         foreach($comments as $comment) :       echo( $comment->get_avatar . $comment->comment_author . '<br />' . $comment->comment_content);        endforeach;      ?>


title: How to show multiple images in a slideshow for a portfolio page

text: I am planning to build a portfolio using custom post types, so the main portfolio page will show a "featured" image for each portfolio post. Once you click on one of these images you will go to the actual post page for that portfolio item. Once on this page I would like to show multiple images for this particular portfolio post. So I am thinking of doing some sort of slideshow or possibly a big image with little thumbnail images that when clicked will load the larger version of the image into the big image slot. So I am curious, when making a post for a portfolio item, how would I go about uploading and integrating multiple images for each item? See the bottom of my mockup below, when you click on a thumbnail for a particular portfolio item, it will load a larger image ![enter image description here](http://i.stack.imgur.com/LRuQu.png)


title: Uncaught TypeError: undefined is not a function (shortcode-box)

text: I have a Wordpress theme that the author is no longer maintaining, and has stopped functioning properly with the update to Wordpress 3.x. Over the past few months, I have been working to resolve the issues with the theme. Most of these issues have been related to JavaScript, and I have been able to fix most of them. I'm finally down to one I can't fix: This theme contains a function in the admin panel to add new shortcodes that a user can create and performs all the steps correctly except the last: send the shortcode to wordpress editor. Chrome inspect gives me this error: > Uncaught TypeError: undefined is not a function --- shortcode-box.js:1305 > > shortcode.sendToEditor --- shortcode-box.js:1305 > > (anonymous function) --- shortcode-box.js:16 The lines referred to by the errors: line 1305               sendToEditor :function(){             window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, shortcode.generate());         }      line 16               jQuery('#shortcode_send').click(function(){                 shortcode.sendToEditor();             });      I attached the shortcode-box.js file: http://www.samuguerra.com/shortcode- box.js Can anyone help me? Excuse my English, as I wrote this with the help of Google Translate


title: Activating a Theme Options page to Editor - not working

text: I used Ian Stewart's Simple WordPress Theme Options Page (Source^) for my client's site, where I assigned my client as an Editor. But from the Editor account the **Theme Options** link is not visible. I checked the `theme-options.php` for `add_theme_page()`, where it's used `'edit_theme_options'` as the menu's capability. But unfortunately it's not visible. I installed:   * User Role Editor, and   * White Label CMS But in White Label CMS, I unchecked the hide menu thing. But the link becomes visible only if I check the User Role Editor's `manage_options` checkbox. But it opens the Settings menu to the Editor. I checked the `edit_theme_options` for Editor, but it doesn't work. I changed the `theme-options.php`'s `add_theme_page()` capability to even lower to `edit_published_posts` (Author capability), but not worked here. I tried deactivating User Role Editor, but no luck.


title: How to add a code for lastpostdate after/inside a specific menu link?

text: So, I have a news website. The designers want me to have a link in the menu that says "Latest News - [time of the last post]". I know I can get the datetime of the latest post with get_lastpostdate(). But how can I put this php code inside the menu? This specific link is not the first one nor the last. It's inside the menu structure. Menus in this website are made trough the usual custom menu tools of wp. Any ideas?


title: Getting label name of extra user fields

text: I'm using the plugin "Extra User Fields" to add extra fields to the user's profile. I know how to get the value of the field (get_user_meta/get_author_meta), but I also want the label as a string, but I don't want to get the full code (like `<label>Label</label><input value="value" />` etc., because I want to be able to do with the label and the value what I please. So, what function (or tag) should I use to get the label value of an user field?


title: Include files for a plugin not including

text: I have a plugin which I need to include a file in but it doesn't include. Here's the example of the tree:               plugin folder         /themes         /folder2         /somefiles         /includeme.php      Within themes is               /default     /theme2      Then within each theme are the files E.g.               Header.php     Footer.php      The plugin simply switches these themes via the admin. Now in header.php I added               <?php include('includeme.php'); ?>      Which didn't work. A friend told me since it is two levels up the tree I should actually add               <?php include('/../../includeme.php'); ?>.      Both didn't work. I googled something that said to try.               <?php include([$_SERVER]['DOCUMENT_ROOT']'./wp-content/plugins/plugin-name/includeme.php'); ?>.      That also didn't work. This is a basic plugin which renders theme based on admin settings combined with user agent detection. Any suggestions or further code required? The code is located at http://pastebin.com/A3buAA0R


title: Redirect loop upon installation of my plugin

text: I have created a plugin that uses a shortcode [MyCreditStatus] to display a form (multi-page form). This plugin uses an API that I also made. When I try to install the plugin, there are times that it causes a redirect loop. It also does not run properly locally because of the sessions (headers already sent, etc.) There are times that it works well too. This is the first plugin I've made using WordPress and I'm not really familiar with WordPress plugin development and I find the resources so limited. I can't find a resource for dealing with forms and passing variable values from page to page. Can you please see the plugin I've made and suggest ways on the correct way that I should be doing it? Here's the download link for the plugin: http://1drv.ms/1qYoTIx Thank you.


title: Style the text before <!--more--> in single.php

text: I'd like to style differently the content before the link, but in single.php. To be more specific, all my posts on the homepage only have a summary, and the rest of the text is cut thanks to the use of the more tag. So when I click on "read more" I see the complete post, starting with the summary we previously seen on the homepage. I'd like to differentiate this summary from the rest of the text, adding it some bold for example, to show to the user what he as already read. Unfortunately I think this is not possible. Is it ?


title: how  to have custom post template including custom write panels for the users to post

text: I would like to have a separate custom page where the logged in users can post their content. Add post title, add content, add check boxes, image/file uploads, Is there any way to do so?


title: Carrying values from page to page using custom query

text:
Im having trouble paging a custom query and I hope one of you can spot my error and point it out. I've been looking at it for long time and tried many solutions but none seem to work. The code which generates the "Refine Your Search" form as seen on this page:               http://208.78.226.27/~tots411/business/

Refine Your Search
         <form action="<?php echo home_url( '/' ); ?>business-directory/advanced-search/" method="post" class="business-advanced-search advanced-search-form">

County:
             <select name="business-select-county" id="business-select-county">             <option name="select-one" value="-1">Select One</option>             <?php             $county_terms = get_terms( 'location', array( 'hide_empty' => false, 'parent' => 0 ) );             foreach( $county_terms as $county_term ) {                 echo '<option value="' . $county_term->slug .'"';                         if( isset( $_POST['business-select-county'] ) ) {                             $county_term_slug = $_POST['business-select-county'];                             if( $county_term_slug == $county_term->slug ) {                                 echo ' selected="selected"';                             }                         }                 echo '>'. $county_term->name .'</option>';             }             ?>             </select>

Town:
             <select name="business-select-town" id="business-select-town">                 <?php                 if( isset( $_POST['business-select-town'] ) ) {                     // We need the Term ID of the parent Location                     $parent_term = get_term_by( 'slug', $_POST['business-select-county'], 'location', OBJECT, '' );                     $parent_term_id = $parent_term->term_id;                          $town_terms = get_terms( 'location', array( 'hide_empty' => false, 'parent' => $parent_term_id ) );                     foreach( $town_terms as $town_term ) {                         echo '<option value="' . $town_term->slug .'"';                             if( $_POST['business-select-town'] == $town_term->slug ) {                                 echo ' selected="selected"';                             }                         echo '>'. $town_term->name .'</option>';                     }                 } else {                 ?>                 <option></option>                 <?php } ?>             </select>

Center Type
             <select name="business-select-center-type" id="business-select-center-type">             <option name="select-one" value="-1">Select One</option>             <?php             $center_type_terms = get_terms( 'center_type', array( 'hide_empty' => false ) );             foreach( $center_type_terms as $center_type_term ) {                 echo '<option value="' . $center_type_term->slug .'"';                         if( isset( $_POST['business-select-center-type'] ) ) {                             $center_type_slug = $_POST['business-select-center-type'];                             if( $center_type_slug == $center_type_term->slug ) {                                 echo ' selected="selected"';                             }                         }                 echo '>'. $center_type_term->name .'</option>';             }             ?>             </select>

Program Offered
             <select name="business-select-program" id="business-select-program">             <option name="select-one" value="-1">Select One</option>             <?php             $program_terms = get_terms( 'program', array( 'hide_empty' => false ) );             foreach( $program_terms as $program_term ) {                 echo '<option value="' . $program_term->slug .'"';                         if( isset( $_POST['business-select-program'] ) ) {                             $program_slug = $_POST['business-select-program'];                             if( $program_slug == $program_term->slug ) {                                 echo ' selected="selected"';                             }                         }                 echo '>'. $program_term->name .'</option>';             }             ?>             </select>
                                        <input type="submit" id="business-advanced-search-submit" name="business-advanced-search-submit" class="business-advanced-search-submit" value="Search" />             </form>
      The page handing the form submission and builds the query:               <?php     /* Template Name: Advanced Search - Business Directory */      get_header(); ?>

<?php echo get_the_title( get_the_ID() ); ?>
     <?php $options = get_option('Wcolor_theme_options'); ?>             <?php if ($options['breadcrumb'] == 0): ?>             <?php echo Wcolor_breadcrumb_lists(); ?>     <?php endif; ?>

         <?php Wcolor_header_end(); // after header hook ?>         <?php Wcolor_wrapper(); // before wrapper ?>
         <?php Wcolor_in_wrapper(); // wrapper hook ?>
     <?php     do_action( 'tots_get_business_advanced_search_form' );          $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;     $search_query = array( 'post_type' => 'business', 'posts_per_page' => get_option( 'posts_per_page' ),         'tax_query' => array(), 'paged' => $paged, 'post_status' => 'publish'     );          // Will hold the terms that we are searching for     $existing_terms = array();          if( isset( $_POST['business-select-county'] ) && !empty( $_POST['business-select-county'] ) ) {         if( $_POST['business-select-county'] != -1 ) {             $search_query['tax_query'][] = array(                 'taxonomy'  => 'location',                 'terms'     => $_POST['business-select-county'],                 'field'     => 'slug',             );             $existing_terms[] = 'county';         }     }     if( isset( $_POST['business-select-town'] ) && !empty( $_POST['business-select-town'] ) ) {         if( $_POST['business-select-town'] != -1 ) {             $search_query['tax_query'][] = array(                 'taxonomy'  => 'location',                 'terms'     => $_POST['business-select-town'],                 'field'     => 'slug',             );             $existing_terms[] = 'town';         }     }     if( isset( $_POST['business-select-center-type'] ) && !empty( $_POST['business-select-center-type'] ) ) {         if( $_POST['business-select-center-type'] != -1 ) {             $search_query['tax_query'][] = array(                 'taxonomy'  => 'center_type',                 'terms'     => $_POST['business-select-center-type'],                 'field'     => 'slug'             );             $existing_terms[] = 'center_type';         }     }     if( isset( $_POST['business-select-program'] ) && !empty( $_POST['business-select-program'] ) ) {         if( $_POST['business-select-program'] != -1 ) {             $search_query['tax_query'][] = array(                 'taxonomy'  => 'program',                 'terms'     => $_POST['business-select-program'],                 'field'     => 'slug'             );             $existing_terms[] = 'program';         }     }     if( count( $existing_terms > 1 ) ) {         $search_query['tax_query']['relation'] = "AND";     }          $business_search_query = new WP_Query( $search_query );          if( ( WP_DEBUG == true ) && current_user_can( 'administrator' ) ) {         echo 'County: ',        $_POST['business-select-county'];         echo 'Town: ',          $_POST['business-select-town'];         echo 'Center Type: ',   $_POST['business-select-center-type'];         echo 'Programs: ',      $_POST['business-select-program'];              echo '
';         print_r( $business_search_query );         echo '
';     }          if ( $business_search_query->have_posts() ) : ?>                <?php while( $business_search_query->have_posts() ) : $business_search_query->the_post(); ?>                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__( 'Permanent Link to %s', 'Wcolor' ), the_title_attribute( 'echo=0' )); ?>"><?php the_title(); ?>

                         <?php if ( has_post_thumbnail()) : ?>                             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >                             <?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>                                                      <?php endif; ?>                         <?php the_excerpt(); ?>

                         <?php the_terms( $post->ID, 'location', 'Location: ', ' / ' ); ?>
                         <?php the_terms( $post->ID, 'center_type', 'Center Type: ', ', ' ); ?>
                         <?php the_terms( $post->ID, 'program', 'Programs Offered: ', ', ' ); ?>

<?php edit_post_link(__('Edit', 'Wcolor')); ?>

     <?php endwhile; wp_pagenavi( array( 'query' => $business_search_query ) );  wp_reset_query(); else: ?>      <?php endif; ?>
     <?php get_sidebar(); ?>     <?php get_footer(); ?>      The main form on `http://208.78.226.27/~tots411/business/` submits to `http://208.78.226.27/~tots411/business-directory/advanced-search/` and the results on this page are accurate. The problem arises when I click on the the link taking me to the second page where the whole query resets and it displays all posts instead of continuing to use my custom query. Any help on this will be highly appreciated. Thank you!


title: How can we get Catergory / Term Creator

text: How can we get the category creator id ? I have checked the tables of category/terms viz. wp_terms, wp_term_taxonomy and wp_term_relationships. But there is no information about creator of the category... Is there any function which we can use ?


title: Shared functionality in plugins and themes

text: I recently started to develop plugins and themes and I found that I need to use several functions of on both. Sometime I think about to check if function / class exist before declared as said on this post: When to check if a function exists But that is considered as bad practice. What is best practice to prevent conflicts and keep themes & plugin work independently without one themes / plugin installed?


title: Category.php template for custom posts

text: I'm trying to use my category.php file to display all posts of a certain custom post type (say "Company") with a given category. However, when I try to use it by navigating to domain.com/category/company/category1, which is the link automatically generated by wp_list_categories(), no posts appear. The code I'm using is:               <?php while ( have_posts() ) : the_post(); ?>     <?php get_template_part( 'type-company', get_post_format() ); ?>     <?php endwhile; ?>      What am I doing wrong?


title: Execute script only on certain admin pages

text: To solve this problem i've used this in my js file:               var location = String(window.location);          //only runs in post.php and post-new.php     if(location.search('post.php') != -1 || location.search('post-new.php') != -1 )     {          }      But it's does not seem like i solid solution. Are there any other way?


title: How to put tags on photos in Windows that WordPress can read and apply on media files?

text: I'm creating a Stock Photo gallery on WordPress with PhotoPress Image Taxonomies by Peter Adams and I noticed that when I upload photos from iStockphoto, the taxonomies keyword is filled with tags that it originally have on iStockphoto site. I tried doing this on Windows using the tagging feature on windows photo gallery and also on the properties of the image itself but it doesn't appear like that of the image on iStock photo. By the way, this is not a commercial project but an internal for the company to use. So how is iStock photo embedding their keywords on their photo that the plugin by Peter Adams is reading? This will obviously make tagging much easier because when you do tagging on Windows Photo Gallery, you can do it by bulk that WordPress is not able to do.


title: Image resize using url parmater

text: I would like to resize image in my wordpress template using url parameter. Best example for this would be Wordpress's very own twenty Twelve theme. Following is link to image with width parameter in the end. If you change width to 50 it'll return image with 50px width. > https://twentytwelvedemo.files.wordpress.com/2012/03/wheat-field.jpg?w=500 I'm confused if its server setting or we can do it using php. Thanks.


title: SEO module to change tag title for different listing page

text: I need to have different tag titles for each category of my website. I've tried all in one SEO but it looks like i cannot change it individually. Thanks in advance


title: collapse twenty twelve submenu in mobile version

text: in the twenty-twelve theme, the following code will collapse the sub-menu ul/li of the mobile version...the problem is that it also brake the normal version of the menu! how can i use it only when the mobile menu comes in?               jQuery(document).ready(function($){         $('.main-navigation li ul').hide();         $('.main-navigation li').has('ul').click(function() {         $(this).children().toggle();         });     });`


title: Exclude images uploaded via meta boxes from Wordpress gallery

text: I am using the following simple get attachment code to display all images attached to a certain post but I want to be able to exclude the images uploaded via a couple of custom meta boxes that are also attached to the post. For example, how could I exclude an image uploaded with a meta key of sample_image_1 from this code?               <?php              $args = array (             'post_type' => 'attachment',             'numberposts' => -1,             'post_status' => null,             'post_parent' => $post->ID,             );             $attachments = get_posts($args);             if ($attachments) {             foreach ( $attachments as $attachment ) {             the_attachment_link( $attachment->ID , 'screenshot' );         }}     ?>


title: What do the numbers mean at the end of add_action('save_post')...?

text: I've seen on a few tutorials that there are numbers at the end of the call to save Custom Fields/Meta Boxes on the `save_post` hook. For example, in the WordPress Codex it gives the following example:               <?php add_action( 'save_post', 'my_save_post', 10, 2 ); ?>       What do the **10** and **2** mean at the end? I've tried talking to an "expert", but they've been of no help ;)


title: Dynamically Generate Functions and Hooks

text:
I'm trying to find if it's possible to dynamically generate functions and hooks. All functions do the same thing, and all hooks are essentially the same. Here's an example of a hook/function combo:               add_action( 'woocommerce_single_product_summary', 'cx_inputKVA_show', 5 );     function cx_inputKVA_show() {         global $product;         // Do not show this on variable products         if ( $product->product_type <> 'variable' ) {             $inputKVA = get_post_meta( $product->id, 'cx_inputKVA', true );             if ( $inputKVA <> '' ) {                 echo '
';                 _e( 'Input KVA: ', 'woocommerce' );                 echo '' . _e( $inputKVA ) . '';                 echo '
';             }         }     }      I want to use an array like:               $fieldset = array(         array(             1 => 'slug',             2 => 'title'         )         array(             1 => 'slug',             2 => 'title'         )     );      And then use a `foreach()` loop to generate 3 hooks and 3 functions for each nested array. Before, I was just writing each one separately, but now I need to generate for 23 items and it's too much code, too messy to change. It would make the hook like:               add_action( 'woocommerce_single_product_summary', 'cx_[plug]_show', 5 );      and the function like               function cx_inputKVA_show() {         global $product;         // Do not show this on variable products         if ( $product->product_type <> 'variable' ) {             $[plug] = get_post_meta( $product->id, 'cx_[plug]', true );             if ( $[plug] <> '' ) {                 echo '
';                 _e( '[title]: ', 'woocommerce' );                 echo '' . _e( $[plug] ) . '';                 echo '
';             }         }     }      Answer------------------ Since Milo is a genius, I got this done much simpler by just looping through the array inside of the function, instead of trying to generate a new function dynamically for each item. The array contains 'slug' and 'title' attributes, and here's the function:               function cx_product_field() {         global $fieldset;         foreach ( $fieldset as $field ){             woocommerce_wp_text_input(                 array(                      'id' => 'cx_'.$field['slug'],                      'class' => 'wc_input_text',                      'label' => __( $field['title'], 'woocommerce' )                 )              );         }     }


title: Pages 404 in wordpress

text: First of all, I am very new to wordpress and know almost nothing about it. When I create the page foo using in wp-admin, I get the message that the page is created. When I click on `view page`, it 404s. I've followed the steps on http://codex.wordpress.org/Pages#Creating_Pages, but apparently I'm missing something. I let Wordpress rebuild my `.htaccess`, but still no luck. **System specifications:**   * Ubuntu 13.04   * Apache2   * PHP 5.4.9   * MySQL 14.14 Distrib 5.5.32 **Installed Wordpress Plugins:**   * Debug This   * My own (empty) plugin **.htaccess**               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      **"Debug This" output for query -> rewrite**               Current Rewrite          Matched Rule:      Matched Query:      Query String: debug-this=rewrites          Rewrite Rules          Rule    Rewrite     dating_user/?$  index.php?post_type=dating_user     dating_user/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?post_type=dating_user&feed=$matches[1]     dating_user/(feed|rdf|rss|rss2|atom)/?$ index.php?post_type=dating_user&feed=$matches[1]     dating_user/page/([0-9]{1,})/?$ index.php?post_type=dating_user&paged=$matches[1]     category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$ index.php?category_name=$matches[1]&feed=$matches[2]     category/(.+?)/(feed|rdf|rss|rss2|atom)/?$  index.php?category_name=$matches[1]&feed=$matches[2]     category/(.+?)/page/?([0-9]{1,})/?$ index.php?category_name=$matches[1]&paged=$matches[2]     category/(.+?)/?$   index.php?category_name=$matches[1]     tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?tag=$matches[1]&feed=$matches[2]     tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ index.php?tag=$matches[1]&feed=$matches[2]     tag/([^/]+)/page/?([0-9]{1,})/?$    index.php?tag=$matches[1]&paged=$matches[2]     tag/([^/]+)/?$  index.php?tag=$matches[1]     type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?post_format=$matches[1]&feed=$matches[2]     type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?post_format=$matches[1]&feed=$matches[2]     type/([^/]+)/page/?([0-9]{1,})/?$   index.php?post_format=$matches[1]&paged=$matches[2]     type/([^/]+)/?$ index.php?post_format=$matches[1]     dating_user/[^/]+/attachment/([^/]+)/?$ index.php?attachment=$matches[1]     dating_user/[^/]+/attachment/([^/]+)/trackback/?$   index.php?attachment=$matches[1]&tb=1     dating_user/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]     dating_user/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]     dating_user/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?attachment=$matches[1]&cpage=$matches[2]     dating_user/([^/]+)/trackback/?$    index.php?dating_user=$matches[1]&tb=1     dating_user/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?dating_user=$matches[1]&feed=$matches[2]     dating_user/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ index.php?dating_user=$matches[1]&feed=$matches[2]     dating_user/([^/]+)/page/?([0-9]{1,})/?$    index.php?dating_user=$matches[1]&paged=$matches[2]     dating_user/([^/]+)/comment-page-([0-9]{1,})/?$ index.php?dating_user=$matches[1]&cpage=$matches[2]     dating_user/([^/]+)(/[0-9]+)?/?$    index.php?dating_user=$matches[1]&page=$matches[2]     dating_user/[^/]+/([^/]+)/?$    index.php?attachment=$matches[1]     dating_user/[^/]+/([^/]+)/trackback/?$  index.php?attachment=$matches[1]&tb=1     dating_user/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?attachment=$matches[1]&feed=$matches[2]     dating_user/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]     dating_user/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$   index.php?attachment=$matches[1]&cpage=$matches[2]     gn-genre/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-genre&term=$matches[1]&feed=$matches[2]     gn-genre/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?taxonomy=gn-genre&term=$matches[1]&feed=$matches[2]     gn-genre/([^/]+)/page/?([0-9]{1,})/?$   index.php?taxonomy=gn-genre&term=$matches[1]&paged=$matches[2]     gn-genre/([^/]+)/?$ index.php?taxonomy=gn-genre&term=$matches[1]     gn-location-3/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?taxonomy=gn-location-3&term=$matches[1]&feed=$matches[2]     gn-location-3/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-location-3&term=$matches[1]&feed=$matches[2]     gn-location-3/([^/]+)/page/?([0-9]{1,})/?$  index.php?taxonomy=gn-location-3&term=$matches[1]&paged=$matches[2]     gn-location-3/([^/]+)/?$    index.php?taxonomy=gn-location-3&term=$matches[1]     gn-location-2/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?taxonomy=gn-location-2&term=$matches[1]&feed=$matches[2]     gn-location-2/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-location-2&term=$matches[1]&feed=$matches[2]     gn-location-2/([^/]+)/page/?([0-9]{1,})/?$  index.php?taxonomy=gn-location-2&term=$matches[1]&paged=$matches[2]     gn-location-2/([^/]+)/?$    index.php?taxonomy=gn-location-2&term=$matches[1]     gn-location-1/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?taxonomy=gn-location-1&term=$matches[1]&feed=$matches[2]     gn-location-1/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-location-1&term=$matches[1]&feed=$matches[2]     gn-location-1/([^/]+)/page/?([0-9]{1,})/?$  index.php?taxonomy=gn-location-1&term=$matches[1]&paged=$matches[2]     gn-location-1/([^/]+)/?$    index.php?taxonomy=gn-location-1&term=$matches[1]     robots\.txt$    index.php?robots=1     .*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$    index.php?feed=old     .*wp-app\.php(/.*)?$    index.php?error=403     .*wp-register.php$  index.php?register=true     feed/(feed|rdf|rss|rss2|atom)/?$    index.php?&feed=$matches[1]     (feed|rdf|rss|rss2|atom)/?$ index.php?&feed=$matches[1]     page/?([0-9]{1,})/?$    index.php?&paged=$matches[1]     comments/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?&feed=$matches[1]&withcomments=1     comments/(feed|rdf|rss|rss2|atom)/?$    index.php?&feed=$matches[1]&withcomments=1     search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?s=$matches[1]&feed=$matches[2]     search/(.+)/(feed|rdf|rss|rss2|atom)/?$ index.php?s=$matches[1]&feed=$matches[2]     search/(.+)/page/?([0-9]{1,})/?$    index.php?s=$matches[1]&paged=$matches[2]     search/(.+)/?$  index.php?s=$matches[1]     author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ index.php?author_name=$matches[1]&feed=$matches[2]     author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$  index.php?author_name=$matches[1]&feed=$matches[2]     author/([^/]+)/page/?([0-9]{1,})/?$ index.php?author_name=$matches[1]&paged=$matches[2]     author/([^/]+)/?$   index.php?author_name=$matches[1]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]     ([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]     ([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]     ([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$    index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]     ([0-9]{4})/([0-9]{1,2})/?$  index.php?year=$matches[1]&monthnum=$matches[2]     ([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ index.php?year=$matches[1]&feed=$matches[2]     ([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$  index.php?year=$matches[1]&feed=$matches[2]     ([0-9]{4})/page/?([0-9]{1,})/?$ index.php?year=$matches[1]&paged=$matches[2]     ([0-9]{4})/?$   index.php?year=$matches[1]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$  index.php?attachment=$matches[1]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$    index.php?attachment=$matches[1]&tb=1     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ index.php?attachment=$matches[1]&feed=$matches[2]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$ index.php?attachment=$matches[1]&cpage=$matches[2]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&tb=1     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&paged=$matches[5]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&cpage=$matches[5]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&page=$matches[5]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$ index.php?attachment=$matches[1]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$   index.php?attachment=$matches[1]&tb=1     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]     [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?attachment=$matches[1]&cpage=$matches[2]     ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&cpage=$matches[4]     ([0-9]{4})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$ index.php?year=$matches[1]&monthnum=$matches[2]&cpage=$matches[3]     ([0-9]{4})/comment-page-([0-9]{1,})/?$  index.php?year=$matches[1]&cpage=$matches[2]     .?.+?/attachment/([^/]+)/?$ index.php?attachment=$matches[1]     .?.+?/attachment/([^/]+)/trackback/?$   index.php?attachment=$matches[1]&tb=1     .?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]     .?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]     .?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?attachment=$matches[1]&cpage=$matches[2]     (.?.+?)/trackback/?$    index.php?pagename=$matches[1]&tb=1     (.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?pagename=$matches[1]&feed=$matches[2]     (.?.+?)/(feed|rdf|rss|rss2|atom)/?$ index.php?pagename=$matches[1]&feed=$matches[2]     (.?.+?)/page/?([0-9]{1,})/?$    index.php?pagename=$matches[1]&paged=$matches[2]     (.?.+?)/comment-page-([0-9]{1,})/?$ index.php?pagename=$matches[1]&cpage=$matches[2]     (.?.+?)(/[0-9]+)?/?$    index.php?pagename=$matches[1]&page=$matches[2]      I also verified that Apache's `mod_rewrite` module is installed and enabled. **apache2.conf (comments removed):**               LockFile ${APACHE_LOCK_DIR}/accept.lock          PidFile ${APACHE_PID_FILE}          Timeout 300          KeepAlive On          MaxKeepAliveRequests 100          KeepAliveTimeout 5          <IfModule mpm_prefork_module>         StartServers          5         MinSpareServers       5         MaxSpareServers      10         MaxClients          150         MaxRequestsPerChild   0     </IfModule>          <IfModule mpm_worker_module>         StartServers          2         MinSpareThreads      25         MaxSpareThreads      75          ThreadLimit          64         ThreadsPerChild      25         MaxClients          150         MaxRequestsPerChild   0     </IfModule>          <IfModule mpm_event_module>         StartServers          2         MinSpareThreads      25         MaxSpareThreads      75          ThreadLimit          64         ThreadsPerChild      25         MaxClients          150         MaxRequestsPerChild   0     </IfModule>          User ${APACHE_RUN_USER}     Group ${APACHE_RUN_GROUP}          AccessFileName .htaccess          <Files ~ "^\.ht">         Order allow,deny         Deny from all         Satisfy all     </Files>          DefaultType None               HostnameLookups Off          ErrorLog ${APACHE_LOG_DIR}/error.log          LogLevel warn          Include mods-enabled/*.load     Include mods-enabled/*.conf          Include ports.conf          LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined     LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined     LogFormat "%h %l %u %t \"%r\" %>s %O" common     LogFormat "%{Referer}i -> %U" referer     LogFormat "%{User-agent}i" agent          Include conf.d/          Include sites-enabled/          Include /etc/phpmyadmin/apache.conf