Change image size depending on page

I've got a simple photographic site and it uses large image sizes throughout. On the archive page, however, I've got about 35 posts each showing the first image of each. By default, the images being uploaded are around 600 pixels wide. However, on the archive page they need only be 150 pixels wide. **The problem: I don't need 600 pixel wide images on this heavily populated archive page.** I understand WordPress generates smaller images when they are uploaded to the media gallery. Is there a way I can use a smaller image that has been generated instead of the large, default image?


Trash a post, send associated comments into the trash bin (change status)

When trashing a post, all comments associated with this post get the status "post-trashed". They do not end up in the trash bin. In my theme the author gets a point for posting a post or a comment. Subsequently I also want to deduct a point when the posts or comments is trashed. Both of these functions works excellent. The problem arise when I trash a post. I want the associated comments to also be affected, and have one point reduced. This function: http://de.wpseek.com/wp_trash_post_comments/ seems to be the culprit. So I think the best solution is to either somehow force the "post_comments" to be sent into the actual trash bin, or somehow incorporate an action to the above function to also remove a point when trashing "post_comments". (it would be important that there is no conflict with trash_comment, so the action somehow doesn't get called twice, and reduces two point for one comment being trashed). Any ideas?


Change Title Type

I'd like to change the title field of a post in admin panel. I'd like this field was "textarea" instead of being "input type='text'". Would it be possible through any hook in functions.php? Thanks in advance!


WP Nav menu append to url

Using `wp_nav_menu()` , how can I append a value at end of each URL?   For example, I have the following url: `http://www.example.com/` but I have to append a language parameter at the end, so the url should be: `http://www.example.com/?lang=$language`


Using Add from Server to upload by post ID

I am using Add From Server plugin http://wordpress.org/extend/plugins/add- from-server/ basically it imports/upload image from the server. Currently the plugin copies the images into month/year folder format but I want to change it by making it copy by the Post ID folder format instead of month/year. I have already tried using the Custom Upload Dir plugin but it doesn't work with Add From Server plugin together. Can anyone tweak Add From Server plugin to make it upload by Post ID?


Automatically add a tag according to custom metadata

I'm trying to figure out how to make a function to automatically add a "featured" tag to a post, based on a checkbox in a metabox I've added to the edit screen. I think the function I need to use is wp_set_object_terms, but I don't get how it works. I know how to check if those checkboxes are active or not, but that´s all. I hope someone can put me on the right track with this.


Removing the "Your backup folder MIGHT be visible to the public" Message Generated by the WP-DBManager Plugin

I upgraded a client's WordPress from 2.8 to 3.0.1 and after upgrading I am now receiving this message in the dashboard: > Your backup folder MIGHT be visible to the public > > To correct this issue, move the .htaccess file from wp-content/plugins/wp- > dbmanager to /home/usearname/public_html/wp-content/backup-db My client's WordPress in installed in the `/wordpress/` sub-directory, i.e.: > `http://domain-name.com/wordpress/` This was provided by the plugin to resolve the problem (the filename is `wp- content/plugins/wp-dbmanager/htaccess.txt`):               <Files ~ ".*\..*">     order allow,deny     deny from all     </Files>      I downloaded this file on my PC then re-uploaded to the server at: > `/home/usearname/public_html/wp-content/backup-db/` but warning message is still showing in the dashbord. How do I solve this problem?


Query a WordPress page by its title (which has a parent page)

I have created a wordpress query which takes the entire content from 1 particular page using the its title So far i have the following:               <?php     query_posts('pagename=features');     if (have_posts()) :     while (have_posts()) : the_post();?>
<?php the_title(); ?>
     <?php the_content(); ?>     <?php endwhile; ?>     <?php else : ?>
No Section available

<?php _e("No Section available"); ?>
     <?php endif;     //Reset Query     wp_reset_query();     ?>      The main issue is that there is numerous pages which care called 'features' but they all have different parents. Is it possible to do this via parent somehow? For example, here is my hierarchical page structure: products > designgo silver > features products > designgo silver > screenshots products > designgo silver > benefits products > designgo gold > features products > designgo gold > screenshots products > designgo gold > benefits products > designgo platinum > features products > designgo platinum > screenshots products > designgo platinum > benefits If i could do something like:               <?php     query_posts('pagename=features&parent=designgosilver');     if (have_posts()) :     while (have_posts()) : the_post();?>      that would be perfect, can anyone give us a pointer? Cheers!


How to avoid directory name collisions with root Wordpress install

I need to know how I can keep the end-user of a wordpress site installed in the root directory from creating slugs that will interfere with sub- directories that are already present. I've Googled everywhere, but the best I can find are some very general instructions that only help people who already know how to configure Apache- and I don't know enough to get it to do what I want. I want to know how to do both these things: A) Configure the `.htaccess` file to not redirect certain specific paths, e.g. `http://example.com/samename` should go to the directory, not be redirected to a Wordpress page with the slug `samename`, even if it exists. B) To avoid end-user confusion, disallow the creation of slugs with specific names, e.g. `samename` using the API. If someone could tell me how to do **both** , I think it will be very useful to a lot of people down the line.


saving meta/custom field to tag

In my custom post type what I am trying to do is say I have select drop down option called party_ad. The value of the options are obtained via an RSS feed.               echo '<select name="ad_Tags" id="ad_Tags">';       foreach ($rs['items'] as $item)       {        echo '<option value="'.$item[title].'" '. selected( $adTags, $item[title]).'>'.$item[title].'</option>';       }       echo '</select>';      I can save these data with no problems - however, what I want to be able to save the selected option as a tag to the custom post. I thought about doing it front end, ie if an option is selected then it adds the value to the post tag box, ideally though, I'd like to really do this server side.


How much should I worry about these messages?

I received about 50 messages today with the similar message: > WordPress Firewall has detected and blocked a potential attack! > > Web Page: > domain.com/index.php?option=com_simpledownload&controller=../../../../../../../../../../../../../../../proc/self/environ%00 > Warning: URL may contain dangerous content! Offending IP: 211.147.221.42 [ > Get IP location ] Offending Parameter: controller = > ../../../../../../../../../../../../../../../proc/self/environ > > This may be a "Directory Traversal Attack." How much should I worry about these? It came from multiple IP addresses throughout the day.


Can´t access non-wordpress subdirectories as wordpress overrides them with a 404 error

Hi everybody at the forum, I am new here and this is my first question. I have beed reading this thread, the very first answer by Elpie (Cannot access non- wordpress subdirectories as wordpress overrides them with a 404 error) worked for me for the original problem. But now a new one has emerged. This rule RewriteRule ^.*$ - [L] makes the permalinks stop working (http://www.olinala.com/localizacion/). If I change permalinks to default mode (http://www.olinala.com/?p=123) everything work find but I need "pretty links". Any advice? Any help? Sorry about my english and thans in advance.


Total Word Count For Posts By One Author

How can I get a total word count of one author's posts? I would like to be able to see what the total word count of their output is, summed across all of their posts (ideally with a breakdown by category/tag/page-or-post). There's gotta be a contemporary plugin for this.


Where the WordPress Core Translation is "actually" taking place?

I'm a WordPress Core Bengali translator, currently translating and/or fixing existing translations of WordPress 3.8x Bengali in Translate.WordPress.org. Suddenly, yesterday I got an update notification in all my `WPLANG` '`bn_BD`' sites that, a new version of WordPress Bengali for WordPress 3.9 has come, so update your system. After the update I found a bluff update, because all the previous strings those were translated, got untranslated strings now. So, it's a bogus translation at all. As a Core translator, I jumped to the translate.wordpress.org's WordPress Projects, but found no such 3.9x translation project there. I wonder, **from Where** the official language release just happened, (as v3.9 is NOT a Dev. version now, it's a released one) if there's no such project's running!?


SQL - Remove All The Users and Create A New User With Admin Role Via PhpMyAdmin

It is very easy to remove all the users and add a new user with administrative role via wp admin panel. But the requirement is to achieve this through SQL. I can trunc `wp_users` and `wp_usermeta` table to remove all the users. But when I add an entry in `wp_users` with dummy data and then login through wp admin then it says incorrect login. Why? I shall be very thankful to you if you can tell me the proper way of removing all the users and adding a user with admin role.


Is there any reason why there's no "login_header" action at the login page?

There is a `login_footer` action hook at the `wp-login.php` of Wordpress which is quite handy for strapping in the theme footer into the login/registration page:               add_action( 'login_footer', function() {         get_footer();     });      Is there a reason why there is no similar action for header?


Custom post with custom category and custom meta box query and order by custom_value

Im building a Library CPT= Libro Custom Taxonomy= categoria_libro (as category) Custom meta box which has: autor editorial ciudad año As it says in the title, I need to query a custom post type, which has a custom taxonomy category, and a custom meta box. i cant figure out how to order the posts by meta_value where the meta_key=autor as my query is in the taxonomy My query:                  <?php     //for a given post type, return all     $post_type =   array(     'post_type' => 'Libro',       'meta_key'       => 'autor',          'orderby' => 'post_value',           'order' => 'DESC'      );     $tax = 'categoria_libro';     $tax_terms = get_terms($tax);               if ($tax_terms) {       foreach ($tax_terms  as $tax_term) {         $args=array(           'post_type' => $post_type,           "$tax" => $tax_term->slug,           'post_status' => 'publish',           'posts_per_page' => -1,           'caller_get_posts'=> 1,           );              $my_query = null;         $my_query = new WP_Query($args);              if( $my_query->have_posts() ) {             echo '

 '. $tax_term->name. '

';                               while ($my_query->have_posts()) : $my_query->the_post();                 ?>             <?php                  $custom = get_post_custom($post->ID);                  $autor = $custom["autor"][0];                  $editorial = $custom["editorial"][0];                  $ciudad = $custom["ciudad"][0];                  $anio = $custom["anio"][0];                     ?>
<a href="<?php the_permalink() ?>"  rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>.  <?=$autor?>.  <?=$editorial?>. <?=$ciudad?>.  <?=$anio?>
                            <?php endwhile;?>

         <?php }         wp_reset_query();       }     }     ?>      Everything is right.... I have a List showing the Category each post belogns to and a list inside the category of each post. what I cant get to work properly is the order by meta_key =autor and order this alphabetically. Thanks in advanced for your help


File format of post image attachment

I'm working on a website that can display 3D molecules (.mol) using the JavaScript-based viewer from JSmol (http://sourceforge.net/projects/jsmol/). With the "Upload File Type Settings" plug-in files with .mol extension can be uploaded as "Featured Image". I managed to customize my single.php template with the JSmol script to display the .mol files. Now I'd like to determine in the template if the featured image attachment of the post is an .mol (for displaying the 3D file via the script) or an image file format (JPG, PNG.. to display with the_post_thumbnail), such as:               <?php if ("the attachment has a .mol extension?") {     echo "<script>Jmol.getTMApplet('jmol', Info)</script>";     } else if {     the_post_thumbnail();     } ?>      How can I find out which file format is used in the featured image attachment of the post?


How to make my search result searched by post title and content and also categories only?

I would like to ask a question. Is there any solution to make my wp search result searched only by post title and categories? If this is a duplicate question, please refer me to the page where i can get the answer. Thank you!


Are there any reasons you can't use strings for admin menu positions?

When interacting with the admin menu, for instance via `add_menu_page`, there is a `$position` parameter. The inline docs indicate that this should be an integer. The Codex agrees, but adds a note that you can use a float if you make it a string (e.g. `'63.3'`). In wp-admin/includes/menu.php the array is sorted by comparing the keys with `strnatcasecmp`. With this in mind, one could set a menu position of `'63-foo'` or `'63-bar'` to avoid position conflicts. This would be especially helpful for plugins, where they currently may set a position which can cause conflicts in some themes or with other plugins. Using strings appears to work just fine. I combed the source and didn't find any issues, but maybe I've missed something. **Are there any reasons why a string can't or shouldn't be used for the menu position?**


Filter In Reply comments from Wordpress Admin Panel

Is there any way to filter the comments that are In Reply from the comments list? I basically just want to see the depth 1 comments on a separate filter. @GhostToast Ive added this to create a new filter 'Ask' on the Admin Comments Panel. is there a way to just apply your top level comments filter code to this Ask filter? That would be really good because the All comments filter still works and the Ask is filtered by showing only the top level ones...               add_action( 'current_screen', 'wpse_72210_comments_exclude_lazy_hook', 10, 2 );          /**      * Delay hooking our clauses filter to ensure it's only applied when needed.      */     function wpse_72210_comments_exclude_lazy_hook( $screen )     {         if ( $screen->id != 'edit-comments' )             return;              // Check if our Query Var is defined             if( isset( $_GET['ask'] ) )             add_action( 'pre_get_comments', 'wpse_63422_list_comments_from_specific_post', 10, 1 );              add_filter( 'comment_status_links', 'wpse_63422_new_comments_page_link' );     }          /**      * Only display comments of specific post_id      */      function wpse_63422_list_comments_from_specific_post( $clauses )     {         $clauses->query_vars['post_id'] = 12;     }          /**      * Add link to specific post comments with counter      */     function wpse_63422_new_comments_page_link( $status_links )     {         $count = get_comments( 'post_id=12&count;=1' );              if( isset( $_GET['ask'] ) )          {             $status_links['all'] = 'All';             $status_links['ask'] = 'Ask ('.$count.')';         }          else          {             $status_links['ask'] = 'Ask ('.$count.')';         }              return $status_links;     }


trash_post action with Custom Post Type

I have a Custom Post Type "empresa" and would like to send email when a post type is deleted (moved to trash). I have this function below for my POSTS, How can I use with my Post Type "empresa"?               add_action("trash_post", "my_awesome_publication_notification");     function my_awesome_publication_notification($post_id) {     $post = get_post($post_id);     $author = get_userdata($post->post_author);          $author_email = get_post_meta( $post->ID , 'empresa_contato_email' , true );     $email_subject = "A Sua Empresa foi aprovada!";          ob_start();          include("email_header.php");          ?>
         Hi, <?php echo $author->display_name ?>. I've just published one of your articles         (<?php echo $post->post_title ?>) on MyAwesomeWebsite!

         If you'd like to take a look, <a href="<?php echo get_permalink($post->ID) ?>">click here.         I would appreciate it if you could come back now and again to respond to some comments.
          <?php          include("email_footer.php");          $message = ob_get_contents();          ob_end_clean();          wp_mail($author_email, $email_subject, $message);      }


Multiple Categories on Catlist using name function

Hi there I am hoping that someone can help me with the "plugin-list-category- post" plugin. I am using this shortcode in a post to activate the plugin               [catlist name='Audi' name='Cadillac' template='category-display-template' excerpt='yes' thumbnail='yes' numberposts='2']      In the result it shows me two listings of 'cadillac' but it ignores the audi name tag... Is it possible to do it this way? or do I absolutely need to use the category id tag, for multiple posts? - Thanks


How to remove filter apostrophe and single quotation

My wp version is `3.2.1` In wordpress, the `apostrophe/single quotation` will transfer to `&#039`; And I'd better need to transfer to `%27`; I tried to edit `formatting.php`, in line: `$string = str_replace( "'", ''', $string );` and `$url = str_replace( "'", ''', $url );`, but no effect. So how to do it? Or if it is possible, I think add some `remove_filter function` in `theme's funciton.php` is more better. ( **Note** : only transfer `apostrophe/single quotation`, but keep other quotation formatting.) **BTW** : if I do this change, is it safe for my wordpress? this is also I care about. Thanks.


Set class on thumbnail images in plugin list category post

I am hoping that someone can help me - How can I set the Class on the Thumbnail images? I have looked here: In the catList.php file                $lcp_thumbnail = 'ID).'">' . get_the_post_thumbnail($single->ID, $this->params['thumbnail_size']) . '';      The default class on the thumbnail looks like this - `class="attachment- thumbnail wp-post-image"` It would be great to set the class on the thumbnail image, via the shortcode. Thanks


NextGen Gallery different thumbnail size per gallery

How can I instruct NextGen Gallery to use different thumbnail sizes for different galleries. I have different gallery templates for use in different parts of the site, and the sizes of the thumbnails are not the same. At the moment I have to stay generating the thumbnails through the gallery management page, it would be much better if I could set the thumbnail size for each gallery once and for all. Thanks.


Getting images to show up in RSS Reader

I'm trying to get posts' featured images to show up in RSS Reader. When I look at the raw RSS XML I can see the images are successfully being written into `<description>` and also under `<post-thumbnail>` (via a function I found on a thread here) but I don't see the images showing along with the excerpt in Google Reader, for example. I'm using the following function / filters:               function insertThumbnailRSS($content) {         global $post;         if(has_post_thumbnail($post->ID)){             $content = ''.get_the_post_thumbnail($post->ID, 'thumbnail', array('alt' => get_the_title(), 'title' => get_the_title(), 'style' => 'float:left;')).''.$content;         }         return $content;     }     add_filter('the_excerpt_rss', 'insertThumbnailRSS');     add_filter('the_content_feed', 'insertThumbnailRSS');          add_action('rss2_item', function(){       global $post;            $output = '';       $thumbnail_ID = get_post_thumbnail_id( $post->ID );       $thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'thumbnail');       $output .= '<post-thumbnail>';         $output .= '<url>'. $thumbnail[0] .'</url>';         $output .= '<width>'. $thumbnail[1] .'</width>';         $output .= '<height>'. $thumbnail[2] .'</height>';         $output .= '</post-thumbnail>';            echo $output;     });


Remove permalink settings in post for users

I'm use the following code to remove the permalink settings in a post. This work until the user presses on publish button. Then the permalink settings reappear.               add_action('admin_head', 'wpds_custom_admin_post_css');     function wpds_custom_admin_post_css() {              global $post_type;              if ($post_type == 'post_type') {             echo "<style>#edit-slug-box {display:none;}</style>";         }     }


Logout link not working

My logout link is not logging me out. May be I am missing something. I tried the below links which is generated by `wp_logout_url(site_url())`. But still I am logged in. > `http://192.168.123.2/mysite/wp- > login.php?action=logout&redirect_to=http%3A%2F%2F192.168.123.2%2Fmysite&_wpnonce=24f1683005` What can be wrong? **More info :** Logout link is in custom menu. I check whether if the user is logged out or logged in by using the function `is_user_logged_in()` from within the `function.php` file.


How can i limit wordpress post title characters in sidebar?

in wordpress template sidebar and recent posts or recent comments blocks: when title has more than 30 characters new line created and its not good display you can see this image for understand what i say: ![](http://i.stack.imgur.com/I1ydI.png) style for side bar ul li is :               #body-right ul li a {       background: url("../images/blog-point1.png") no-repeat scroll 8px center rgba(0, 0, 0, 0);       color: #45484A;       display: block;       font: 13px/28px 'OpenSansRegular',Arial,sans-serif;       padding-left: 22px;       text-decoration: none;     }          sidebar style:     #body-right ul li {       background: url("../images/blog-body-right-line.png") no-repeat scroll center bottom rgba(0, 0, 0, 0);       direction: rtl;       height: 28px;       line-height: 28px;       list-style: none outside none;       text-align: right;     }      So how can i solve this problem?


Making Site A Use Site B's wp-content Folder

I'm trying to synchronize two WordPress sites and on my way I've faced few challenges. One of the challenges is to either synchronize the wp-content folder of two sites or make one site use the wp-content of other site for ADDING and RETRIEVING multimedia content. Normally a Wordpress site uses its own wp-content folder but how can we customize the WordPress so that it uses other site's wp-content folder. Visuallization:- ![enter image description here](http://i.stack.imgur.com/KEf4w.png) **Constraints:-**   1. Site A and Site B are on different shared web hostings. Each having its own Cpanel.


Page template no longer exists - metaboxes won't save

Ok, this is a weird one. I first experienced this on an older theme that I developed - I assumed I had some buggy code in there somewhere, but couldn't figure it out even with the help of another couple developers. Now I have a new theme, super lightweight - no buggy code, and it's happening again. Here's the issue:   1. User has a theme installed with a custom page template - they save their page with this page template.   2. User switches themes, and the page template no longer exists - the "Page Template" option is no longer visible, as the new theme has no page templates.   3. When a user tries to save a options inside of a metabox (any metabox), the option simply reverts back to where it was before saving. When the user creates a new, fresh page - the metabox saves just fine - no issues. This only comes up when a page is looking for a page template that was installed that's no longer there. I assume WordPress would have some sort of check in the core to see if the page template no longer exists - so what's going on? In my old theme, I ended up using this code:               add_action('admin_init','pro_update_page_template_issue');     function pro_update_page_template_issue()     {         global $post;              if ( get_option('pro_updated_page_templates') == 'true' )             return;              add_option('pro_updated_page_templates','true');              $args = array(             'post_status' => 'publish',             'posts_per_page' => -1,             'post_type' => 'page'         );         $posts = get_posts($args);         foreach ( $posts as $post ) {             $page_template = $post->page_template;             if( !locate_template($page_template) ) :                 update_post_meta($post->ID, '_wp_page_template', 'default');             endif;         }     }      This works, but I would rather find the cause of this issue in my new theme. Is this only happening to me? Can anyone else replicate the issue? Thanks!


Link category archive from category archive template

All my posts belong to categories. There're at least 30 categories and sub- categories with 10 or more posts per category. When opening               http://example.com/category/subcategory       only the latest 3 posts are displayed which is fine. Now I'd like to create a link to a site (`http://example.com/library/category/subcategory` or `http://example.com/category/subcategory/library`) displaying ALL posts of this category. It's not for grouping by year and / or month, just for displaying all posts with a custom template sorted e.g. by date. I searched a lot but did not find a tutorial which fits my needs. Can anybody help me how to do this? I'm using this plugin to assign custom templates to my categories. Let's say I'm using template A for all categories and template B for all sub-categories. To clarify my target: I'm searching for a way to force wordpress to use a template C in order to display ALL posts of a certain category/sub-category. I'd like to insert a link at the bottom of template A and B "Show all posts of this category".


register_activation_hook on multisite

I am working on creating a plugin for a multisite wordpress framework that is enabled by default for all (by me, the _super administrator_ ) When it activates it is required to create 2 tables where it will store some precedural information. Right now I am working on creating the first (most important) table. The p_install function is called because of the options I set at the end of the function.               global $wpdb;     global $p_db_version;     $table_name = $wpdb->prefix . 'p_table';     $wpdb->p_table = $wpdb->prefix . 'p_table';     $charset_collate = '';     if (!empty($wpdb->charset)) {         $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";     }     if (!empty($wpdb->collate)) {         $charset_collate .= " COLLATE {$wpdb->collate}";     }                              $sql = "CREATE TABLE {$table_name} (       id mediumint(9) NOT NULL AUTO_INCREMENT,       blog_id mediumint(9) NOT NULL,       create_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,       modify_date datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,       created_by mediumint(9) NOT NULL,       modified_by mediumint(9) NOT NULL,       is_active tinyint(1) DEFAULT 0 NOT NULL,       p tinytext DEFAULT '' NOT NULL,       v mediumint(9) DEFAULT 0 NOT NULL,       c mediumint(9) DEFAULT 0 NOT NULL,       json_data text NOT NULL,       type mediumint(9) DEFAULT 0 NOT NULL,       UNIQUE KEY  id (id)     ) {$charset_collate};";                              require_once(ABSPATH . 'wp-admin/includes/upgrade.php');     dbDelta($sql);                              delete_option('p_db_version');     delete_option('p_db_sql');     delete_option('p_db_timestamp');                              add_option('p_db_version', $p_db_version);     add_option('p_db_sql', $sql);     add_option('p_db_timestamp', date('l jS \of F Y h:i:s A'));      ` But it fails to create the table. Please advise. **Edit 1** After reading PatJ's answer I feel the need to clean up some air:   1. I got my table creation code from the `dbDelta()` documentation   2. I have edited my code and used the **two space** policy # Answer And the answer is that a `datetime` cant have the `CURRENT_TIMESTAMP` default value since **MySQL 5.6.5** so I changed `modify_date` from `datetime` to `timestamp` and all is good. Credits to: sebthebert Thank you.


WP Query outputs three items within a div

At present I have a basic query that outputs 12 custom posts, each in a div. I need to restructure this to output four divs, each with three of these items inside. So it's sort of like a nested div. To explain, here is the current HTML output (for 12 items)
the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here
      What I need is something more like this:

the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here

      Here is my current query:               <?php          query_posts(array(                      'post_type' => 'custom_job',                     'showposts' => 12                  ) );               ?>             <?php while (have_posts()) : the_post(); ?>

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

<?php echo get_the_excerpt(); ?>

             <?php endwhile;?>


Wordpress gallery shortcode - include author's images

I'm using the built-in wordpress gallery shortcode to display all images of a category -- documentation found here: Wordpress Gallery Shortcode Codex \--- By using [gallery category="1"] How could I add a filter to only show the images/media the current user has uploaded in the gallery's category? (I have a plugin that allows separating my media library into categories) I have added this code to my function.php which successfully filters the images to only the current user's uploaded images in the backend, but does not work with the gallery shortcode on the front end of a post. functions.php code:               function my_files_only( $wp_query ) {         if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/upload.php' ) !== false ) {             if ( !current_user_can( 'level_5' ) ) {                 global $current_user;                 $wp_query->set( 'author', $current_user->id );             }         }     }     add_filter('parse_query', 'my_files_only' );      So I'm looking for something like [gallery category="1" author="%currentuser%"] the wordpress gallery shortcode is listed here: (I choose not to post the code as it is quite large) media.php If this is feature (current user) is not built into the code, how could I add it to this existing code? I'm also open to any plugins that would do the trick, most that I have tried that claim to do the functionality I am wanting have not worked. I would love if this worked with nextgen gallery, but doesn't appear to be in the cards. Thanks!


Get image paths from RSS feeds

I'm displaying the content from one wordpress blog page on my server onto a different wordpress blog on the same server. Apparently the only way is through RSS feed. The images don't show up. I var_dumped the RSS object and there are no image paths. How do I get the image paths, or the filename of the image? Or how do I force the source blog to include the image information in the feed.


Remove Multisite

This is a site I'm working on, but did not build. It is on a multisite network- but I would like to get it back to normal. There are no other sites on the network. All of the instructions tell me to remove lines from wp-config and edit htaccess, but I have no htaccess file, and my wp-config does not contain the "Include Multisite" line that all the instructions tell me to remove. Here is my entire wp-config file (with passwords changed): (Edited; please post only the relevant parts of files, and also use the code button.)


Manipulated shortcode output

I have a problem with a plugin I developed that registers a shortcode. The shortcode returns a string with valid HTML but some themes seems to manipulate the HTML returned by the shortcode, and I really can't understand what is the reason. For example, this is the correct output of my shortcode:

Kate

      and this is the output I get with some theme:

Kate

      As you can see there is some extra tag after the closing of the 'caption' DIV. Maybe these themes apply some kind of HTML validation/sanitization?


How to increase image size returned from Flickr oEmbed in Twenty Twelve theme

I've been using the excellent Flickr Gallery plugin for a while but while upgrading a site to WP3.5 and the Twenty Twelve theme, I stumbled across oEmbeds and notice that Flickr is supported natively. I did a quick test and sure enough, simply placing the URL to a Flickr image page produces an image in the post – but it's a tiny 320 pixels wide. Given the content space appears to be about 625 pixels wide, it would be much better to have the 500 pixel image returned. I've found mention of the max width setting, which it now appears is not present in the WP3.5 admin interface. The only reason I was considering switching to the native capability was to remove customisation (the plugin I have is dead easy to use). Do I have to create a child theme simply to set this width? Or am I missing something? Any tips appreciated.


Wordpress Setting page can not be saved by html radio

I have this php Code to make a option page that activate a function if the user set "active" and turn off the function, if the user set "Not active".               <?php     add_action('admin_menu', 'custom');     function custom() {     add_menu_page('settings', 'settings', '8', 'custom', 'customfunc');     }     function customfunc(){     $wpp_rg = get_option('wpp_rg');     if ($_POST['submit']):     update_option('wpp_rg',$_POST['wpp_rg']);     endif;     ?>
     <form action="" method="post">

             test mode :
                                   <input name="wpp_rg" type="radio" value="1" id="RadioGroup1_0" <?php echo ($wpp_rg==1 ? 'checked="checked"' : '') ?> />                     active
                                   <input name="wpp_rg" type="radio" value="2" id="RadioGroup1_1" <?php echo ($wpp_rg==2 ? 'checked="checked"' : '') ?>/>                     not active

             	             <input type="submit" name="wpp_submit" value="save" class="button" />

     </form>
     <?php     }          $wpp_rg = get_option('wpp_rg');                    /******************** IF1 ***********************/          if ($wpp_rg==1) {          echo "Active";                    }     if ($wpp_rg==2) {          echo "Not Active";          }     /******************** IF1 ***********************/               ?>      But the problem is that, the html radios are not working ! when i click "not active " and save, nothing happen ! What is the problem ? ?


Single page template for custom post_type

I registered a custom post type with the following code:               #Register custom post type for Stars of the Month     add_action( 'init', 'sdp_create_star_type' );     function sdp_create_star_type() {              register_post_type( 'sdp_star',             array(                 'labels' => array(                     'name' => __( 'Stars' ),                     'singular_name' => __( 'Star' ),                     'add_new_item' => 'Add New Star of the Month',                     'edit_item' => 'Edit this Star',                     'all_items' => 'All Stars'                 ),             'public' => true,             'has_archive' => true,             'rewrite' => array('slug' => 'stars'),             'menu_icon' => 'dashicons-star-filled',             'menu_position' => 5, //just below posts             'supports' => array('title', 'thumbnail')             )         );         //flush_rewrite_rules(); //<--This doesn't work either     }      I named the template `my_theme/single-sdp_star.php` as per the WP naming conventions. PROBLEM: No matter what I do, the wrong template file gets used: `my_theme/single.php`. I already tried re-saved the permalinks (many times) and this does not help. What else could be I be missing?


Adding a Taxonomy Filter to Admin List for a Custom Post Type?

I have created a Custom Post Type called `'listing'` and added a Custom Taxonomy called `'businesses'`. I would like to add a dropdown list of Businesses to the admin list for the Listings. Here is what this functionality looks like in admin list for Posts _(I would like the same for my Custom Post Type):_ ![Categories Dropdown in Posts](http://i.stack.imgur.com/XBYZX.png) Here is my current code _(And here is the same code on Gist.):_               <?php     /*     Plugin Name: Listing Content Item     Plugin URI:     Description:      Author:      Version: 1.0     Author URI:      */          class Listing {       var $meta_fields = array("list-address1","list-address2","list-country","list-province","list-city","list-postcode","list-firstname","list-lastname","list-website","list-mobile","list-phone","list-fax","list-email", "list-profile", "list-distributionrange", "list-distributionarea");            public function loadStyleScripts() {         $eventsURL = trailingslashit( WP_PLUGIN_URL ) . trailingslashit( plugin_basename( dirname( __FILE__ ) ) ) . 'css/';         wp_enqueue_style('listing-style', $eventsURL.'listing.css');       }            function Listing() {         // Register custom post types         register_post_type('listing', array(           'labels' => array(             'name' => __('Listings'), 'singular_name' => __( 'Listing' ),             'add_new' => __( 'Add Listing' ),             'add_new_item' => __( 'Add New Listing' ),             'edit' => __( 'Edit' ),             'edit_item' => __( 'Edit Listing' ),             'new_item' => __( 'New Listing' ),             'view' => __( 'View Listing' ),             'view_item' => __( 'View Listing' ),             'search_items' => __( 'Search Listings' ),             'not_found' => __( 'No listings found' ),             'not_found_in_trash' => __( 'No listings found in Trash' ),             'parent' => __( 'Parent Listing' ),           ),           'singular_label' => __('Listing'),           'public' => true,           'show_ui' => true, // UI in admin panel           '_builtin' => false, // It's a custom post type, not built in           '_edit_link' => 'post.php?post=%d',           'capability_type' => 'post',           'hierarchical' => false,           'rewrite' => array("slug" => "listings"), // Permalinks           'query_var' => "listings", // This goes to the WP_Query schema           'supports' => array('title','editor')         ));              add_filter("manage_edit-listing_columns", array(&$this, "edit_columns"));         add_action("manage_posts_custom_column", array(&$this, "custom_columns"));              // Register custom taxonomy              #Businesses         register_taxonomy("businesses", array("listing"), array(           "hierarchical" => true,            "label" => "Listing Categories",            "singular_label" => "Listing Categorie",            "rewrite" => true,         ));              # Region         register_taxonomy("regions", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Regions' ),             'popular_items' => __( 'Popular Regions' ),             'all_items' => __( 'All Regions' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Region' ),              'update_item' => __( 'Update Region' ),             'add_new_item' => __( 'Add New Region' ),             'new_item_name' => __( 'New Region Name' ),             'separate_items_with_commas' => __( 'Separate regions with commas' ),             'add_or_remove_items' => __( 'Add or remove regions' ),             'choose_from_most_used' => __( 'Choose from the most used regions' ),           ),           "hierarchical" => false,            "label" => "Listing Regions",            "singular_label" => "Listing Region",            "rewrite" => true,         ));              # Member Organizations         register_taxonomy("organizations", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Member Organizations' ),             'popular_items' => __( 'Popular Member Organizations' ),             'all_items' => __( 'All Member Organizations' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Member Organization' ),              'update_item' => __( 'Update Member Organization' ),             'add_new_item' => __( 'Add New Member Organization' ),             'new_item_name' => __( 'New Member Organization Name' ),             'separate_items_with_commas' => __( 'Separate member organizations with commas' ),             'add_or_remove_items' => __( 'Add or remove member organizations' ),             'choose_from_most_used' => __( 'Choose from the most used member organizations' ),           ),           "hierarchical" => false,            "label" => "Member Organizations",            "singular_label" => "Member Organization",            "rewrite" => true,         ));              # Retail Products         register_taxonomy("retails", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Retail Products' ),             'popular_items' => __( 'Popular Retail Products' ),             'all_items' => __( 'All Retail Products' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Retail Product' ),              'update_item' => __( 'Update Retail Product' ),             'add_new_item' => __( 'Add New Retail Product' ),             'new_item_name' => __( 'New Retail Product Name' ),             'separate_items_with_commas' => __( 'Separate retail products with commas' ),             'add_or_remove_items' => __( 'Add or remove retail products' ),             'choose_from_most_used' => __( 'Choose from the most used retail products' ),           ),           "hierarchical" => false,            "label" => "Retail Products",            "singular_label" => "Retail Product",            "rewrite" => true,         ));              # Farming Practices         register_taxonomy("practices", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Farming Practices' ),             'popular_items' => __( 'Popular Farming Practices' ),             'all_items' => __( 'All Farming Practices' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Farming Practice' ),              'update_item' => __( 'Update Farming Practice' ),             'add_new_item' => __( 'Add New Farming Practice' ),             'new_item_name' => __( 'New Farming Practice Name' ),             'separate_items_with_commas' => __( 'Separate farming practices with commas' ),             'add_or_remove_items' => __( 'Add or remove farming practices' ),             'choose_from_most_used' => __( 'Choose from the most used farming practices' ),           ),           "hierarchical" => false,            "label" => "Farming Practices",            "singular_label" => "Farming Practice",            "rewrite" => true,          ));              # Products          register_taxonomy("products", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Products' ),             'popular_items' => __( 'Popular Products' ),             'all_items' => __( 'All Products' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Product' ),              'update_item' => __( 'Update Product' ),             'add_new_item' => __( 'Add New Product' ),             'new_item_name' => __( 'New Product Name' ),             'separate_items_with_commas' => __( 'Separate products with commas' ),             'add_or_remove_items' => __( 'Add or remove products' ),             'choose_from_most_used' => __( 'Choose from the most used products' ),           ),           "hierarchical" => false,            "label" => "Products",            "singular_label" => "Product",            "rewrite" => true,         ));                   // Admin interface init         add_action("admin_init", array(&$this, "admin_init"));         add_action("template_redirect", array(&$this, 'template_redirect'));              // Insert post hook         add_action("wp_insert_post", array(&$this, "wp_insert_post"), 10, 2);       }            function edit_columns($columns) {         $columns = array(           "cb" => "<input type=\"checkbox\" />",           "title" => "Business Name",           "description" => "Description",           "list-personal" => "Personal Information",           "list-location" => "Location",           "list-categorie" => "Categorie",         );              return $columns;       }            function custom_columns($column) {         global $post;         switch ($column) {           case "description":             the_excerpt();             break;           case "list-personal":             $custom = get_post_custom();             if(isset($custom["list-firstname"][0])) echo $custom["list-firstname"][0]."
";             if(isset($custom["list-lastname"][0])) echo $custom["list-lastname"][0]."
";             if(isset($custom["list-email"][0])) echo $custom["list-email"][0]."
";             if(isset($custom["list-website"][0])) echo $custom["list-website"][0]."
";             if(isset($custom["list-phone"][0])) echo $custom["list-phone"][0]."
";             if(isset($custom["list-mobile"][0])) echo $custom["list-mobile"][0]."
";             if(isset($custom["list-fax"][0])) echo $custom["list-fax"][0];             break;           case "list-location":             $custom = get_post_custom();             if(isset($custom["list-address1"][0])) echo $custom["list-address1"][0]."
";             if(isset($custom["list-address2"][0])) echo $custom["list-address2"][0]."
";             if(isset($custom["list-city"][0])) echo $custom["list-city"][0]."
";             if(isset($custom["list-province"][0])) echo $custom["list-province"][0]."
";             if(isset($custom["list-postcode"][0])) echo $custom["list-postcode"][0]."
";             if(isset($custom["list-country"][0])) echo $custom["list-country"][0]."
";             if(isset($custom["list-profile"][0])) echo $custom["list-profile"][0]."
";             if(isset($custom["list-distributionrange"][0])) echo $custom["list-distributionrange"][0]."
";             if(isset($custom["list-distributionarea"][0])) echo $custom["list-distributionarea"][0];             break;           case "list-categorie":             $speakers = get_the_terms(0, "businesses");             $speakers_html = array();             if(is_array($speakers)) {               foreach ($speakers as $speaker)               array_push($speakers_html, 'slug, 'businesses') . '">' . $speaker->name . '');               echo implode($speakers_html, ", ");             }             break;         }       }            // Template selection       function template_redirect() {         global $wp;         if (isset($wp->query_vars["post_type"]) && ($wp->query_vars["post_type"] == "listing")) {           include(STYLESHEETPATH . "/listing.php");           die();         }       }            // When a post is inserted or updated       function wp_insert_post($post_id, $post = null) {         if ($post->post_type == "listing") {           // Loop through the POST data           foreach ($this->meta_fields as $key) {             $value = @$_POST[$key];             if (empty($value)) {               delete_post_meta($post_id, $key);               continue;             }                  // If value is a string it should be unique             if (!is_array($value)) {               // Update meta               if (!update_post_meta($post_id, $key, $value)) {                 // Or add the meta data                 add_post_meta($post_id, $key, $value);               }             }             else             {               // If passed along is an array, we should remove all previous data               delete_post_meta($post_id, $key);                    // Loop through the array adding new values to the post meta as different entries with the same name               foreach ($value as $entry)                 add_post_meta($post_id, $key, $entry);             }           }         }       }            function admin_init() {         // Custom meta boxes for the edit listing screen         add_meta_box("list-pers-meta", "Personal Information", array(&$this, "meta_personal"), "listing", "normal", "low");         add_meta_box("list-meta", "Location", array(&$this, "meta_location"), "listing", "normal", "low");       }            function meta_personal() {         global $post;         $custom = get_post_custom($post->ID);         if(isset($custom["list-firstname"][0])) $first_name = $custom["list-firstname"][0];else $first_name = '';         if(isset($custom["list-lastname"][0])) $last_name = $custom["list-lastname"][0];else $last_name = '';         if(isset($custom["list-website"][0])) $website = $custom["list-website"][0];else $website = '';         if(isset($custom["list-phone"][0])) $phone = $custom["list-phone"][0];else $phone = '';         if(isset($custom["list-mobile"][0])) $mobile = $custom["list-mobile"][0];else $mobile = '';         if(isset($custom["list-fax"][0])) $fax = $custom["list-fax"][0];else $fax = '';         if(isset($custom["list-email"][0])) $email = $custom["list-email"][0];else $email = '';     ?>

Firstname:	<input name="list-firstname" value="<?php echo $first_name; ?>" />

Lastname:	<input name="list-lastname" value="<?php echo $last_name; ?>" />

Email:	<input name="list-email" value="<?php echo $email; ?>" size="40"/>

Website:	<input name="list-website" value="<?php echo $website; ?>" size="40"/>

Phone:	<input name="list-phone" value="<?php echo $phone; ?>" />

Mobile:	<input name="list-mobile" value="<?php echo $mobile; ?>" />

Fax:	<input name="list-fax" value="<?php echo $fax; ?>" />

          <?php       }            // Admin post meta contents       function meta_location() {         global $post;         $custom = get_post_custom($post->ID);         if(isset($custom["list-address1"])) $address1 = $custom["list-address1"][0];else $address1 = '';         if(isset($custom["list-address2"])) $address2 = $custom["list-address2"][0];else $address2 = '';         if(isset($custom["list-country"])) $country = $custom["list-country"][0];else $country = '';         if(isset($custom["list-province"])) $province = $custom["list-province"][0];else $province = '';         if(isset($custom["list-city"])) $city = $custom["list-city"][0];else $city = '';         if(isset($custom["list-postcode"])) $post_code = $custom["list-postcode"][0];else $post_code = '';         if(isset($custom["list-profile"])) $profile = $custom["list-profile"][0];else $profile = '';         if(isset($custom["list-distributionrange"])) $distribution_range = $custom["list-distributionrange"][0];else $distribution_range = '';         if(isset($custom["list-distributionarea"])) $distribution_area = $custom["list-distributionarea"][0];else $ddistribution_area = '';       ?>

Address 1:	<input name="list-address1" value="<?php echo $address1; ?>" size="60" />

Address 2:	<input name="list-address2" value="<?php echo $address2; ?>" size="60" />

City:	<input name="list-city" value="<?php echo $city; ?>" />

Province:	<input name="list-province" value="Ontario" readonly />

Postal Code:	<input name="list-postcode" value="<?php echo $post_code; ?>" />

Country:	<input name="list-country" value="Canada" readonly />

Profile:	<input name="list-profile" value="<?php echo $profile; ?>" size="60" />

Distribution Range:	<input name="list-distributionrange" value="<?php echo $distribution_range; ?>" size="60" />

Distribution Area:	<input name="list-distributionarea" value="<?php echo $distribution_area; ?>" size="60" />

        <?php       }     }          // Initiate the plugin     add_action("init", "ListingInit");     function ListingInit() {        global $listing;       $listing = new Listing();       $add_css = $listing->loadStyleScripts();     }      How can I do add a dropdown list of Businesses to the admin list for the Listings?


What is the easiest and cheapest way to sell a download on my website?

I know that there are several e-commerce plugins, like JigoShop, WP E Commerce, and Woo Commerce. I also know there area lot of payment gateways like authorize.net and Paypal. However, if I have a really simple piece of software that I want to sell on my website, a single file download, what is the easiest and cheapest way to accomplish this? Can I use one of the WP plugins without having to pay for PayFlow Pro to allow the download?


Multi-site User Sessions

I have a client that wants to create several WordPress sites and utilize a "site switcher" at the top, sort of like ThemeForest.net. I know in WP 3 you can create multiple blogs on the same installation, but what about enabling users who login to one blog to be logged into all of the blogs in the WordPress installation? Is this possible?


Millennial Media PHP Setup ( Code Integration )

I know this going to be very easy question for people with good PHP knowledge. I have a WordPress website self hosted. I designed it for mobile devices and I would like to install Millennial Media advertisements in it. Millennial Media does not really provide detailed instructions and web resources strangely are not available! I have knowledge in HTML,CSS and JavaScript but very poor in PHP :( . any way I can do some changes PHP to achieve what I want, but I can't write them from zero and integrate them by my self. Ok long story short This the code provided by Millennial Media:               <?php      /*--------------------------------------------------------------*/      /* Millennial Media PHP Ad Coding, v.7.4.20                     */      /* Copyright Millennial Media, Inc. 2006                        */      /*                                                              */      /* The following code requires PHP >= 4.3.0 and                 */      /* allow_url_fopen 1 set in php.ini file.                       */      /*                                                              */      /* NOTE:                                                        */      /* It is recommended that you lower the default_socket_timeout  */      /* value in the php.ini file to 5 seconds.                      */      /* This will prevent network connectivity from affecting        */      /* page loading.                                                */      /*--------------------------------------------------------------*/           /*------- Publisher Specific Section -------*/      $mm_placementid = 123456;      $mm_adserver = "ads.mp.mydas.mobi";           /* The default response will be echo'd on the page     */     /* if no Ad is returned, so any valid WML/XHTML string */     /* is acceptable.                                      */     $mm_default_response = "";          /*------------------------------------------*/          /*----------- BEGIN AD INITIALIZATION ----------*/     /*----- PLEASE DO NOT EDIT BELOW THIS LINE -----*/     $mm_id = "NONE";     $mm_ua = "NONE";     @$mm_ip = $_SERVER['REMOTE_ADDR'];          if (isset($_SERVER['HTTP_USER_AGENT'] )){          $mm_ua = $_SERVER['HTTP_USER_AGENT'];     }          if (isset($_SERVER['HTTP_X_UP_SUBNO'])) {               $mm_id = $_SERVER['HTTP_X_UP_SUBNO'];     } elseif (isset($_SERVER['HTTP_XID'])) {               $mm_id = $_SERVER['HTTP_XID'];     } elseif (isset($_SERVER['HTTP_CLIENTID'])) {               $mm_id = $_SERVER['HTTP_CLIENTID'];     } else {               $mm_id = $_SERVER['REMOTE_ADDR'];     }          $mm_url = "http://$mm_adserver/getAd.php5?apid=$mm_placementid&auid="               . urlencode($mm_id) . "&uip=" . urlencode($mm_ip) . "&ua="               . urlencode($mm_ua);     /*------------ END AD INITIALIZATION -----------*/     ?>          <?php     /* Place this code block where you want the ad to appear */     /*------- Reusable Ad Call -------*/     @$mm_response = file_get_contents($mm_url);     echo $mm_response != FALSE ? $mm_response : $mm_default_response;     /*--------- End Ad Call ----------*/     ?>      I want the Advertisement to appear in the footer area ( I will edit the footer.php in twenty eleven theme ) but I want to know where shall I put these pieces of codes in wordpress files or shall I create a new ones and what to name them? would some please help me with this issue and provide me with the file's names that required to be edited and how would they look like in the end ? Thanks


How to create this kind of sub-menu in new line?

In my design I need use this kind of wordpress custom menu. Menu (I am able to do this) ![enter image description here](http://i.stack.imgur.com/7ZtG6.png) Menu element with sub menu. (but not this one) ![enter image description here](http://i.stack.imgur.com/ZLEzB.png) In this UI , I can not able to separate sub-menu to the new line with CSS. Then how can I add specific menu sub menu to new line.


Restrict Author role to only 3 wp-admin pages

I allow the author user role to add/edit posts (using a custom post type called "User Posts") as well as add/edit their own media from wp-admin. I currently have it set up so that the only menu items they see are the "User Posts" "New User Post" "Media" and "Upload Media", with these URLs: post- new.php?post_type=tsv_userpost edit.php?post_type=tsv_userpost upload.php media-new.php The only problem is that if the user types in the URL of, for instance, post- new.php (without the custom post type part) Wordpress still allows them to see that page. No bueno. Is there a way to redirect or display an error message to users if they are not admins and if they land on any wp-admin page EXCEPT the above URLs? I have tried using this code (just for the post-new.php page) from another thread, but it doesn't seem to do anything:               //Show error message if authors try to access wrong wp-admin pages     add_action('admin_head','my_restrict_access');     function my_restrict_access_meassage(){         global $pagenow;         if ($pagenow == 'post-new.php' && !current_user_can( 'switch_themes' )){             echo '

You Dont have the right permissions to access this page

';             exit();         }     }      Thanks is advance. **EDIT:** Here's the code I ended up with that works:                       //Restrict access to authors in wp-admin pages         //Show error message if authors try to access wrong wp-admin pages         add_action('admin_head','my_restrict_access');         function my_restrict_access(){             $Path=$_SERVER['REQUEST_URI'];             $basepath='http://www.theseattlevine.com/wordpress/wp-admin';             $URI='http://www.theseattlevine.com'.$Path;                      if      (   ($URI ==($basepath . '/post-new.php')) && !current_user_can ('manage_categories') ) {                             echo    '

You Dont have the right permissions to access this page. Try these links instead:

The Vine Homepage

Add a new user post

Your dashboard

';                             exit();                             }                 elseif      (   ($URI ==($basepath . '/edit.php')) && !current_user_can ('manage_categories') ) {                             echo    '

You Dont have the right permissions to access this page. Try these links instead:

The Vine Homepage

Add a new user post

Your dashboard

';                             exit();                             }              }


How can I detect whether a BuddyPress page is active from within my theme?

I'm trying to work sub-menus into my theme but am running into issues when navigating to BuddyPress pages (as opposed to standard WP pages, posts, etc.). Basically, what I want to do is have pages (where appropriate) display a sub menu, ala: ![http://skitch.com/zamoose/d12ns/about-us-delta-sigma-theta-sorority-inc- south-jersey-alumnae-chapter](http://i.stack.imgur.com/cIZie.jpg) But when I navigate to pages that exist under BuddyPress' control, I get the following: ![http://skitch.com/zamoose/d12nu/delta-sigma-theta-sorority-inc-south-jersey- alumnae-chapter](http://i.stack.imgur.com/fgSgM.jpg) I'm using the following to generate the sub-menu:               if (is_page()) {       global $wp_query;            if( empty($wp_query->post->post_parent) ) {         $parent = $wp_query->post->ID;       } else {         $parent = $wp_query->post->post_parent;       }            if(wp_list_pages("title_li=&child_of=$parent&echo=0" )) { ?>         <ul id="subnav">         <?php            wp_list_pages("title_li=&child_of=$parent&echo=1" );         ?>         </ul>         <?php        }     }      Where am I going astray?


Move excerpt meta box to above content editor

I found a WordPress hook called "`edit_form_after_title`" to add a text box after the title. How can I use this hook to display the excerpt after the title while creating a new post?


Why isn't is_home() working correctly?

I put a `if(is_home())` bit in my theme's functions.php and it doesn't seem to work. The function containing this bit is called on init so `is_home` should work already.


Show contact 7 form in popup

I am creating map link on a image and it has two links to open video and contact form. I am making popup with _lightbox_ but its not working. here is my code.. ## HTML
                  <?php echo do_shortcode("[contact-form-7 id='4' title='Registration Form']"); ?>
      ## CSS               div.map {         position: relative;     }          div.map > img {         display: block;         max-width: 100%;     }          div.map > a {         display: block;         position: absolute;     }          div.map > a:hover {         background-color: rgba(255, 0, 0, .5);     }          div.map > a.a {         top: 0;         left: 0;         width: 50%;         height: 50%;     }          div.map > a.b {         top: 0;         left: 50%;         width: 20%;         height: 50%;     }          div.map > a.c {         bottom: 0;         right: 0;         width: 20%;         height: 50%;     }          #pop-up-form { display: none; }


How to add option box in "Edit Post" plugin API?

This might be kind of simple, but I couldn't find a way to do so in the WP docs. My plugin currently uses custom fields for things I could just have radio buttons/check boxes for each post. How do I add a little section where I can have such options rather than custom fields?


Add filter to the end of the post

I have a function which is used to display a video, I want this video to be shown after the post, It should display the video when the post ends. I have added filter to it, but then too, the video is shown before the post. Here is the filter which I am using:               function append_the_video($content) {                 global $post;                 $content .= youtube_video();                 return $content;                 }         add_filter('the_content', 'append_the_video');      edited entire function               <?php     function youtube_video()     {     ?>
          <?php           $newvar = urlencode(get_the_title());     include_once(ABSPATH . WPINC . '/rss.php');     $rss = fetch_rss('http://gdata.youtube.com/feeds/base/videos?q='.$newvar.'&client=ytapi-youtube-search&v=2');         $maxitems = get_option('novideos');              $items =is_array($rss->items) ? array_slice($rss->items, 0, $maxitems) : '' ;                                 ?>
     <?php if (empty($items)) {echo "No current video uploads by ".get_the_title();}     else foreach ( $items as $item ) : ?>     <?php     $youtubeid = strchr($item['link'],'=');      $youtubeid = substr($youtubeid,1);     ?>
Latest Videos of <?php the_title(); ?>:

     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="265">     <param name="movie" value="http://www.youtube.com/v/<?php echo $youtubeid ?>&hl=en&fs=1" />          <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/<?php echo $youtubeid ?>&hl=en&fs=1" width="320" height="265">
<a href="http://www.youtube.com/v/<?php echo $youtubeid ?>">View movie»
          </object>          </object>
     <?php endforeach; ?>

     <?php          }     function append_the_video($content) {             global $post;             $content .= youtube_video();             return $content;             }     add_filter('the_content', 'append_the_video');          ?>


How can I do a URL redirection when an user uses wrong login details?

I have got this form for login from the front-end.                  <form action="<?php echo site_url('wp-login.php', 'login_post'); ?>" method="post" <?php /*id="login-page-form"*/ ?>>                                      <?php _e('Usuario', 'gp_lang'); ?>                                 <input type="text" name="log" id="log" value="<?php echo esc_html(stripslashes($user_login), 1) ?>" size="22" placeholder="<?php _e('Usuario', 'gp_lang'); ?>" />                                      <?php _e('Contraseña', 'gp_lang'); ?>                                 <input type="password" name="pwd" id="pwd" size="22" placeholder="<?php _e('Contraseña', 'gp_lang'); ?>" />                                      <input type="submit" name="submit" value="<?php _e('Login', 'gp_lang'); ?> →" class="button" />                                 <input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> <?php _e('Recuerdame', 'gp_lang'); ?>                                 <input type="hidden" name="redirect_to" value="<?php if(preg_match("/key=/", $referrer)) { echo home_url(); } else { echo $referrer; } ?>"/>          </form>      Everything works fine except when the user uses wrong login details. If an user enters a wrong username or password the next page is "wp-login.php". But I want it to redirect to my homepage (get_site_url) with proper message to the user about the wrong login.


Plugin to turn off RTE on select page

Anyone know of the plugin that lets you selectively turn off the RTE, on a per-page or posts basis?


better wordpress minify problem

i am using better wordpress minify plugin but it breaks site due to one of css file               http://www.mydomain.net/?mcsf_action=main_css&ver=3.1.1      i would like to add it into exception list so that it ignores it here's screen-shot for admin panel http://bayimg.com/jaHFdAaDj it says **Type in one script handle (NOT filename) per line** so what should be the script handle in this case thanks it looks like this `http://www.domain.net/wp-content/plugins/bwp- minify/min/?f=?mcsf_action=main_css&ver=1.2.2,wp-content/plugins/wp-e- commerce/themes/ishop/ishop.css,wp-content/plugins/wp-e- commerce/themes/compatibility.css,wp-content/plugins/wp-e- commerce/js/product_rater.css,index.php?wpsc_user_dynamic_css=true&category=5,wp- content/plugins/wp-e-commerce/js/thickbox.css` firephp shows Minify: GET param 'f' invalid (see MinApp.php line 63)


WordPress Cron how to find out my event recurrence?

In my plugin I'm able to set a cron event like so:               wp_schedule_event(time(), 'daily', 'myhookname');      But want I want to do is be able to find out what recurrence I have set for `myhookname`. The reason why is that I'm offering a setting to allow the recurrence to be changed. What I need to do is check if the recurrence setting has changed from what its currently set as and if so remove the event and reschedule the event with the new recurrence. So if there a function like this:               $recurrence = wp_current_event_recurrence('myhookname'); // returns hourly/daily/etc


Title how does page no work in Twenty Eleven

I would like to understand how does twenty eleven title page no works.. sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); I dont understand the above part as in the __() function the arguments are $text and $domain what is $domain and how does %s print's no. Below is the whole code of title thank you               <title><?php     /*      * Print the <title> tag based on what is being viewed.      */     global $page, $paged;          wp_title( '|', true, 'right' );          // Add the blog name.     bloginfo( 'name' );          // Add the blog description for the home/front page.     $site_description = get_bloginfo( 'description', 'display' );     if ( $site_description && ( is_home() || is_front_page() ) )         echo " | $site_description";          // Add a page number if necessary:     if ( $paged >= 2 || $page >= 2 )         echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );          ?></title>


How to Loop with the final result formatted differently?

I need to list post_title's in this specific format (note the last title in the list **must not** have a comma)                   "post_title","post_title","post_title"      I thought a mini-loop might work. Here's what I'm using                           <?php query_posts('cat=0$posts_per_page=-1'); // query to show all posts independant from what is in the center;                     if (have_posts()) :                         while (have_posts()) : the_post(); ?>                             '<?php the_title(); ?>',                         <?php endwhile; endif;                     wp_reset_query();                     ?>]">      But I need the final post_title to have no trailing comma?


How to get image name, mime type, width, height, file size from post custom field?

What I need is some function to echo file name of image used in post like "image-file-name.jpg", or just "image-file-name". Also it would be great to be able to have even more information about image like:   * image width,    * image height,    * image mime type / format,    * image file size,    * image extension. Also this may be helpful, I have custom field named 'image_full_url' which contains full url address of image used in post. For example content of custom field named 'image_full_url' is:               http://www.example.com/wp-content/uploads/2012/12/image-file-name.jpg      I am using that custom field to echo that URL when I need it, and it would be nice to have something similar to echo other data about image.


Change permalinks for custom post type based on taxonomy term

I have a custom post type 'profile'. Each profile can be one and only one of either student, staff or alumni, which is set through the 'profile_types' custom taxonomy. This gives me permalinks of:               www.mysite.com/profile/arthur-mcmillan.       What I want is:               www.mysite.com/student/arthur-mcmillan      I have actually got it to work using the following technique, but it breaks all my other pages and posts, returning a page not found. In register profile custom post type:               'rewrite' => array('slug' => '%profile_types%', 'with_front' => false)      And I'm filtering it with this function:               function filter_post_type_link($link, $post)     {               if ($post->post_type != 'profile'){             return $link;          }              if ($cats = get_the_terms($post->ID, 'profile_types')){             $link = str_replace('%profile_types%', array_pop($cats)->slug, $link);          }              return $link;     }     add_filter('post_type_link', 'filter_post_type_link', 10, 2);      So that works, but breaks other ordinary pages and posts. Does anyone know a way to fix the posts and pages, or of a better way of changing the permalink? Thanks


Wordpress redirection problem after moving to a new server?

I've created a site using wordpress and i moved that from localhost to new server. The steps i've followed is just got backup of old db from localhost and uploaded them to the new server. Changed the WordPress address (URL) & Site address (URL) manually from phpmyadmin. Moved all the files from localhost to the server Changed the wp-config with the new server's db details. Now i'm able to visit the admin panel of wordpress but not the site. Its showing the following error, > The page isn't redirecting properly > > Firefox has detected that the server is redirecting the request for this > address in a way that will never complete. > > This problem can sometimes be caused by disabling or refusing to accept > cookies. I think that this must some redirection problem.. My new .htaccess file under new server is               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /veejata/wordpress/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /veejata/wordpress/index.php [L]     </IfModule>


List all Posts under heading in wp_list_pages menu

I am currently using the default Page Navigation (wp_list_pages) with wordpress and I have set my homepage to a page called "Home" and my blog to a page called "Events" but I would like to list the 10 most recent posts under the child of "Events". I attempted to hack it in using the following code but it threw up content all over the place and removed tags:               add_filter('wp_list_pages', 'add_forum_link');     function add_forum_link($output) {             $output .= '
Blog
';                  query_posts('showposts=10');             while ( have_posts() ){ the_post();                  $output .= '
'.the_title().'
';             }                  $output .= '

';             echo $output;     }      Plus it involved me creating a new link called "Events" and so it doesn't work very well. Is there an option to just make Wordpress find which page I've set as my Posts and show the last 10 blog posts under that heading? Any help would be great!!


Will WordPress become completely OOP?

Is there any information about WordPress becoming completely OOP in future versions?


How to write an if statement which reads: 'if is this custom post type or a child of it do the following'?

Basically, I would like to activate a CSS class only if the current page is a certain custom post type (e.g. `?bbp_forum=technology`) or if the current page is a child of that custom post type. **EDIT:** The first custom post type is called '`bbp_forum`.' Each '`bbp_forum`' can have a '`bbp_topic`' (which is another custom post type). Like it is described in this picture: ![enter image description here](http://i.stack.imgur.com/5JiAi.png) I used to do the following in order to assign the class `current` to the current '`bbp_forum`'s link:                       <?php                 global $post;                 $the_post_ID = $post->ID;                 $cat_posts = get_posts('post_type=bbp_forum&posts_per_page=-1');                 var_dump($the_post_ID);             ?>             <?php foreach ( $cat_posts as $post ) : ?>                 <li <?php if ( $post->ID == $the_post_ID )  echo 'class="current"'; ?>>                     <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
                  <?php endforeach; ?>      but it doesn't work for a child of the '`bbp_forum`'


wp_get_archives for a specific category?

I've been pulling my hair out on this one - I need to hard code in `wp_get_archives()` for a specific category into a template. This post was useful: Category Specific Archive but, as with all the plugins I've found so far, they don't work with WP 3.1 (or you need to hack the core files which I obviously don't want to do). Is there another solution I'm not aware of? Maybe a method by creating a separate loop? THanks for any pointers osu


show cimy user fields in users.php with manage_users_columns

I'm trying to add code to my themes functions.php to display fields created with the Cimy user extra fields plugin in the dashboard users.php. I know that I need to use manage_users_columns, but beyond that I'm stuck. Anyone familiar enough with the plugin to help me get the proper fields to display?


Any plugins to help with multilingual content?

I'm taking classes in Spanish and would like to keep a blog to track my progress, where I can translate random pieces of text, post pictures and describe them in Spanish etc. Are there any plugins that would help with this? Maybe something that automatically detects the language and colors it a different color?


tabbed content box with different tabbed background images

I am currently looking for a way to replicate the image I have below. I have come across many tabbed content plugin's and snippets of code, but I cannot figure out how to add different background images to each tab. ![enter image description here](http://i.stack.imgur.com/H9QBw.jpg)


Post is in 2 categories - how to see the current active menu element?

Ok just imagine you have 3 categories. Projects, newsfeed and notimportant. You add a new project to projects and at the same time, want it to be in the newsfeed as well. Now when you click on the single post project in projects I want the menu to highlight the projects dropdown link. Since the post is in projects and newsfeed I don't know how to do that. It will highlight both. See here: ![enter image description here](http://i.stack.imgur.com/pOl1c.png) both have the classes `current-post-ancestor current-menu-parent current-post-parent` obviously I only want to show the active class when navigating through newsfeed into the post.


How to hide or remove unwanted widgets on Multisite installation?

I am using Multi-site installation. I don't want all the widgets appear under widgets.php on dashboard .So I tried to find a way to remove or hide unnecessary widgets . SO that the new sub-sites under my Multi-site created won't have much widgets. So the users don't get confuse with lot of widgets . I tried to find the files related to widgets .But I didn't able to find such pages in both wp-admin/includes/widgets.php and wp-admin/widgets.php I also tried to find in themes files .But failed .Could any one help me to find these ? Or Do I have a chance to hide them using functions.php? Thanks in advance !


What is the difference between a "tag" and a "category"?

I have been using WordPress for several years, but have yet to see a reason to employ tags over categories or tags with categories. What is the thinking behind the two, and when are each appropriate?


Script to Automatically Advance to the Next Page of a Paginated Post

I have a custom post type that is just a paginated post and acts as a slideshow. How can I make it so that the reader can choose an option to have the slideshow advance automatically to the next page after some preset interval (like 10 seconds)?


Remove 'read more' link when post is shorter than excerpt

How can I remove the 'read more' link from a post excerpt on a blog/archive page when there is nothing more to read...when the length of the post is shorter than the excerpt?


Nav menu separators?

Anyone know of a plugin that can, or have an idea how to, allow a user to drop in separators/dividers between certain nav menu items? Google only seems to bring up rookie CSS tips for first/last child selectors, I'm after something very much like Firefox bookmarks ;) **UPDATE:** I _do_ appreciate all input so far, but I'll elaborate to avoid any further confusion;   * I've written many plugins & themes, and have a good understanding of all the basics (hooking into WordPress, implementing extended functionality, handling & saving data etc.)   * I'm specifically after advice on extending the nav menus admin UI, which would allow users to drop in 'separators' (nothing more than markers) between items in the menu, and how best to store that data & then render it in some shape or form on output with `wp_nav_menu` Usually I would delve in & just get to work. But since this is only a _possible_ requirement for an upcoming project, I thought I'd see if anyone's already tried something similar. Plus I thought it might actually be useful for others, and would post my own feedback/results if I proceed with it.


Add Custom Profile Field as Notes

I would like to add a custom field "NOTES" to the user profile. This custom field should not only be updated,saved and display the current value but be displayed as ongoing (previous and current) notes on the user profile. For example: 1/1/2012 user xx wrote: Lorem ispum ispum 1/2/2012 user xx wrote: Lorem ispum ispum ispum 1/3/2012 user xx wrote: Lorem ispum ispum ispum ispum All "Notes" that the user adds should be displayed on his profile. Any help is highly appreciated! Thank you!


Wordpress Delete hook with wp_delete_post function?

I have this action/hook:               add_action( 'before_delete_post', 'my_delete_function' );      function my_delete_function($post_id) {          global $wpdb;         $achievement = get_the_category($post_id);          $h = $achievement[0]->cat_ID;          $s = ''.str_replace('"', '', $h);        if ( $s == 6 || $s == 5){             $wpdb->query("DELETE FROM wp_votes WHERE post = ".$post_id) or die(mysql_error());              }     }      The above works great when I am deleting posts from the admin. However, when the wp_delete_post() is called, the action doesnt work. How can I make the action work with the delete function?


plugin to hide selection of text from post from frontpage

is there any plugin that will add new quicktag, says:               [hidetext]some text to hide[/hidetext]      and any text inside those tag is hidden from frontpage/archive/etc. It only shown on single post page.


Make get_permalink() work outside the Loop using filters

I am developing a plugin which displays a wordpress post in a lightbox outside the loop. I noticed that some plugin which modify the contents of the post (like Facebook Like button plugin) use the `get_permalink()` function to retrieve post urls. When the post is opened normally (single.php) the plugins work fine. When the post is opened in the lightbox (outside the loop) , the plugins dont work since `get_permalink()` in the plugin does not return anything. however if i can somehow apply filter and return `get_permalink($post_ID)` instead, I can get the job done. I dont know how to hook it properly to get_permalink. I tried this, but this just makes it enter an infinite loop :               add_filter('post_link','cg_post_permalink');     function cg_post_permalink(){ return get_permalink($post_ID); }      here I read that `post_link` was the hook for the get_permalink function PS - please do not suggest using an iframe since it has its own set of complications. :)


Avoid too long words in a post title, post content or comment but only if its not a url

I want to prevent users from posting things like "aaaadfgdfgsdfgdaaaadsfgsdfgaaasdfgdfaaadfgsdfgaaaaaaaajahkjhkahkkjkjhaa..." which would not only be annoying but would certainly break the content div when the word is longer than the div itself. I found a neat regex which solved the problem:               $thecontent = preg_replace('/\w{40}(?=\w)/', "$0-", get_the_content());      This would place hyphens inside any word having more than 40 characters in order to force a line-break if necessary and keep the layout unharmed. The thing is I would like to apply this only when the word is plain text but certainly not when it's a url (or an email address perhaps). Ultimately, a url like "http://www.aaaa.com/sdfsdfdfg/sdfsdsdfs/dsdsdfs.php?var1=dfsdfsdfvar2=sdfsdf&var3=dsfsfds" should remain as it is as I believe it's automatically taken care of by wordpress (I tried and created a long url and it displayed correctly in two lines so it seems to be ok). With the regex here above, even the url is processed which is a problem. How can I avoid to apply that regex to (email addresses and) standard transfer protocol urls such as http, https, ftp, ftps? PS: I tried some client-side hyphenator plugins but they just don't fit my needs. Thank you for your help.


How to edit background color of only one sidebar?

I'm using Oulipo theme on this site, which has two sidebars. > **I'd like to ask how can I change the background color of only the left > sidebar?** Also, how to change the text, hyperlink, hover and background colors for   1. Front menu located in left sidebar.   2. Search field located at upper right corner. Thanks a lot for your help and time.


Custom Post Types, Custom Taxonomies and Permalinks ?

So let's say i register a custom taxonomy called:               Clients      With a few terms such as: `Microsoft, IBM, Apple` Under a CPT (custom post type) called `projects`: # Permalinks `/%year%/%monthnum%/%taxonomy%/%postname%/` this is the structure i am using; http://www.example.com/projects/ \- Displays All posts under 'projects' http://www.example.com/projects/clients/ Displays a 404 http://www.example.com/projects/clients/ibm/ displays all posts under `projects` with the term `ibm` How can i get Wordpress to display an Index of all the posts under Clients? so for example if the user visited /projects/clients/ all the posts with Microsoft, Apple and IBM would be displayed. I know a method is to use a page and then query into the page, but in essence of SEO, and relevance, i can not name the page-slug something else. Thanks in advance.


Adding another arg to comments_popup_link

what WordPress core functions do I have to modify to change               comments_popup_link('Ni komentarjev', '1 komentar','% komentarjev')       to               comments_popup_link('Ni komentarjev', '1 komentar', **'2 komentarja',** '% komentarjev')      I'd like to add an argument for 2 comments. And what lines to add to this functions? The reason why would I want to do that is simply the fact that in my home language we start plural by 3. I want it to be spelled correctly.


Random HTTP 500 error in WordPress

I'm running WordPress 3.2.1 on a CentOS box and I'm getting reports from my writers saying they get HTTP 500 errors when they try to update an exciting post. I've tried the same and have similar problems (although the HTTP 500 only shows in Chrome, Safari and Firefox simply give me a blank window). I've increased my log level on my httpd install to debug but I still can't find any errors in the logs.... The same box is running another website as well, also using WordPress (same version) and this site is not displaying these symptoms. All suggestions on how to resolve this are more than welcome! EDIT: I should also add that I've already tried increasing the PHP Memory in wp-config.php (up the 64MB) but the problem still occurs) (I'm double-posting this between here and serverfault as I'm not sure wether the problem is related to the server itself or to wordpress...)


query posts with custom field meta value

<?php          query_posts(             array(                 'showposts'   => -1,                  'post_parent' => $post->ID,                  'post_type'   => 'page',                  'orderby'     => 'title',                 'order'       => 'ASC',                  'meta_key'    => 'featured_product',                  'meta_value'  => 1             )         );     ?>      For featured products.               <?php          query_posts(             array(                 'showposts'    => -1,                  'post_parent'  => $post->ID,                  'post_type'    => 'page',                  'orderby'      => 'title',                  'order'        => 'ASC',                  'meta_key'     => 'featured_product',                  'meta_compare' => '!=',                  'meta_value'   => 1             )         );     ?>      For normal product. What I want is:   * If the child page has 'featured_product' and value equals "1" then it's featured. It works!   * If the child page has 'featured_product' and value not equal "1" OR it doesn't even have the field 'featured_product' then it's not featured product (this doesn't work at the moment). Anyone? Thanks!


Post will not load via ajax

I have inherited a WP 3.2.1 site which uses prettyPhoto to load content via ajax. This was working before I enabled permalinks on the site. The Custom Post Type UI plugin is installed. I can browse to my custom post type at mysite.com/story/name-of-story but loading via ajax results in a 404. The links which trigger the $.get code in prettyPhoto look like this:               <a href="<?php echo get_permalink(); ?>&ajax=true&count=<?php echo $count ?>" rel="story[ajax]"><?php echo wp_get_attachment_image($attachment->ID, array(75, 75));?>      If I change the permalink settings back to 'default'. the post content is loaded into the popup. The hrefs being called via XHR while it is working look like this: http://mysite.com/?story=name-of-story&ajax=true&count=37 I've tried removing all query parameters from the permalink URLS and this did not resolve the problem. Can anyone shed any light on what might be going on here?


How to Create RSS Feeds for categories in Wordpress?

I want to create RSS feed for categories in WordPress.Is this possible? How could I do it? Thanks


Plugin to book course and pay online for it

I got a request from a client. He need to manage a school with courses 2-3 day a month. He have to open-close date and manage it easily. Then when a person choose a date, he need to register, and pay with paypal, get a confirmation and email send to the customer and the teacher.... Question, do you know 1 or 2 plugin that can help me get this done in WP ? thanks in advance


Can WordPress be installed at the root level, if a homepage called index.php already exists?


14,000 Wordpress Users. How did they get there?

Somehow my Wordpress site has over 14,000 users. I know from looking at the records that these are "spam users"...               Spam User              Email     martin28651162   martin28651162@promatekng.com     martin322929651  martin322929651@playgirlgalleries.co.cc     martin443534673  martin443534673@wirelessnetworkcentral.com     martin640363627  martin640363627@bestcamcorderguide.com      Is there an easy way to remove all of these users without removing my actual "Real Users"?               Real User              Email     yyyy            yyy@email.com     zzzz            zzz@email.com      How can I prevent these users from being created automatically?


Display Parent and child taxonomies in seperate drop downs

> **Possible Duplicate:**   >  How can I display parent and child taxonomies in separate drop downs? does anyone have solution for the requirement where i have a taxonomy State which is the parent and it has a child sub-taxonomy called City, Need to display the state as a drop down, when i select the state tax i have to display the city tax in the second drop down.....kindly help me..


Getting metabox value within a shortcode?

Is it possible to get page's metabox value within shortcode that is executed on that page? Scenario:   * I have a sidebar metabox for every page.    * I have some kind of custom gallery shortcode. My gallery shortcode outputs 600x200 images (I'm using timthumb here). BUT I want it to display 900x300 if there's no sidebar. Normally I'd use:               $sidebar = get_post_meta($post->ID, 'metabox_sidebar', true);        if($sidebar == "true") { do something }        else { do something else }      But get_post_meta returns nothing within the shortcode body.


Help with a get_categories () drop down menu - I want it to show in heirachial form

I have a drop down menu that displays all of the terms for one of my custom taxonomies using get_categories (). It displays fine in alphabetical form. However, what i want to know is how can i have the terms listed in a hierarchial form in a drop down menu, so they appear like this - Parent Category 1   * Child One   * Child Two Parent Category 2   * Child One Here is my code for the drop down menu:               </select>           <span>By Category: </span>     <select name="category">      <option name="all" value="">All Categories</option>     <?php $categories_filter = get_categories( 'taxonomy=tshirt_categories' );          foreach( $categories_filter as $category_option ) {               echo '<option name=' . $category_option->slug . ' value="' .  $category_option->slug . '" /> ' . $category_option->name . '</option>' . "\n";         }     ?>      </select>        Once again thanks for any advice you guys may have! Mike


Is there a limit on the size of a WP page?

I have a plugin that generates a gallery of user photos. Currently, it works using `img` tags pointing to the user photo image. It attaches to the `the_content` filter. I'm experimenting with converting to using data URLs. I'm able to generate them with no difficulty, but when I change the code to insert them into the page, requests _to_ that page come back with zero content (i.e. zero length). However, I still get a 200 status code and I don't see any errors in my logs. So, I'm wondering if WP has a limit on the size of page it will send. The data URLs add up to around 1MB, so I was wondering if that tripped it over some limit.   * Gallery generation code   * User Photo code Any suggestions? The salient code is:               $file = trailingslashit($upload_dir['basedir']) . 'userphoto/' . $image_file;     $fileContents = base64_encode(file_get_contents($file));     error_log($fileContents);     $src = "data:image/jpg;base64,$fileContents";     ...     ...     $img .= '<img src="' . htmlspecialchars($src) . '"';     ...     $img .= ' />';      In case it's relevant, the content is in a page not a post and it would go here: http://nerdnite.com/nerds/ So, that page, but with data URLs instead of image source files. ## EDIT What I _do_ now know is that it's not the generation of the content string by the filter. I can generate the string (which is of length 1229923), but if I pass a dummy string back, everything works well. My memory usage is negligible and I'm nowhere near my PHP limit... so it seems to be something to do with WordPress trying to handle that huge string.


How can the_excerpt (or equivalent) be called on a category description?

In the code below, rather than writing out the entire description field ($category->description), how can I call the equivalent of the_excerpt? I'm placing the "more" tag after the first paragraph of the category description and using a visual editor to edit my category descriptions.               function show_category_index($content){         $categories=get_categories('exclude=1&exclude_tree=1');         echo $content;         echo '
';         foreach($categories as $category) {             echo '
'.get_category_thumbnail($category->term_id, 'thumbnail').'term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'';             echo $category->description . '
';             }          echo '
';     }


Missing "category_children" option when dynamically creating categories via a plugin

I've isolated the source of a fatal error that's been occurring when a brand new site is previewed just after installing and activating the plugin I'm working on. The problem appears to be that the "category_children" item in the options table is not being created. Interestingly, it appears that two actions trigger WP to create the category_children option. They are: (1) Activating a theme that contains code to create categories and (2) Simply accessing the category manager. If I do either of those, after activating the plugin, the category_children option is being created (presumably due to checks in the theme activation or the edit-tags.php load) and the error goes away. Here's the code I'm using in my plugin to create the categories (executes on plugin activation only):                       if(!get_cat_ID('nofollow')){wp_create_category('nofollow',1);}             if(!get_cat_ID('noindex')){wp_create_category('noindex',1);}      What am I missing? Do I need to explicitly call a method to have WordPress generate the category_children options array for these items? UPDATE: Thanks to scribu's help below on the reason for this bug, I've found that the PARTIAL fix for this bug is to place this line just after my wp_create_category() calls are complete:               clean_term_cache('','category');       However, this does not work when called in the same plugin that creates the categories. I had to place it in a standalone plugin that's activated separately from the plugin that creates my categories.


404 error after publishing a post

My issue is prety much what the title indicates. Whenever I publish a new post, everything works fine - the post is listed in my WP dashboard and all looks good. However, if I try to 'view post' to view it live on my website, I've searched for this issue throughout the net, and all point into editing the .htaccess file. However, this issue is more likely related to a theme I've developed (why? because several buyers have reported this issue, so I need to find a fix for the theme itself). That said, editing or manipulating the root .htaccess file is not really an option as the issue is originated in my theme. Best,   Chris


Print page content with formatting when doing custom SQL query

I guess there's a simple solution for this but couldn't find any. I'm trying to fetch 3 pages and show them on footer. The problem is that **_every page is shown as text without formatting_** which means that **_shortcodes are printed as text as well_**. Here's the code I'm using:               global $wpdb;     $sql            = "SELECT post_title, post_content FROM ...";     $footerElements = $wpdb->get_results( $sql );          foreach ( $footerElements as $footerElement ) {         echo '
';         echo '
' . $footerElement->post_title . '
';         echo $footerElement->post_content;         echo '
';           }      The reason I'm using `SQL` and not `WP_Query` is I have a plugin with `pre_get_posts` which is explicitly setting `post_types` (excluding `page`) when in category or tag page is shown. So I can't use `WP_Query` for that.


How do you seamlessly switch hosting?

I recently switched a WP site from shared hosting to a VPS and would like to document the process here.