title: Why is my custom meta box input not saving

text:
I've added the following function to functions.php to add a custom meta box enabling the end user to input a gallery shortcode. I then intend to use this to place a gallery in a specific place on the page (away from the main the_content output). The function I'm using came from smashing magazine and, as you may have guessed, I have very little idea what I'm doing when it comes to php outwith the standard wordpress functions. (I do intend to learn PHP fully in the near future). My meta box is showing up fine, but the data I enter is not saving. I.e. when I click 'update' on the post the meta box reverts back to my placeholder text.               // Load the post meta box setup function on the post editor screen.     add_action ( 'load-post.php', 'rs_post_meta_boxes_setup' );     add_action ( 'load-post-new.php', 'rs_post_meta_boxes_setup' );          //Meta box setup function     function rs_post_meta_boxes_setup() {              //Add meta boxes to the 'add_meta_boxes' wordpress hook.         add_action ( 'add_meta_boxes', 'rs_add_post_meta_boxes' );              // Save post meta once created on the 'save_post' hook.         add_action( 'save_post', 'rs_save_job_gallery_meta', 10, 2 );     }          // Create meta boxes for display on the post editor screen     function rs_add_post_meta_boxes() {              add_meta_box(             'rs-job-gallery', //Meta box unique ID             esc_html__( 'Job Gallery', 'rs-theme' ), //Title             'rs_job_gallery_meta_box', //Callback Function             'job', //Admin page on which to display meta box             'normal',             'default'             );     }          // Display the post meta box     function rs_job_gallery_meta_box( $object, $box ) { ?>              <?php wp_nonce_field( basename( __FILE__ ), 'rs_job_gallery_nonce' ); ?>
              <?php _e( "Add the job gallery to the page. Use the following format: [galleryview id=x] where x is the ID of the job gallery.", 'redmansutherland' ); ?>
             <input class="widefat" type="text" placeholder="[galleryview id=X]" name="rs-job-gallery" id="rs-job-gallery" value="<?php echo esc_attr( get_post_meta( $object->ID, 'rs_job_gallery', true ) ); ?>" size="30"/>
              <?php }          // Save the meta box's post metadata.     function rs_save_job_gallery_meta( $post_id, $post ) {              // Verify the nonce before proceeding.         if ( !isset( $_POST['rs_job_gallery_nonce'] ) || !wp_verify_nonce( $_POST['rs_job_gallery_nonce'], basename( __FILE__ ) ) )             return $post_id;              // Get the post type object.         $post_type = get_post_type_object( $post->post_type );              // Check if the current user has permission to edit the post.         if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )             return $post_id;              // Get the posted data and sanitize it for use as an HTML class.         $new_meta_value = ( isset( $_POST['rs_job_gallery'] ) ? sanitize_html_class( $_POST['rs_job_gallery'] ) : '' );              // Get the meta key.         $meta_key = 'rs_job_gallery';              // Get the meta value of the custom field key.         $meta_value = get_post_meta( $post_id, $meta_key, true );              // If a new meta value was added and there was no previous value, add it.         if ( $new_meta_value && '' == $meta_value )             add_post_meta( $post_id, $meta_key, $new_meta_value, true );              // If the new meta value does not match the old value, update it.         elseif ( $new_meta_value && $new_meta_value != $meta_value )             update_post_meta( $post_id, $meta_key, $new_meta_value );              // If there is no new meta value but an old value exists, delete it.         elseif ( '' == $new_meta_value && $meta_value )             delete_post_meta( $post_id, $meta_key, $meta_value );          }      Thanks in advance for any insights anyone can provide, your help is much appreciated!


title: Multisite Login problem

text: Ever since I upgraded my multisite network from 3.8 to 3.9, I have not been able to login through the main blog. It's a subdirectory install, not subdomain. When I try to login to the main site: http://uspress.avenues.org/wp-login.php, get the the message "This user has elected to delete their account and the content is no longer available." This is not true. As far as I can see, you can't delete the main site, and I've checked the database and the site is set to be public. I can log in if I go to a subsite's login page like so: http://uspress.avenues.org/kgarnier/wp-login.php The home page of the main site is accessible, but if I try to go to another page on it, and I'm not logged in, I get the same error message. If I am logged in, I get the standard Wordpress 404 error page, but, bizarrely, it switches to another subsite that has been deleted (it had same behavior before it was deleted, I deleted when trying to fix this). My wp-config file looks like this:               /* Multisite */     define('WP_ALLOW_MULTISITE', true );     define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', false);     define('DOMAIN_CURRENT_SITE', 'uspress.avenues.org');     define('PATH_CURRENT_SITE', '/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);     define('WP_DEFAULT_THEME', 'uspress');      I also added this cookie clearing code that was suggested on another site:               define('ADMIN_COOKIE_PATH', '/');     define('COOKIE_DOMAIN', '');     define('COOKIEPATH', '');     define('SITECOOKIEPATH', '');      My .htaccess file looks like this:               # BEGIN WordPress     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]     RewriteRule . index.php [L]          # END WordPress      One other weird but maybe unrelated thing: In the blog_versions table in the database, the main site has db_version 26692 and all the others have 27916.


title: archive-{custom_post_type}.php not getting recognized wordpress

text: I have registered a custom post type `city` with 2 taxonomies `city_categories` and `cities`. But wordpress is taking archive.php instead of archive-city.php, don't understand where am I mistaking. It works only if I create a taxonomy-cities.php and then is taking taxonomies-cities.php. How can I make it take directly archive-city.php               register_post_type( 'city',         array(             'labels' =>                  array(                 'name' => 'City Guides',                 'singular_name' => 'City Guides',                 'add_new' => 'Add New',                 'add_new_item' => 'Add New retailer',                 'edit' => 'Edit',                 'edit_item' => 'Edit retailer',                 'new_item' => 'New retailer',                 'view' => 'View',                 'view_item' => 'View retailer',                 'search_items' => 'Search retailers',                 'not_found' => 'No retailer found',                 'not_found_in_trash' => 'No Shop retailer in Trash',                 'parent' => 'Parent retailer'             ),             'public' => true,             'menu_position' => 6,             'supports' => array( 'title', 'editor', 'thumbnail' ),             'has_archive' => true,             'taxonomies' => array('city_categories'),             'can_export' => true,             'rewrite' => array('slug'=>'travel')         )     );            $args = array(          'labels' => $labels, // defined correctly, shortened the code         'public' => true,         'show_in_nav_menus' => true,         'show_ui' => true,         'show_tagcloud' => true,         'show_admin_column' => true,         'hierarchical' => true,         'rewrite' => true,         'query_var' => true     );          register_taxonomy( 'city_categories', array('city'), $args );          $args = array(         'labels' => $labels, // defined correctly, shortened the code         'public' => true,         'show_in_nav_menus' => true,         'show_ui' => true,         'show_tagcloud' => true,         'show_admin_column' => true,         'hierarchical' => true,         'rewrite' => true,         'query_var' => true,         'sort' => true     );          register_taxonomy( 'cities', array('city'), $args );


title: ERRORS! include() [function.include]: Failed opening

text: After migrating my site from a development server to the live site, I'm getting a massive amount of PHP errors. None of these were apparent on the development site. http://www.martialartsevents.ca Below is my theme-functions.php file: */               include( get_template_directory() . '/includes/widgets/1-column-post-list.php' );     include( get_template_directory() . '/includes/widgets/2-column-box-post-list.php' );     include( get_template_directory() . '/includes/widgets/carousel-post-list.php' );     include( get_template_directory() . '/includes/widgets/tab-post-list.php' );     include( get_template_directory() . '/includes/widgets/tags-list.php' );     include( get_template_directory() . '/includes/widgets/category-list.php' );     include( get_template_directory() . '/includes/widgets/popular-post-list.php' );     include( get_template_directory() . '/includes/widgets/embedded-video.php' );     include( get_template_directory() . '/includes/widgets/flickr-shots.php' );     include( get_template_directory() . '/includes/widgets/social-profiles.php' );     include( get_template_directory() . '/includes/widgets/ad-leaderboard.php' );     include( get_template_directory() . '/includes/widgets/ad-skyscraper.php' );     include( get_template_directory() . '/includes/widgets/ad-square-popup.php' );     include( get_template_directory() . '/includes/widgets/ad-square-boxes.php' );      Any ideas why I'm getting thse Warning: include() [function.include]: Failed opening errors?


title: $wpdb->get_row() only returns a single row?

text: Why is it? I tried the same query in the console and it returned multiple rows. Here's the query: `$this->wpdb->get_row("SELECT * FROM ".$this->wpdb->users." WHERE status = 'active'", ARRAY_A);` It keeps returning the same single row when there are several active users. Am I missing something?


title: Best way to tell if a comment is from a user?

text:
I've got an `if ($comment->user_id)` block to pick an default admin comment gravatar (different than a non-user's). But I'd still like this gravatar to be used if a user comments using their registered email, even if they comment while not logged in. What is the best way to test for this? **EDIT** I'm already using                if ($comment->user_id){                 //comment by registered user                 $avatar = '/images/bird_comments_big.png';                 }else{                 //comment by none registered user                 $avatar = '/images/bird_comments_pink.png';                 }      with
<?php echo get_avatar($comment, 70, get_bloginfo('template_url').$avatar); ?>
      If the user is logged in a makes a comments, the if statement is indeed fulfilled. However, if the user uses their registered email (i.e. tied to their login in WP) without bring logged in, `user_id` is not present, and the icon for the unregistered user appears. **`user_id` is only stored if the user is logged in.** _I also want to test if the email given matches a registered user, regardless if they are logged-in or not._


title: How to Display the tag content of Custom Post?

text: I have a custom post called "Portfolio" whith the taxonomies: - Categories - Tags (tag clouds) I want to show the Tag content inside the custom post. Thanks.


title: Loops for cat links not looping for wordpress site

text:
I have this code and all the vars pull in but the latest news is not showing up and the subscribe link is not dropping anything. any ideas? Everything else works like a charm.
         <?php get_sidebar('field'); ?>         <?php         global $current_user;         get_currentuserinfo();         $user_info = get_userdata($current_user->ID);              if ( have_posts() && $user_info->user_level != 0) : while ( have_posts() ) : the_post(); ?>              <?php // get custom fields         $wt_email = get_post_meta($post->ID, 'wt_email', true);         $wt_feed = get_post_meta($post->ID, 'wt_website', true);         $wt_facebook = get_post_meta($post->ID, 'wt_facebook', true);         $wt_twitter = get_post_meta($post->ID, 'wt_twitter', true);         $wt_linkedin = get_post_meta($post->ID, 'wt_linkedin', true);         ?>

<?php the_title(); ?>

         <?php the_content(); ?>

Links

                     <?php if($wt_twitter) { ?>
<a href="http://<?php print $wt_twitter; ?>">Twitter
<?php } ?>                     <?php if($wt_facebook) { ?>
<a href="http://<?php print $wt_facebook; ?>">Facebook
<?php } ?>                     <?php if($wt_email) { ?>
<a href="mailto:<?php print $wt_email; ?>">Email
<?php } ?>                     <?php if($wt_linkedin) { ?>
<a href="http://<?php print $wt_linkedin; ?>">Website
<?php } ?>

     <?php endwhile; // End the loop. Whew. ?>

Latest News

                         <?php                     // The Query                     $loop = new WP_Query( array(                          'category_name' => $wt_feed,                          'order' => 'ASC',                          'posts_per_page'=> 5                     ) );                          // The Loop                     if( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post();                         echo '
';                             the_title();                          echo '
';                     endwhile;                     endif;                          // Reset Query                     wp_reset_query();                     ?>
                 <?php                  $args=array(                   'category_name'       => $wt_feed,                   'type'                => 'post'                   );                 $categories=get_categories($args);                      if($wt_feed) { ?><a href="/<?php print $categories->slug; ?>/feed" class="subscribe">Subscribe<?php } ?>

              <?php else : ?>

Listing Private

You need to have a Member account view the details of this list. Request an account membership.

              <?php endif; ?>

          <?php get_footer(); ?>      output in compiled html for news section.

Latest News

     Subscribe


title: WordPress line chart Plug in

text: Does anybody know good WordPress line chart plug in? * * * _Related_


title: WordPress how to sort by meta value?

text: how in WordPress can I sort by meta value? In meta value I have "price" (float). I make this query, but always get "Sorry, no posts matched your criteria".               $posts = query_posts( $query_string . '&orderby=meta_value_num&meta_key=Notes&meta_value_num=price&order=ASC');      Edit: meta_value value: "a:6:{s:5:"width";s:3:"580";s:6:" **price** ";s:3:"99"". Is it possible?


title: Localhost wordpress access remote db wordpress website

text: I install wordpress on localhost then install wordpress on hosting. I want to access remote database on hosting from localhost environment. so whenever we add new page or post or change configuration it's has been set on hosting database, so we can make team work enviroment very well. We use SVN and install it on hosting already and need remote database so every member can change configuration on Wordpress Administration Panel and other developer get latest configuration from remote database. I try change wp-config.php to access remote database and it's work but whenever access frontend site on localhost it always redirect to actual website on hosting. I want to see frontend site on localhost with remote database. I already check this on wordpress support and get this topic article, he ask it five years ago maybe now it's possible. Could it possible ? I need sync files and sync data using remote database so every developer can look the same website from functionality and data. every developer can insert / update / delete post or page and other developers get it too. We can't work with just sync files and have to insert data on hosting database later. We need sync files and data so we just upload files later after our work is finish.


title: Beta Versioning of Plugins

text: When I'm writing a fix to some bugs, I often increment the version and send it to the bug finder to see if my fix works. If I have `1.2.5` and I want to create a beta that will become redundant once I commit my code, should I use `1.2.5-beta` or `1.2.6-beta`? My concern is that `1.2.6` < `1.2.6-beta` so that the string comparison may favour the beta and the bug finder would not get a notification of the stable version being released. EDIT: If the string is compared absolutely without taking into account the release type, you could use `1.2.5-fix` and then `1.2.6`. The problem is also outlined at http://en.wikipedia.org/wiki/Software_versioning#Pre-release_versions


title: Moving to another server database connection error

text: I have some issues when I try to move it on other server. This are the steps:   1. I go into my actual database through phpmyadmin, export the database.   2. I copy the entire folder of my wordpress website from FTP, and paste it through FTP on my new host.    3. I modify the wp-config.php with my new database details.    4. Now I enter on my new host phpmyadmin I import the database that was created from my old host.  And now when I enter on my website, I receive: **Error establishing a database connection** I really need some help with this. Thanks!


title: Multiple taxonomy drill down filter on a collection of posts

text: I would like to add a drill down filter to a product catalog site with one main taxonomy, and three taxonomies that serve as additional filter for the main product category. The main plan is to build tax_query for the main WP_Query (and that works), but I'm having a hard time (and a vicious flu) finding the right way to show only the filter taxonomy terms pertaining to current product category. I thought about making a direct SQL query to get the list of relevant filter taxonomies terms, but soon found out my sql skills aren't up to chore. I should mention that the product category page is paginated so I can't just loop the products for all their terms. So, the problem here is filtering the filter checkboxes, leaving only the terms that are relevant to main category, if possible by direct SQL query. Additional/replacement light bulb would be appreciated :)


title: wp_postmeta - lot of meta fields

text: I found a lot of meta_key + meta_value fields in my database in wp_postmeta. They are all same only meta_id and post_is changign. And there is more than thousands of them. Look at the pic. ![enter image description here](http://i.stack.imgur.com/UXSSj.png) Should I somehow delete them? Because they could slow down my website.


title: Echoing Shortcode content inside the loop

text: Im trying to echo the content from inside shortcodes into a conditional. I have two shortcodes like this:               function fb_fans( $atts, $content = null ) { return $content; }     add_shortcode( 'fans', 'fb_fans' );          function fb_nonfans( $atts, $content = null ) { return $content; }     add_shortcode( 'nonfans', 'fb_nonfans' ); then inside the loop I want echo content that the user puts inside...   [fans] echo this content [/fans] and also   [nonfans] else echo this [/nonfans] heres what I have that obviously doesnt work               if ($like_status) { echo $fb_fans; } else {  echo $fb_nonfans; }  anyone know how to write this correctly??? Thanks!


title: TinyMCE Buttons on Certain Post Type

text: I'm creating a plugin that will allow users to create custom post types on the fly. On the new post types, I want a custom Button to show In the TinyMCE. Each of the post types has a unique description, so I want to add the buttons based on the post type description. Something like:                if ($post_type->description == 'Custom Description') {            // Add TinyMCE Button Here          }      To get the post type description, I found another post that suggested:               get_post_type_object($post);     $post_type->description;      But it doesn't seem to be working correctly for me. Any ideas how to add the TinyMCE buttons to a post type that has a certain post type description?


It's common for plugin developers to protect their plugins from direct access. I saw two ways to do that:               if ( ! defined( 'WPINC' ) ) die;      and               if ( ! defined( 'ABSPATH' ) ) exit;      What are the differences between WPINC and ABSPATH? Which one is the 'right' way to do it?


title: How can my user make their own Blog/Diary

text: It would be great if my Visitors could sign up and not only write comments, but also start their own diary. Like user.mysite.com or mysite/user Is something like that possible?


title: Pagination for posts inside a specific category

text: I have a FAQ category and there are posts in that category I want to add pagination to that category only, not the other category in my wordpress. In short giving pagination to selected category for the posts in that category


title: Any downsides on using Multisite for many look-alike-websites?

text: I'm developing multiple websites for a photographer. Most of the time I build a custom design around these wonderful images the photographer makes, but in many cases the companies don't have the budget to let us build a custom designed WP site. So I'm looking for a easy way to offer my clients a 'template'. A basic website, which I setup, customize a little, as a service for our clients. So here's my idea:   * I make a theme, and every new website has its own child theme with some minor modifications. All websites are structure-wise identical, but I adjust logo's, colors, fonts and the general look-and-feel.   * Each website has its own domain, so no subdomains involved.   * They all share some plugins like GravityForms. This seems a mayor advantage for me: I only have to update one installation, and all clients are up to date. Do you see any downsides, pitfalls? I want to prevent setting this whole thing up, and ending up with an unmanageable system.


title: Change names of pages in wordpress

text: I am inheriting a Wordpress site where the page names in URLs are very descriptive things like page_id=81. Is this something that I can change globally or do a simple search and replace on?


title: WYSIWYG with HTML source?

text:
I'm trying to switch from Drupal to WordPress, and I have lots of articles written in Drupal's WYSIWYG Editors, and stored like
Hi, this is an article

      So I want to directly copy the source code and paste it into WordPress. I can do it by disabling the visual text editor. So it works for migrating existing articles in. But what about writing new articles? I couldn't find any wysiwyg editors that automatically insert `<p>` tags. I tried the Ultimate TinyMCE plugin, but it only adds some buttons, does not change the situation. **To summarize my problem:** When I write               Article line 1     Article line 2      in the "Visual" Tab, I want to see
Article line 1

Article line 2
      in the "Text" Tab. But instead, I see exactly what I wrote, and this causes bad HTML output, when getting `$post->post_content;` Thanks !


title: Remove filter and view options from custom post type edit screen

text: I have my CPT edit screen almost looking how I want it but want to remove the filter and view options from this screen as they are not needed for this interface. How do I remove them? Are there any filters that disable them? ![How my CPT edit screen looks now](http://i.stack.imgur.com/H4uFM.jpg) My edit screen has got to this stage by this code so far:               // Manage columns in edit screen     add_filter('manage_edit-staff_columns', 'sc_staff_modify_columns');     function sc_staff_modify_columns($staff_columns) {         $staff_columns['title'] = __('Staff Name', 'sc_wilsons_custom');         $staff_columns['job_role'] = __('Job Role', 'sc_wilsons_custom');         $staff_columns['is_store_manager'] = __('Store Manager', 'sc_wilsons_custom');         $staff_columns['located'] = __('Located At', 'sc_wilsons_custom');         unset($staff_columns['date']);         return $staff_columns;     }     add_action('manage_staff_posts_custom_column', 'sc_staff_manage_columns', 10, 2);     function sc_staff_manage_columns($column_name, $id) {         global $wpdb;         $custom = get_post_custom($id);         switch ($column_name) {             case 'job_role':                 echo $custom["sc_staff_job_role"][0];             break;                  case 'is_store_manager':                 echo ($custom["sc_staff_store_manager"][0] == 1) ? __('Yes', 'sc_wilsons_custom') : __('No', 'sc_wilsons_custom');             break;                  case 'located':                 if(is_int($custom["sc_staff_located"][0])){                     $post = get_post($custom["sc_staff_located"][0]);                     echo $post->post_title;                 } else {                     _e('Unknown', 'sc_wilsons_custom');                 }             break;         }     }      _EDIT:_ if it helps I have found where the code for these bits are generated. Functions `months_dropdown()` and `view_switcher` in file /wp- admin/includes/class-wp-list-table.php I don't see any filters or hooks here so might be out of luck. Anyway of doing this by extending the WP_List_Table class?


title: Getting full code of wp_list_comments instead of replacing it

text: I am wondering if this is possible, because I don't want to edit the standard/default lay-out of the comments. I already tried that, but somehow it won't put the list items in my div sections. That's why I am trying to find the **full code of`wp_list_comments`**; I want to make changes to the list items in there... Is this possible? If yes, where can I find it?


title: Multisite and users being listed on network administration dashboard and not main site dashboard

text: I have a main site that is a buddypress site. I later converted main site to a multisite configuration. Now, when people sign up they are put on my network administration dashboard as a user and not my main site as users and they don't have roles. What did I do wrong?


title: Create custom thumbnail size on existing posts

text: I'm applying a new theme to my site, and the theme has a custom thumbnail size. I realize that `add_image_size()` does the work of creating the custom thumb whenever a new post is created. This in my theme's **functions.php** :               add_image_size('ttrust_threeColumn', 280, 170, true);      However, I have a bunch of old posts I need to create this thumbnail size for. These old posts have a filename stored in a custom "Thumbnail" field, e.g.:               /wp-content/uploads/2011/11/this-is-my-post-thumb.jpg      I can grab that file path with this:               get_post_meta($post->ID, 'Thumbnail')      Now if I loop through all the old posts, how can I create the custom **ttrust_threeColumn** thumbnail size for each post? I appreciate the help! I've tried a bunch of different functions and methods, but I can't seem to get a grasp on thumbnail creation for existing posts.


title: Cannot access admin panel

text: I have been working on my site through MAMP and with a localhost. I have _not_ uploaded my site online yet. I have worked in it for weeks accessing through the MAMP start page and then typing http://localhost:8888 on my browser. Well, after a long night I woke up the next day and tried to log in as always. When I do it, my site appears on the browser but I cannot edit a thing. I mean, there is no way I can enter the admin panel, there are no tabs, no WP icon, not even the little EDIT squares at the end of every post or page where I clicked and it took me to the admin panel and dashboard. I can navigate through the site, it works perfectly, It looks as if it was online, but simply I cannot edit anything. I tried to remember what I did differently from the other days, and the only thing I came up with is that I updated a galleria plugin and I activated a new contact plugin widget. As I read in the forums I took all the plugins from my wp-content folder inside the WordPress folder but that did not solve the problem. I tried replacing the entire WordPress folder for a fresh download, the site looks funny no photos but still cannot access to the admin panel. I have no code or programming experience and am I new to WordPress. I am stuck with a dead line and no idea on what to do!


title: Tons of Twitter rows in my database

text: I have 264,307 "http" (post_type = http) rows in my wp_posts table. 99% of those have them have this post_title:               GET http://twitter.com/statuses/user_timeline/@xcentric.json?count=100      and "error" as the post_status. Can I simply delete these without it affecting my site? My wp_posts table is 5gb! Thanks


title: Using a filter to modify Genesis wp_nav_menu

text: Genesis framework applies filters to the wp_nav_menu(). What I want to do is 2 things. 1 change the menu class via a filter 2 add a menu id via a filter Here is the function I am trying to add a filter to.               add_action( 'genesis_after_header', 'genesis_do_nav' );     /**      * Echoes the "Primary Navigation" menu.      *      * The preferred option for creating menus is the Custom Menus feature in      * WordPress. There is also a fallback to using the Genesis wrapper functions      * for creating a menu of Pages, or a menu of Categories (maintained only for      * backwards compatibility).      *      * Either output can be filtered via 'genesis_do_nav'.      *      * @since 1.0.0      *      * @uses genesis_get_option() Get theme setting value      * @uses genesis_nav() Use old-style Genesis Pages or Categories menu      * @uses genesis_structural_wrap() Adds optional internal wrap divs      */     function genesis_do_nav() {              /** Do nothing if menu not supported */         if ( ! genesis_nav_menu_supported( 'primary' ) )             return;              if ( genesis_get_option( 'nav' ) ) {             if ( has_nav_menu( 'primary' ) ) {                 $args = array(                     'theme_location' => 'primary',                     'container'      => '',                     'menu_class'     => genesis_get_option( 'nav_superfish' ) ? 'menu menu-primary superfish' : 'menu menu-primary',                     'echo'           => 0,                 );                      $nav = wp_nav_menu( $args );             } elseif ( 'nav-menu' != genesis_get_option( 'nav_type', 'genesis-vestige' ) ) {                 $args = array(                     'theme_location' => 'primary',                     'menu_class'     => genesis_get_option( 'nav_superfish' ) ? 'menu menu-primary superfish' : 'menu menu-primary',                     'show_home'      => genesis_get_option( 'nav_home', 'genesis-vestige' ),                     'type'           => genesis_get_option( 'nav_type', 'genesis-vestige' ),                     'sort_column'    => genesis_get_option( 'nav_pages_sort', 'genesis-vestige' ),                     'orderby'        => genesis_get_option( 'nav_categories_sort', 'genesis-vestige' ),                     'depth'          => genesis_get_option( 'nav_depth', 'genesis-vestige' ),                     'exclude'        => genesis_get_option( 'nav_exclude', 'genesis-vestige' ),                     'include'        => genesis_get_option( 'nav_include', 'genesis-vestige' ),                     'echo'           => false,                 );                      $nav = genesis_nav( $args );             }                  $nav_output = sprintf( '%2$s%1$s%3$s', $nav, genesis_structural_wrap( 'nav', 'open', 0 ), genesis_structural_wrap( 'nav', 'close', 0 ) );                  echo apply_filters( 'genesis_do_nav', $nav_output, $nav, $args );         }          }      I was initially trying to add_filter where I can modify the $args to change the class and add an id. How do I go about doing this? Here is my 'best guess'               function xyz_modify_nav($args) {         $args = array(            'menu_class' => 'xyz',            'menu_id'    => 'custom'         );     }     add_filter('genesis_do_nav', 'xyz_modify_nav',20);


title: how to activate plugin network-wide, and save setting across sites

text: I am developing a plugin, which will be used on single site, as well as multi- site. How to make plugin active network-wide, code required. Also, how to save settings network-wide?


title: Identify admin/logout and more filters

text: I have several links I need to apply filters to them. Having hard time understanding from the documentation which are the correct filters I need to use. I am not using the default theme.   This links are under the _META_ box   1. Site Admin   2. Log out


title: Multiple pages on a single page

text:
I have the following code (created very kindly by alchemyth in response to a question I posted on the WordPress.org forum here) that I hope to use to display lots of pages on a single page:               <?php     $args = array(       'post_type' => 'page',       'post__in' => array( 2, 5, 35, 67 ) //list of page_ids     );     $page_query = new WP_Query( $args );     if( $page_query->have_posts() ) :     echo '
';     //print any general title or any header here//     while( $page_query->have_posts() ) : $page_query->the_post();     echo '
ID . '">';     //print any output you want per page//     echo '
';     endwhile;     echo '
';     else:     //optional text here is no pages found//     endif;     wp_reset_postdata();     ?>      As a newby though, I am unsure where to put it to make it work! I would be very grateful if someone could help me with this.


title: Action hook to control access to certain parts of my site

text: I'm searching for an action hook which I can use to control access to certain parts of my Wordpress site. I want to write some custom PHP which will check certain user attributes and decide if they can view a particular part of the site (ie only users with certain attributes can view pages which fall under particular url hierarchies). More specifically:   * My user profile has two extra flags: i) member of community 1 and ii) i) member of community 2.   * Community one consists of a load of content which falls under a page with slug "community1"   * Every time a use tries to access the page with slug community1 or any of it's sub-pages (eg community1/about), I want to check that they are a. logged in and b. have the community1 flag set in their profile. If they do then I allow the access, if not I redirect to page explaining that they need to sign up for access.    * The same for community2.


title: How to add tag(s) to all posts from a specific category?

text: I'm currently redesigning a cartoon site that has 1200+ posts, divided into about 62 different categories. Some categories have 2 posts in them, other categories have 50, 100, 200+. Now for every category, I want to add a tag to all the posts in that category. Does anybody know if there is a SQL query to automatically add a specific tag to all the posts in a category? Any help much appreciated!


title: wpdb->prepare and mysql UPDATE - how is it done?

text: Trying to set a 'removed' date time in a plugin query but I'm not sure how to use UPDATE SET with $wpdb->prepare. Here's my query:               $cur_date = date('Y-m-d G:i:s');             $rows_affected = $wpdb->query(                     $wpdb->prepare("                        UPDATE $table                        SET ( removed, post_id, user_id, status )                        VALUES ( %s, %d, %d, %d )                        "),                        array(                         $cur_date,                         $postid,                         $userid,                         0                     )                 ));      Can I set up UPDATE like this using $wpdb? Very new to self crafted DB queries. If not, how should/can I accomplish this? Thanx in advance! EDIT --------------------------------------------------- New code:               $table = $wpdb->prefix . 'ds_entry_swoons';     $cur_date = date('Y-m-d G:i:s');      $rows_affected = $wpdb->query(                                   $wpdb->prepare("                                                  UPDATE {$table}                                                  SET  removed = %s, post_id = %d, user_id = %d, swoon_status = %d                                                  WHERE post_id = $postid AND user_id = $userid;",                                                  $cur_date, $postid, $userid, 0                                                  )                                   ));


title: create a link to a random post within the current category

text: I've got some code which creates a nice link to a random post - any way to amend it so that on a category page it selects a post from the current category? thanks,               <?php     $randomPost = $wpdb->get_var("SELECT guid FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY rand() LIMIT 1");     echo 'Random Post';     ?>


title: Set Checkbox as checked by default

text: I want to add a checkbox in the post meta and set it as checked by default. I am trying following code, but it does not display the checked box by default. However it saves correctly and after saving the post, it displays the checked box. How can I set it checked by default?               <?php         $checked = get_post_meta( $post->ID, 'show_links', true );  //returns string(0) ""          $current = true;         $echo = true;     ?>     <input name="show_links" type="checkbox"  value="1" <?php checked( $checked, $current, $echo ); ?>/>      This is how I'm saving the value:               if ( isset( $_POST['show_links'] ) && $_POST['show_links'] == 1) {         update_post_meta( $post->ID, 'show_links', 1 );      } else {         delete_post_meta( $post->ID, 'show_links', 1 );      }


title: Is there un-wp_autop function?

text: I have a problem with WP that need your help. Some of my posts have content that was applied "wp_autop" filters already. This filter turned all double break lines into `<p>` tag. I want to the opposite thing: turn all `<p>` tag into double break lines. Do you have any suggestions? Thank you.


title: file_get_contents - failed to open stream

text: I have this code on my functions.php for getting shorturl over bit.ly               function bitly() {     global $post;     $bitly = file_get_contents('http://api.bit.ly/v3/shorten?login=USER&apiKey=KEY&longUrl='.urlencode(get_permalink($post->ID)).'&format=txt');     echo $bitly;     }      but, sometimes i got error like this "Function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in functions.php on line 614" Line 614 is code from above. What i want is to handle that error and not show it for users. But instead of showing bit.ly short url, if error 404 is there, i want to show default wp.me url for users or if not possible wp.me then whole url. EDIT I fixed this with this code               function bitly() {     global $post;     $bitly = wp_remote_retrieve_body (wp_remote_get('http://api.bit.ly/v3/shorten?login=USERNAME&apiKey=APIKEY&longUrl='.urlencode(get_permalink($post->ID)).'&format=txt'));     if( is_wp_error( $bitly ) ) {     echo wp_get_shortlink($post->ID); }     else { echo $bitly; }     }


title: Wordpress Settings API settings not saving for some users

text: I created a plugin you can see here: http://wordpress.org/plugins/vegas- fullscreen-background-slider/ Some users are saying that settings aren't saving. For me it's working fine but I'm fairly new to php and absolutely new to the settings api, so I'm just wondering if I did something wrong or incorrectly that could be leading to this? Though ike I said, it's working just fine for me that's why I'm confused... Here's the pastebin of my options.php: http://pastebin.com/aSgmY42r


title: How to delete usermeta after a user is deleted?

text: Using the admin panel, I deleted several users that I thought were attempts to spam the site. But the records for these users are still in wp_usermeta. As a result, the user count on the admin panel is wrong. WP doesn't do cascading delete from wp_users to wp_usermeta when deleting users??? Should I just delete these rows via phpMyAdmin or is there a better way?


title: Open media popup to specific tab

text: The project I'm working on right now uses the wp brightcove plugin and has it added to the media popup window as a separate tab. I've been asked to make it so when someone clicks a video button (which I've added), the media popup comes up with the video tab selected. I THINK I've got the popup working correctly (please correct me if I'm doing this the wrong way):               jQuery(document.body).on( 'click', '#add-video-button', function( event ) {         var $button = jQuery(this),             editor = $button.data('editor'),             options = {                 frame:    'post',                 state:    'brightcove',                 title:    'Videos',                 multiple: true             };         event.preventDefault();         $button.blur();         wp.media.editor.open( editor, options );     });      I thought maybe the state was what I needed to set, but I can't figure out what value it should be, or how to figure out what value it should be. So is this the right way to trigger the media popup? And how can I select the tab I want? Is there any good documentation on the media popup? I haven't been able to find anything; I've just been reading the code assigned to wp.media


title: 404 error on second page load for child-pages

text: I have a strange problem which I really do not understand: My site has the page `community` and a sub-page called `test`. Permalink structure is set to `/%postname%/` So the URLs for the pages are:   * mysite.com/community   * mysite.com/community/test When I open the page "community/test" it is displayed correctly. But when I hit F5/refresh the test-page then I get an 404 error! When I refresh again I keep getting 404 errors, until I load a different page (e.g. front-page) and then go back to the test-page. Then the test page is displayed again on first request but on refresh I get a 404 again. These are normal WordPress pages, no custom post-type etc. Also the WordPress installation is not using multi-site. And I do not know what is causing this issue...


title: Pull latest Youtube Video from json url and make new post

text: I am trying to automatically "add-new" Wordpress post when a Youtube User uploads a new video. Using wp_insert_post(); I can echo what I need to, but how do I write a function that determines: "If youtuber posts new video, then echo results, if else do not post"? I have been using gdata.youtube.com to decode the json format with my queries, pulling and echoing the data into my theme. Unfortunately I do not know how to proceed in grabbing the "latest video". We will use "markiplierGame" as an example Youtuber to pull from. Example URL: http://gdata.youtube.com/feeds/api/users/markiplierGame/uploads?max-results=50               // User inputs his Youtube ID in theme-options.     $youtuber = get_post_meta ($post->ID, 'youtuber_id', $single = true);          // The ID is then injected into the gdata variable.     $youtuber_gdata= file_get_contents("http://gdata.youtube.com/feeds/api/users/{$youtuber }/uploads?max-results=50");          // json data is then decoded.     $uploads = json_decode($youtuber_gdata);          // Grab the terms needed from decoded gdata     // "entry", "yt$statistics", and "viewCount" are examples of data I can pull.     $new_videos = $uploads->{'entry'}->{'yt$statistics'}->{'viewCount'};      Can anyone help me figure out how to grab the latest video from the json url? I need this to be accurate, or even be able to pull all previous uploads from a bigger youtube user. Thanks for the assistance!


title: Making a configurable field translatable

text: I'm working on a theme right now that gives the admin the possibility to set different texts that are used within the theme, by configuring them in the admin panel (e.g. the text that is displayed, when a 404 error occurs). I want to make these config fields translatable. What is the best way to do so, or what do I have to take into account for doing so? Thanks and regards,   René


title: How can i listing current category and Featured Category post list?

text:
I have a Featured Post Category. Im marked some post Featured. When i viewing a category page(e.g. Sport), i want to list on sidebar both marked post list (e.g Featured and Sport,) I tryed with that following code.It's worked for me but when i using my code i see two category post (e.g Sport ), category post list affected by my code and listing same post list. My example picture! Here How can i fix that? My Code:               <?php     //55 is my Featured Category id     if ( is_category() ) {       $current_cat = get_query_var('cat');     }     query_posts(array('category__and' => array(55, $current_cat )));          if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>">               <?php the_title(); ?>
      <?php endwhile; else: ?>      <?php endif; ?>


title: group posts by taxonomy terms

text: I have a site with two CPT's Projects and Artworks. I use scribu's posts2posts for connecting a bunch of artworks to each project. In a single Project view, I want to display all connected artworks. But the artworks should be grouped under headings like 'Paintings', 'Videos', etc.. Now, the obvious thing I thought, would be to add a custom taxonomy (work- type) with the terms Paintings', 'Videos' in order to be able to GROUP the artworks by work type. Using WP_Query(), I can't order by the terms of my taxonomy. I can query all the connected works, and do some php stuff, to get them sorted out of course, but I'd like to avoid extra calls to the DB, and to use the WP API as much as possible.. What would be an most effective way of achieving what I need? Do I have to construct a custom raw sql query?


title: Phpmyadmin - post editing

text: i am total newbie with phpmyadmin, and the first time i use it, was to delete a lot of spam comments.I m not sure is it possible to do what i want , but another option would be to go trough 400-500 articles and do it manually. ok, what i need with phymyadmin is this.When i started my blog it was with blogger.com which was limited.Two years ago i switched to wordpress,and imported all those posts.Since it was limited i add a lot of links pointing to some other area of blog. So is its possible to delete for an exmaple all those links from posts without deleting the posts.I want to keep them, and only delete for example some link which they contain. Trough phpmyadmin search i found all those links and posts, now the only thing i need is to delete automatically this links. I m hoping i explained this well.


title: Browser Cache causes 'Orderby=rand' to return the same posts

text: I have a code that redirects users to a random post whenever they visit the homepage:               if (have_posts()) {         query_posts('orderby=rand');         while (have_posts()) {             the_post();             wp_redirect(get_permalink());         }     }      The problem is that it redirects me to the same post whenever I'm not logged in. I suspect W3 Total Cache is the culprit as it puts logged in users in an exception. However, the problem persisted even though "Cache front page" is unchecked and "index.php" and "*/" is put into the page exception list. I even tried to disable the whole thing, Page Cache, but still nothing. Finally I tried to disable the Browser Cache and voilá, random posts! But that's not a viable solution and I don't understand how Browser Cache could be causing 'orderby=rand' to return the same posts and not Page Cache. Any help? **EDIT:** It only returns the same post when I reload page through the site (clicking a 'href="/"' link or redirecting to a 'href="/"' link through jquery. But when I reload the page through the browser adressbar it works fine. How?


title: Check if menu id = $specific_id - then insert specific <img>

text:
I currently have a menu structure as followed:

         Frontpage

      **What im looking to do is hardcore a little menu icon image for each different menu id** , however im not sure how to manipulate `wp_nav_menu` to insert something "custom" like this? Ideally what I want to do is something like: `if($menu_id == 411) { //insert specific <img>`- with some result like this:
                  Frontpage
      Right now my menu is printed out with:                                   $nav_args = array(                             'theme_location' => 'nav',                             'container' => 'none',                             'menu_class' => 'level-1',                             'depth' => 3,                            );                              wp_nav_menu( $nav_args );      Any ideas?


title: Which filter affects the 'entry-title' post class

text: I created a plugin setting a $var to true if the post belongs to category 'a', and set the same $var to false if the post belongs to category 'b', it works and I can get the correct value depends on the category what I need is to find a filter helps me to add an extra text to the `entry- title` post class so I can change post title align or color if if the post category is `a` without editing content.php file. Here is the code:               function change_my_entry-title(){         if ($var === true){             return 'entry-title_cat_a';         }else{             return 'entry-title';         }     }     add_filter(' ..... ','change_my_entry-title');      So which `filter_name` I should put instead of `.....`


title: Add custom role across network in multisite

text: Maybe this is a duplicate of Add role across network in multisite, but the answers there are not conclusive so I'm asking again. Any help would be deeply appreciated. I'm trying to add two new custom roles on a multisite installation. I have written a plugin, installed it and enabled it across the whole network, and the new roles are added by this plugin's activation hook. There, I simply do               add_role('x', 'Description of X', $capabilities_array);     add_role('y', 'Description of Y', $capabilities_array);      Then, I try to create a new "child" site, add a new user to it, and then apply one of the custom roles to that new user. The custom role appears at the roles dropdown list, but when I try to apply the role to the user, I get an error saying "You can't give users that role". I searched a lot over the internet and found that the roles and capabilities are stored under the user_roles option in the options table. However, I noticed only the options table of the root site has the custom roles I added. I suspect this is the cause of the error I get. But then, how do I go around this? Is there a way of creating new custom roles which are visible and can be applied to every "child" site, even to the new ones I possibly add in the future? My ultimate intention is to customize the dashboard and menu options of each site/user based on its custom role. Ideally, I'm looking for a solution without any extra plugins involved, as this is going to be part of a services platform I'm willing to provide. Thanks in advance. Arnaldo


title: Make a video post redirect to next post after completion

text: I want to make video posts redirect to the next video post in it's category after it's over. I use both youtube videos and directly uploaded videos both of which I already know how to pull the duration in seconds. How can I use them to accomplish my goal?


title: Mass .htaccess URL Forwarding

text: I'm doing the migration of a site, from MovableType to WordPress. The website contains around 3500 posts and when I uploaded the information to the new version of the site, the links have been altered. Old site link (note that the category-name and the nodenumber are not fixed values. The nodenumber is a number that changes in each post): http://websitename.com/category-name/nodenumber/title-of-the-post New site link: http://websitename.com/category-name/title-of-the-post My question is the following: What would be the easiest and effective way to configure my Htaccess file to do a redirection from the old links to the new ones? There might be a simple way than to write them all by hand.


title: 100% Width Footer - Custom Child Theme

text:
I am working on a custom child theme for Wordpress and I can not seem to get a footer width of 100% to be represented. Live Example Page : http://glustik.com/wordpress/ I have tried multiple things, but I cant get the footer background to show up, the contents of the footer show up fine. **Here is the Footer Code I am Using.** _(I am trying to replicate the Header)_               #footer{         width: 100%;         margin:20px 0 20px 0;         height:280px;         border: 1px solid;         border-top-color:rgba(255, 255, 255, 0.14);          border-bottom-color:rgba(0, 0, 0, 0.14);         border-left-color:rgba(0, 0, 0, 0.14);         border-right-color:rgba(0, 0, 0, 0.14);         display:block;         -moz-box-shadow: 0 0 15px 10px rgba(0,0,0,0.4);         -webkit-box-shadow: 0 0 15px 10px rgba(0,0,0,0.4);         box-shadow: 0 0 15px 10px rgba(0,0,0,0.4);         background: #262626; /* Old browsers */         background: -moz-linear-gradient(top,  #262626 0%, #131313 100%); /* FF3.6+ */         background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#262626), color-stop(100%,#131313)); /* Chrome,Safari4+ */         background: -webkit-linear-gradient(top,  #262626 0%,#131313 100%); /* Chrome10+,Safari5.1+ */         background: -o-linear-gradient(top,  #262626 0%,#131313 100%); /* Opera 11.10+ */         background: -ms-linear-gradient(top,  #262626 0%,#131313 100%); /* IE10+ */         background: linear-gradient(top,  #262626 0%,#131313 100%); /* W3C */         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#262626', endColorstr='#131313',GradientType=0 ); /* IE6-9 */     }      **Here is the HTML for my FOOTER.php :**

                 Address:
                 3945 S Durango Dr
                 Las Vegas, NV 89147

                      Phone:
                 702-349-0320

                      Hours:
                 11am - 3am

                 Facebook, Twitter, Yelp, and Kyara go Here.

Website Design by gluSTIK Multimedia


title: Specifying a size when displaying an image associated with a taxonomy through ACF

text: I created a "books" custom taxonomy for my "book" CPT. Using ACF, I assigned an image to each my custom taxonomy terms. I have a page where I display all my "books" terms as images. It works but now I want to specify a particular size to these images. The code of the page:               <?php     $taxonomy = 'books';     $tax_terms = get_terms($taxonomy);     ?>     <ul>     <?php     foreach ($tax_terms as $tax_terms) {         $taxonomy_image = get_field( 'taxonomy_image', 'books_'.$tax_terms->term_id );         $taxonomy_image_url = $taxonomy_image['url'];                        ?>         <img src="<?php echo $taxonomy_image_url; ?>" alt="" />         <?php     }     ?>     </ul>      I think the ACF doc page about images contains the key to what I'm trying to do - especially the part about image size, but I can't seem to find a way to integrate it to my code successfully. Any suggestion?


title: Kohana Frontend, Wordpress Backend

text: I love Kohana code, I don't love Wordpress code. I need to upgrade a blog to have a custom theme, very custom with Grid style blog roll (like Pinterest) and Traditional Blog Roll, and fully responsive for all devices. I was thinking of keeping the Back end on Wordpress as it currently is (maybe on a different subdomain), and then writing a custom Kohana front end, which queries the WP database and makes up the pages. All blogging happens on WP, all pages that readers see are run as a Kohana site. Am I crazy? Has anyone tried this? Is there anything to watch out for? (Yes, what I need to do probably _could_ be done by an experienced WP developer, but I'm not him, and I'm gonna have to maintain this for years to come).


title: How to get blog name, when using Wordpress Multisite

text: I have a wordpress multisite installtion with 5 sites within, the multisite is called **Lifestyle**   1. Homes   2. Cars   3. Architecture   4. Holidays   5. Communities I am trying to get the **blog** name, for each blog when viewing in my theme, every function I use returns 'Lifestyle'. I have tried;               get_bloginfo('name');          get_bloginfo();          global $current_site; var_dump(get_current_site_name($current_site));          get_current_blog();      none of the strings or objects returned contain the blog name, they all contain the site name "Lifestyle" can anyone offer any advice...


title: How to change the default registration email ? (plugin and/or non-plugin)

text: After a new user registration, WP sends out an email with the login / password, and a link to the login page. Is there a way to change this defaut email template? I'd also like to change the subject and sender. Edit : For anyone interested, here is a plugin solution.


title: Query for custom post type?

text: I have installed the Custom Post Type UI plugin. After activation of this plugin I have created a custom post type called `portfolio`. Now I want to use this on the portfolio page in the front-end. How do I fetch _all post that are of custom post type`portfolio`_?


title: How to do Domain Mapping to Subdirectories?

text: Does Wordpress MU not allow domain mapping to subdirectories, such as example.com/blog? Wordpress.com doesn't allow this. I couldn't find an option to do this in WordPress MU Domain Mapping plugin.


title: Are There Any Plans for Wordpress to Support Databases Other Than MySQL?

text: I've long wished Wordpress would support SQL Server, but it would also really amazing if it supported MongoDB (for example.) My question is _are there any plans to do so, at all?_ Is the core Wordpress team so commited to MySQL that there are no plans to offer any sort of support for other DBs (at least anytime soon?) This post leads me to believe any such thing won't happen: http://codex.wordpress.org/Using_Alternative_Databases However, as an example (while I much prefer Wordpress to it) Drupal 7 now features a ... > Database abstraction layer, enabling the use of many databases, such as > Maria DB, Microsoft SQL Server, MongoDB, Oracle, MySQL, PostgreSQL, or > SQLite http://drupal.org/node/1015646


title: how to reset metabox excerpt to open

text: For some reason the excerpt box on the new posts page (post-new.php) is always closed. I can alter that with firebug, but it should be open anyway. There is a "closed" class being added by someone somewhere, but it is unwanted. Is there any fix?


title: Images don't show up

text: I've just set up a new multisite installation. Everything works as I'd except that images don't show up on any of the sub-sites. **Any idea why the images don't show up?** I'm running Wordpress 3.1.1 on IIS6 in a shared Windows server (hosted by Arvixe.com). The secondary sites are in sub-directories rather than sub- domains. The images for the main site work, as does the header image, but the images in sub-sites don't appear. I know that the images are uploading properly as they appear in the blogs.dir folder on the server. They also show up if I navigate them like this: > http://www.example.com/test/wp-content/blogs.dir/5/files/2011/04/LazyDog.jpg However, they don't work when I navigate to them like this: > http://www.kramii.com/test/files/2011/04/LazyDog.jpg When I try this second version in IE I get the broken image icon, whereas in Firefox I get just the filename at the top of the screen. Interestingly, when I show the page info in Firefox it shows type as "image/jpeg", which suggests to me (and I might be wrong) that the server has found the image and is attempting to send it to the browser. My web.config looks like this: In my settings for the site I've got:   * Site url = http://kramii.com/test/   * Home = http://kramii.com/test/ Upload   * path = http://kramii.com/wp-content/blogs.dir/5/files   * Upload URL path = http://kramii.com/wp-content/blogs.dir/5/files   * Fileupload URL = http://kramii.com/wp-content/blogs.dir/5/files I've disabled all plugins. One final note: someone on another site had a similar problem and someone else replied "Is your webhost using a caching mechanism or proxying your webtraffic?". Quite honestly I don't really understand what this means. How would I know? What can I do if they are? Thanks.


title: Adding language tabs to rich text editor

text: I started to learn Wordpress and I'm creating the website for my company. I have experience with PHP, but I had never used Wordpress before. I started by making a plugin to save/edit our works to the database, I managed to create a new admin screen, save to the database, the basic stuff. But we also need multilingual support, so I downloaded QTranslate and I'm trying to integrate my plugin with it. I can get both the current language and the enabled languages (so I can give both options to whoever is writing the information about the work) but I can't find a way to add extra language tabs to the editor, like the ones in the new post section. I tried this on my plugin page: `add_filter('the_editor', 'qtrans_modifyRichEditor');` and then: `wp_editor('','description');` if I pass my own function I can see results (like echoing something), but using the qtranslate function nothing changes. Is this even the correct function? Is there another way to add extra language tabs?


title: Capital letter in URL

text: How can I make all of my page names in URL begin with capital letter? I need this to maintain PAGERANK. Example http://www.example.com/page ---> http://www.example.com/Page


title: Instead of 4 loops, how can I do it better?

text: I want to grab all posts from an author under category X. Right now, I am using 4 separate loops to do this for 4 different categories. Is there a better way to do this? `query_posts`


title: How do I add a custom taxonomy as an option for menus under "Appearance" > "Menus"

text: I've created a custom taxonomy and I want to add it as an option for custom menus (under Appearance > Menus). How do I get it to show up there (see the illustration, I want it to show up where the red square is). ![enter image description here](http://i.stack.imgur.com/FeLSC.png)


title: Getting $curauth->ID to work inside a shortcode

text: Im wanting to show a profile/logo pic on author.php via a simple shortcode:               function wpaluploader_showauthorimage() {     $wpaluploader_authorlogo = 'ID.''.get_option(wpal_mime) .'"/>';     return $wpaluploader_authorlogo;     }        I know i need to get:   global   $author   inside this function, however no matter how i go around it i can get it to work, i have a similar shortcode for all other posts/pages which doesnt need the global and $author declarations as they use the wp loop to get the info. The plugin im working on takes an uploaded image from frontend, renames it to user_id and pops it in a folder, so its pretty important that i can pull this curauth->ID info to display it on author.php via the shortcode edit, complete working code:               function wpaluploader_showauthorimage() {     global $author, $profileuser;     if(isset($_GET['author_name'])) {     $curauth = get_userdatabylogin(get_the_author_login());     } else {     $curauth = get_userdata(intval($author));     }     $wpaluploader_authorlogo = 'ID .''.get_option(wpal_mime) .'" />';     return $wpaluploader_authorlogo;     }


title: Integrating different plugins to work together

text: This is a general question on how plugins work together. I'm having difficulty grasping some concepts of WP. In wordpress when I'm working with multiple plugins how are they integrated to work together so that it's seamless. For example I'm using 2 plugins: One is a Classified Ad plugin and the other is a Private Messaging plugin. Currently the Classified plugin only allows users to communicate by sending emails kinda like craigslist, however I want them to communicate internally on my site. So in the Classified plugin page, when I hit "reply to user" it shows me the Classified Ad's reply page. However at that point I want users to use the Private Messaging plugin so they can communicate on my site internally. How do I direct the user to the Private Messaging plugin page AND have the Private Messaging plugin understand who both parties are? In other words, would something like this require more complicated programming skills with the use of filters and hooks...etc? I guess that's my real question. Sorry for babbling on here, I'm just really reaching my limites of frustration with wordpress and have struggled to fully grasp the concept of WP.


title: Can't un-archive site after upgrading to Wordpress 3.8

text: After upgrading to Wordpress 3.8, both of my network sites were archived. I could un-archive one, but the other has no option to un-archive in the Sites list: ![enter image description here](http://i.stack.imgur.com/tATbV.jpg)


title: html entities occur in the_excerpt used as meta description

text: This must be pretty simple, but when I use the function below in header.php to grab the post excerpt to use a meta description for a single post or page `setup_postdata($post); $excerpt = get_the_excerpt(); echo $excerpt;` I end up with html entities for apostrophes, quotes, etc., like this:               <meta name="description" content="There&#8217;s an interesting thing     going on in the world of digital music; it&#8217;s moving     into the &#8220;cloud.&#8221; ...">      I've tried `echo htmlentities($excerpt);` and `echo html_entity_decode($excerpt);` with no luck. How can I prevent those entities from showing up? I'm not using a function in functions.php to generate an excerpt. This is kind of a workaround, as I have hundreds of posts that don't have a manual excerpt, and I think manual excerpts are immune to the entity issue, and that's why I am trying to use the standard excerpt.


title: can't access dashboard and showing forbidden page

text: i cant access my dashboard. after i make true the wp-debug it shows the following error.               Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /var/www/html/enteopinion/wp-includes/functions.php on line 3012       what should i do to make the site dashboard to work well? i used a plugin simple error handler.it shows the following errors.               Error trapped: USER NOTICE(1024), wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.)      /var/www/html/enteopinion/wp-includes/functions.php[3012]      /var/www/html/enteopinion/wp-includes/functions.wp-scripts.php[57]      /var/www/html/enteopinion/wp-settings.php[197]      /var/www/html/enteopinion/wp-config.php[90]      /var/www/html/enteopinion/wp-load.php[29]      /var/www/html/enteopinion/wp-admin/admin.php[30]      /var/www/html/enteopinion/wp-admin/plugins.php[10]      what to do with these errors? :( please help me


title: Accessing widget information

text: I'm trying to access widget information saved in the `wp_options` table.   I printed it out:               add_filter('the_content', function(){         $res = get_option('widget_my_widget');         print_r($res);     });      And it outputted this:               Array ( [2] => Array ( [title] => asian kung-fu generation [description] => awesome band ) [_multiwidget] => 1 )      My question: is the data always stored at index 2? If not, how can I access the data without worrying if it gives me the correct one or not?


title: Orion theme (from theme forest)

text: I was given a theme called Orion available from themeforest. I had experienced troubles installing it via GUI (style.css was missing), therefore I did that operation manually by copying Update directory up the directory tree. Now the theme appears somehow empty/broken. I was wondering whether this specific theme is meant to be standalone or just as an update to a prerequired theme (and which one, if this is the case). Thank you! Edit: I apologize as I wasn't clear enough. Is it normal that the theme .zip file which should be used to install the theme does not contain style.css? Why is the stylesheet only included in Update folder and what is (usually) the purpose of that subfolder?


title: Custom Order in WP Query

text: I'm trying to implement my own query ordering, here is what I came up with...               $query = new WP_Query('post_type=contentboxes&include=' . $contentboxes . '&order=ASC&orderby=include' );      My custom loop, _$contentboxes_ looks like _34,45,23,46_ with the orderby include argument. To implement my custom order I use the *pre_get_posts* and *posts_orderby* filter.               function pre_get_posts( $query )     {         if ( 'include' == $query->query_vars['orderby'] ) :             global $order_by_include;             $order_by_include = TRUE;         endif;     }      *$order_by_include* is a empty variable that is created when my custom ordering is used.               function posts_orderby( $orderby )     {         if ( !isset( $order_by_include ) )             return $orderby;              global $wpdb, $contentbox_order;              unset( $order_by_include );         return "FIND_IN_SET(" . $wpdb->posts . ".ID, '" . $wp_query->query_vars['include'] . "') " . $wp_query->query_vars['order'];     }      In the posts_orderby filter I'll overwrite the current order to my custom one, if the variable is set. After that I unset the variable to keep the global scope clean and not altering any other loops. Here is my question now, I don't like using a global variable to implement this feature, I think it is a bit dirty but does the job. I tried to get the query vars from my custom query inside the posts_orderby which works but my custom. Is there a cleaner way to do that?


title: Arrange Posts By Date In Order Of Closest To The Current Date

text: I have a list of events on a clients website that show in a sidebar. When viewing the homepage you see one event and if you're anywhere else on the site you see two events in the sidebar. I am currently ordering them by using a meta_query compare that checks if the event is today or in the future. What I would like to do is have the events show by closest to the current date first, then proceed up the chain until it finds one. Currently it appears to show events by furthest into the future instead. So if I have an event January 27th, 2012 and an event August 15th, 2012 it seems to show the August event. The code I currently have is the following. I'd appreciate some advice on how to tweak it to get it to work the way I want. Please provide a little explanation with any code you post if possible, I'd like this to be a learning experience.               $totalPosts = 2;              $args = array(             'post_type'        => 'upcoming_courses',             'order'            => 'ASC',             'orderby'          => 'meta_value',             'suppress_filters' => true,             'posts_per_page'   => $totalPosts,             'numberposts'      => $totalPosts,             'meta_query' => array(               array(                 'key' => 'course_date',                 'value' => date('Y-m-d'),                 'compare' => '>=',                 'type' => 'NUMERIC'               )             )         );              $my_query  = new WP_Query( $args );


title: How to display multiple custom columns in the wp-admin users.php?

text: I'm using the manage_users_columns to display a custom field I create in the usermeta database called company. My code is as follows:               function mysite_column_company( $defaults ) {      $defaults['mysite-usercolumn-company'] = __('Company', 'user-column');       return $defaults;      }      function mysite_custom_column_company($value, $column_name, $id) {       if( $column_name == 'mysite-usercolumn-company' ) {             return get_usermeta($id, 'company');       }      }          add_action('manage_users_custom_column', 'mysite_custom_column_company', 15, 3);     add_filter('manage_users_columns', 'mysite_column_company', 15, 1);      I'd like to get to display two other custom fields, but can't figure out the proper function. Duplicating this one doesn't work and I've not had any luck adding new functions within this one for each unique column, mostly because I can't seem to figure out how to properly define the $defaults variable. Any suggestions?


title: Adding New Row of Custom TinyMCE

text: I have added some custom tinymce to the WP editor using the following code: PHP               add_action( 'init', 'my_theme_buttons' );     function my_theme_buttons() {     add_filter("mce_external_plugins", "my_theme_add_buttons");     add_filter('mce_buttons', 'my_theme_register_buttons');     }        function my_theme_add_buttons($plugin_array) {     $plugin_array['buttons'] = get_template_directory_uri() . '/editor-buttons/buttons-plugin.js';     return $plugin_array;     }     function my_theme_register_buttons($buttons) {     array_push( $buttons, 'arrowicon' ); // &etc for each icon... name from buttons-plugin.js     return $buttons;     }      Javascript               (function() {     tinymce.create('tinymce.plugins.buttons', {             init : function(ed, url) {                  ed.addCommand('arrowicon', function() {                      return_text = '[arrow-icon]';                 ed.execCommand('mceInsertContent', 0, return_text);             });                  // &etc for each icon...                              ed.addButton('arrowicon', {                 title : 'Arrow Icon',                 cmd : 'arrowicon',                 image : url + '/arrow-right.png'             });                  // &etc for each icon...                  },            createControl : function(n, cm) {             return null;         },          });          // Register plugin     tinymce.PluginManager.add('buttons', tinymce.plugins.buttons);     })();      Everything works fine but I want to display my custom icons in the second row of the wp-editor so that they can be toggled with the "kitchen sink" button (preferably in the third row). Right now they are displayed like so: ![display in wordpress editor](http://i.stack.imgur.com/ZGrqW.png)


title: Using wp_dropdown_categories in widget options

text:
I have a product search widget when you select certain products a hidden field is shown. I would like to set a custom category in my widget options that is then used for displaying my hidden field. I have the front end working 100% when I add the parent category_id manually to my code. Now I just need to set the category option in my back end. This is what I have currently but its not working in the sense that its not storing the selection that is made. I left out the search form because it doens't use any of the widget options.               class Equipment_Search extends WP_Widget {              function Equipment_Search() {             $widget_ops = array( 'classname' => 'agriquip', 'description' => __('Displays the Equipment Search Form', 'agriquip') );             $control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => 'agriquip-widget' );             $this->WP_Widget( 'agriquip-widget', __('Equipment Search', 'agriquip'), $widget_ops, $control_ops );         }              function widget( $args, $instance ) {             extract( $args );                  $title = apply_filters('widget_title', $instance['title'] );             $tract_id = isset( $instance['exc_equipment_cat'] ) ? $instance['exc_equipment_cat'] : false;                $tract = wp_list_pluck(get_terms('exc_equipment_cat', array('parent' => 3)), 'slug');             $tractparent = get_term_by('id','3', 'exc_equipment_cat');             $tractparent = $tractparent->slug;                        echo $before_widget;     echo $after_widget;         }              function update( $new_instance, $old_instance ) {             $instance = $old_instance;                  //Strip tags from title and name to remove HTML              $instance['title'] = strip_tags( $new_instance['title'] );             $instance['exc_equipment_cat'] = $new_instance['exc_equipment_cat'] ? 1 : 0;                  return $instance;         }              function form( $instance ) {                  //Set up some default widget settings.             $defaults = array( 'title' => __('Equipment Search', 'agriquip'), 'exc_equipment_cat' => '-1');             $instance = wp_parse_args( (array) $instance, $defaults ); ?>
                 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'agriquip'); ?>                 <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" class="widefat" />
                      <form method="post" action="">                     Category to use with Kw Options                     <?php                             $dropdown_args = array(                                 'taxonomy'          => 'exc_equipment_cat',                                 'name'              => $this->get_field_name('exc_equipment_cat'),                                 'show_count'        => 1,                                 'orderby'           => 'name',                                 'hierarchical'      => true,                                 'echo'              => 0,                                 'depth'             => 1,                                 'show_option_none'  => 'Select Category',                                 'selected'          => (int)$instance['exc_equipment_cat'],                                 );                             wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $dropdown_args));                             $select = wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $dropdown_args));                             $select = preg_replace("#<select([^>]*)>#", "<select$1 class='widefat'>", $select);                         echo $select;                     ?>                   </form>                   <?php         }


title: WordPress 3.0.1 Auto Update Problem

text: My WordPress now is at version 2.7. I want to upgrade it to 3.0.1 using Auto update function. I'm using FTPS connection type. The upgrade should be straight forward, however, I keep on encountering this error: > Installation Failed Downloading update from > http://wordpress.org/wordpress-3.0.1.zip… > > Unpacking the update… > > Verifying the unpacked files… > > Installing the latest version… > > Could not copy file.: /wp-admin/css/theme-editor.dev.css > > Installation Failed I've checked the permission for the `/wp-admin/css` folder, and it's set to 777. What is the problem? I've searched the internet, but it seems that a lot of people has the same problem. Any ideas?


title: Local copy of WordPress Codex?

text: Sometimes I want to develop WordPress themes when I have no internet connection. I need the **Function Reference** and **Template Tags** to be productive. I searched for a downloadable or SVN copy of the **Codex** but could not find one. I ended up trying to mirror it using `wget`, but the results were spotty (it's too huge!). Is there a better way?


title: How to fix broken admin Thickbox?

text: I have an installation of wordpress with the core wordpress files in a sub- directory as described here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory. I've also changed wp-content to just content and moved it outside the wordpress core directory. Everything works fine except the media upload dialog does not load via Thickbox. It will load in the browser window and functions fine. So it seems it's just Thickbox that is not working. Any ideas on what I may have missed, or how to correct this problem?


title: Can't manage to display an uploaded picture (uploaded from a custom button) in the front end

text:
I followed this tutorial in order too add a custom upload button in the Wordpress admin. It displays the picture you just uploaded right after saving: ![enter image description here](http://i.stack.imgur.com/sUWTr.png) The problem is that I can't manage to display the picture in the front end, in a template file. This is the section that displays the picture:                  function ud_section_text() {             $options = get_option('ud_options');             echo '
Upload your file here:
';             if ($file = $options['file']) {                 // var_dump($file);                 echo "";             }         }      So I tried this:               <?php var_dump($file['url']); ?>       **but it returns NULL.** Any suggestions? code:               <?php     /*     Plugin Name: Upload Demo     Description: Demonstrate a plugin that lets you upload an image     Author: Otto     Author URI: http://ottodestruct.com     License: GPL2              Copyright 2010  Samuel Wood  (email : otto@ottodestruct.com)              This program is free software; you can redistribute it and/or modify         it under the terms of the GNU General Public License version 2,         as published by the Free Software Foundation.              You may NOT assume that you can use any other version of the GPL.              This program is distributed in the hope that it will be useful,         but WITHOUT ANY WARRANTY; without even the implied warranty of         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         GNU General Public License for more details.              The license for this software can likely be found here:         http://www.gnu.org/licenses/gpl-2.0.html          */          // add the admin page and such     add_action('admin_init', 'ud_admin_init');     function ud_admin_init() {         register_setting( 'ud_options', 'ud_options', 'ud_options_validate' );         add_settings_section('ud_main', 'Main Section', 'ud_section_text', 'ud');         add_settings_field('ud_filename', 'File:', 'ud_setting_filename', 'ud', 'ud_main');     }          // add the admin options page     add_action('admin_menu', 'ud_admin_add_page');     function ud_admin_add_page() {         $mypage = add_options_page('Upload Demo', 'Upload Demo', 'manage_options', 'ud', 'ud_options_page');     }          // display the admin options page     function ud_options_page() {     ?>

Upload Demo

You can upload a file. It'll go in the uploads directory.
         <form method="post" enctype="multipart/form-data" action="options.php">         <?php settings_fields('ud_options'); ?>         <?php do_settings_sections('ud'); ?>
         <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
         </form>
          <?php     }          function ud_section_text() {         $options = get_option('ud_options');         echo '
Upload your file here:
';         if ($file = $options['file']) {             // var_dump($file);             echo "";         }     }          function ud_setting_filename() {         echo '<input type="file" name="ud_filename" size="40" />';     }          function ud_options_validate($input) {         $newinput = array();         if ($_FILES['ud_filename']) {             $overrides = array('test_form' => false);             $file = wp_handle_upload($_FILES['ud_filename'], $overrides);             $newinput['file'] = $file;         }         return $newinput;     }


title: Custom page-links for paginated posts | wp_link_pages <!--nextpage--> quicktag

text: Does anyone know if it's possible to change wp_link_pages, so that the title of each nextpage quicktag is used rather than numbers? I can't seem to find anything on this. This is an example of how I'm using the quicktag: `<!--nextpage--><!--pagetitle:Overview-->` Using `wp_link_pages();` it displays/outputs; `Pages: 1 2` I would prefer it to display/output; `Pages: Overview | 2nd Page Title | 3rd Page Title` Where it takes the `<!--pagetitle:Overview-->` and uses this as the link to the next page. Any ideas/help greatly appreciated, S.


title: Getting Started with Subversion, Git, or similar Version Control System to keep a History of my Files?

text: I realize this may be a broad question on the surface, but I'm looking for specific examples of setups/workflows that people use to keep a version history of edited files on a WordPress site. For instance, when developing a site (and even after it's live), I often make changes to CSS and PHP files, but I don't have a great way of reverting to older versions of those files. For my purposes, making changes on a local development installation and then copying those changes over to the live site is often more trouble than I'd like. Any suggestions on how to get started using a versioning tool to track edits to files on a live site?


what the best way to include images from the template's images folder? is it by using `get_bloginfo('template_url')`? I understood that its better to hard code the path to the images folder since this way you save function calls in PHP.. any thoughts?


title: Importing blog failed to download attachments from older (still online) blog

text: I was trying to clone one blog to another using the import/export functionality of WordPress. I had selected to export everything on the original blog, and _Download attachments_ on the clone. However, I received an error message for each image of the source, saying that the download failed. The images actually show up, both in the editor and on the site. Obviously both blogs are live. It is possible to upload arbitrary images to the blog's media library (but I had to increase the file size in nginx manually for some reason). **What is the problem and how can I solve it?** Older blog URL: keliom.com   Newer blog URL: jancorazza.com   Server: nginx   OS: Ubuntu 14.04   Export file


title: Can't save options

text:
I created theme options page using Settings API, everything works fine but I can't save options. I tried to figure it out where I missed something but I failed. Any idea what can cause this problem? Here's code of my options page               <?php     /**      * This functions registers default options values for Evolutionary theme       * settings      */     function ev_theme_settings_defaults() {         $options = array(             'color_scheme' => 'blue',             'copyright' => '',             'nav_hide_home' => false,             'nav_hide_sec' => false,             'nav_show_lvl' => false,             'featured_show' => false,             'featured_pause' => false,             'featured_speed' => 5,             'ad1_link' => '',             'ad1_image' => '',             'ad2_link' => '',             'ad2_image' => '',             'ad3_link' => '',             'ad3_image' => '',             'ad4_link' => '',             'ad4_image' => ''         );              return $options;         // Change to apply_filters( 'ev_theme_settings_defaults', $options );     }          /**      * Create helper function for theme colors      */     function ev_get_valid_color_schemes(){         $color_schemes = array(             'blue' => __( 'Blue', 'evolutionary' ),             'green' => __( 'Green', 'evolutionary' ),             'red' => __( 'Red', 'evolutionary' ),             'black' => __( 'Black', 'evolutionary')         );              return $color_schemes;         }           /**      * Setup initial theme options      */     function ev_options_init() {         // Set options equal to defaults         global $ev_options;         $ev_options = ev_theme_settings_defaults();         if ( false === $ev_options ) {             $ev_options = ev_theme_settings_defaults();         }         update_option( 'theme_evolutionary_options', $ev_options );     }          add_action( 'after_setup_theme', 'ev_options_init', 9 );          /**      * Add theme options page to admin menu      */     function ev_menu_options() {         add_theme_page( __( 'Theme Options', 'evolutionary' ), __( 'Theme Options', 'evolutionary' ), 'edit_theme_options', 'evolutionary-settings', 'ev_admin_options_page' );     }          add_action( 'admin_menu', 'ev_menu_options' );          /**      * Register theme options      */     function ev_register_options() {         register_setting( 'theme_evolutionary_options', 'theme_evolutionary_options', 'ev_options_validate' );          /**      * Defining settings sections and fields      * fist setting creates sections for general options      */     add_settings_section( 'ev_settings_general_options', __( 'General Options', 'evolutionary' ), 'ev_settings_general_options', 'evolutionary' );          // Creates section for navigation options     add_settings_section( 'ev_settings_nav_options', __( 'Navigation', 'evolutionary' ), 'ev_settings_nav_options', 'evolutionary' );          // Section for featured post options     add_settings_section( 'ev_settings_featured_options', __( 'Featured Posts', 'evolutionary' ), 'ev_settings_featured_options', 'evolutionary' );          // Section for Advertising options     add_settings_section( 'ev_settings_ad_options', __( 'Advertising', 'evolutionary' ), 'ev_settings_ad_options', 'evolutionary' );          /**      * Created empty callbacks for setions      */     function ev_settings_general_options() {         // Put callback code here     }     function ev_settings_nav_options() {         // callback     }     function ev_settings_featured_options() {         // callback     }     function ev_settings_ad_options() {         // callback     }          /**      * Registered fields      */     add_settings_field( 'ev_settings_copyright_field', __( 'Copyright Name', 'evolutionary' ), 'ev_settings_copyright_field', 'evolutionary', 'ev_settings_general_options' );          add_settings_field( 'ev_settings_colors_field', __( 'Theme Color', 'evolutionary' ), 'ev_settings_colors_field', 'evolutionary', 'ev_settings_general_options' );          /**      * Fields Callbacks      */     function ev_settings_copyright_field() {         $ev_options = get_option( 'theme_evolutionary_options' );         //var_dump( $ev_options );         ?>         <input name="theme_evolutionary_options[copyright]" type="text" class="regular-text" value="<?php esc_attr_e( $ev_options['copyright'] ); ?>"  />     <?php }     // Callback for colorscheme     function ev_settings_colors_field() {         $ev_options = get_option( 'theme_evolutionary_options' );         $color_schemes = ev_get_valid_color_schemes();              echo '<select name="theme_evolutionary_options[color_scheme]">';              foreach( $color_schemes as $value => $caption ) :     ?>             <option value="<?php echo $value; ?>" <?php selected( $value, $ev_options['color_scheme'] ); ?>><?php echo $caption; ?></option>          <?php          endforeach;              echo '</select>';     }          } // ev_register_options     add_action( 'admin_init', 'ev_register_options' );              /**      * Creating options page HTML output      */     function ev_admin_options_page() { ?>
            <?php if ( isset( $_GET['settings-updated'] ) ) {                     echo "

Theme settings updated successfully.

";             } ?>             <?php screen_icon(); ?>
<?php _e( 'Theme Options', 'evolutionary' ); ?>
             <form action="options.php" method="post">             <?php              settings_fields( 'theme_evolutionary_options' );             do_settings_sections( 'evolutionary' );             ?>                      <input name="submit" type="submit" class="button-primary" value="<?php _e( 'Save Settings', 'evolutionary' ) ?>" />                 <input name="reset" type="submit" class="button-secondary" value="<?php _e( 'Reset Settings', 'evolutionary' ) ?>" />             </form>
     <?php }          function ev_options_validate( $input ) {         $ev_options = get_option( 'theme_evolutionary_options' );         $valid_input = $ev_options;              $ev_options['color_scheme'] = array_key_exists( $ev_options['color_scheme'], ev_get_valid_color_schemes() ) ? $ev_options['color_scheme'] : 'blue';         $ev_options['copytright'] = wp_kses_data( $ev_options['copyright'] );              return $valid_input;     }


title: WordPress 3.1 Install Error

text: I'm trying to run a fresh install on my server with WP 3.1. Problem is I'm getting errors after setting up the config. (attached image) I've installed the previous versions of WP before and have had no trouble.               nction weblog_ping($server = '', $path = '') { global $wp_version; include_once(ABSPATH . WPINC . '/class-IXR.php'); include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php'); // using a timeout of 3 seconds should be enough to cover slow servers $client = new WP_HTTP_IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path)); $client->timeout = 3; $client->useragent .= ' -- WordPress/'.$wp_version; // when set to true, this outputs debug messages by itself $client->debug = false; $home = trailingslashit( home_url() ); if ( !$client->query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping $client->query('weblogUpdates.ping', get_option('blogname'), $home); } // // Cache // /** * Removes comment ID from the comment cache. * * @since 2.3.0 * @package WordPress * @subpackage Cache * * @param int|array $ids Comment ID or array of comment IDs to remove from cache */ function clean_comment_cache($ids) { foreach ( (array) $ids as $id ) wp_cache_delete($id, 'comment'); wp_cache_set('last_changed', time(), 'comment'); } /** * Updates the comment cache of given comments. * * Will add the comments in $comments to the cache. If comment ID already exists * in the comment cache then it will not be updated. The comment is added to the * cache using the comment group with the key using the ID of the comments. * * @since 2.3.0 * @package WordPress * @subpackage Cache * * @param array $comments Array of comment row objects */ function update_comment_cache($comments) { foreach ( (array) $comments as $comment ) wp_cache_add($comment->comment_ID, $comment, 'comment'); } // // Internal // /** * Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts. * * @access private * @since 2.7.0 * * @param object $posts Post data object. * @return object */ function _close_comments_for_old_posts( $posts ) { if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') ) return $posts; $days_old = (int) get_option('close_comments_days_old'); if ( !$days_old ) return $posts; if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) { $posts[0]->comment_status = 'closed'; $posts[0]->ping_status = 'closed'; } return $posts; } /** * Close comments on an old post. Hooked to comments_open and pings_open. * * @access private * @since 2.7.0 * * @param bool $open Comments open or closed * @param int $post_id Post ID * @return bool $open */ function _close_comments_for_old_post( $open, $post_id ) { if ( ! $open ) return $open; if ( !get_option('close_comments_for_old_posts') ) return $open; $days_old = (int) get_option('close_comments_days_old'); if ( !$days_old ) return $open; $post = get_post($post_id); if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) return false; return $open; } ?>       Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'sanitize_comment_cookies' was given in /nfs/c05/h01/mnt/71351/domains/kasildenim.com/html/test/dev/wp- includes/plugin.php on line 395 Warning: Cannot modify header information - headers already sent by (output started at /wp-includes/comment.php:9) in wp-admin/install.php on line 54


title: Custom post type category permalinks and archive pages

text: I know this question was brought up before, but I can't seem to get things working using any of the proposed solutions. This is how I have my custom post types and categories setup:               Custom Post Type: Buildings     -Buildings Categories:     --Medical     --Industrial     --Educational     --Recreational          -Buildings Regions (custom taxonomy):     --USA     ---Connecticut     ---New Jersey     ---New York     --Canada     ---Quebec     ---Ontario      Every Building will be assigned to 1 building category (Medical, Industrial, etc) and 1 building region (USA->New York, Canada->Ontario, etc). This all works fine, except the permalinks to inner building pages are site.com/buildings/postname and there is no category archive for the custom post type categories. Here is what I'm trying to achieve:   1. Permalinks to inner building pages to be example.com/buildings/category/postname   2. Permalink to archive of all building pages to be example.com/buildings   3. Permalinks to archives of each building category example.com/buildings/category   4. Lastly I want to be able to display an archive of buildings by region. So example.com/buildings/region/usa would bring up all the buildings in the USA, while example.com/buildings/region/canada/quebec would bring up only buildings in Quebec, Canada. I've tried numerous solutions, but the closest I was able to get was half of #1 working using the WP Permastructure plugin posted as an answer to this similar thread. I am able to get the permalinks for inner building pages to generate properly, but when accessed they return 404s. Any help is greatly appreciated!


title: Multiple taxonomies on same permalink rule

text: I have a few taxonomies and it would be nice to be able to sort by two at time with a permalink. For example, I have two taxonomies, design-show-year and designer-or-firm. I'd like to have this permalink to get a listing of all these that match: /design-show-year/2011/designer-or-firm/pete-klein/ Is this possible using the WordPress system by doing a rewrite and piping that into index.php, or can WordPress only handle one taxonomy at a time?