title: Deploying from local to dev: pages do not work

text: So I have deployed a WP that was local to a dev environment. I have done the following:   * Deployed files via FTP   * Imported DB via PHPMyAdmin   * Modified home and siteurl values in the _options table So far, the landing page works fine, however as soon as I try to change page, it doesn't work. It may be interesting to say that I have deployed onto a URL like http://dev.example.com/project-name/. I cannot put it at the root, this dev servers is used to present multiple projects. I am not at ease with databases, deployments or htaccess things, so if you must explain with these things, please be gentle with me. Any help is appreciated.


title: Plugin updates, version dependencies, and backwards compatibility

text: Let's say I have a plugin that's currently at version 1.1, and I am releasing version 1.2. When you run the 1.2 update, a script will run to add new options, columns, tables, etc. A month later, 1.3 is released. Do I still need to include the update scripts in version 1.2 so people can update the plugin from v1.1 _directly to_ v1.3? Is there a way for WordPress to automatically download v1.2, run the update scripts, and then download v1.3, or do I need to include some sort of flag in v1.3 that says "if upgrading from 1.1 or below, run the v1.2 update scripts first"? In other words, is there a way to flag v1.3 of my plugin and say, "you need v1.2 or higher of this plugin for this update to work"?


title: Aliasing a subdomain on a wordpress network

text: I have a subdomain network install with the primary at http://test.domain.com. One of the sub-sites exists at http://sub.test.domain.com. I'd like to be able to access that sub at http://honky.domain.com but I'm stuck on how to make that work. Ideas? Also, I'd yet another alias to access that sub, but by a different domain. In other words, I'd also like to access that sub at http://www.supercooldomain.com. No idea how to make that happen either. FWIW, I'm using apache as the web server.


title: Use a higher than 230px logo image with 2013 theme

text: **UPDATE:** My question is not offtopic, because WordPress crops the logo image and not just CSS. I'm trying to use a 4724 × 2362 png image as a site logo at the top of a WordPress website with the stock Twenty Thirteen theme. By default the image height is cropped (here fullscreen) and you can't see the face of the person sitting at a table: ![website screenshot](http://i.stack.imgur.com/GDtPQ.png) Being a WordPress newbie I have edited the section 4.1 in the file `wp- content/themes/twentythirteen/style.css` and changed 230px to 500px:               .site-header .home-link {             color: #141412;             display: block;             margin: 0 auto;             max-width: 1080px;             min-height: 500px;             padding: 0 20px;             text-decoration: none;             width: 100%;     }      Now the "header" is higher, but my problem is that the image is still cropped (I think at the moment when I set it as the "header image" for the theme 2013). Please advise me how to fix this, probably by editing some PHP file under `wp- content/themes/twentythirteen`?


title: How much maintenance is required to run a WordPress server?

text: I recently started a blog at wordpress.com, but I am considering moving to a self-hosted WordPress to get access to plugins such as MathJax and Markdown and probably several others I will discover along the way. I am reluctant to do so, because running at my own website will inevitable require some maintenance (I will not be maintaining the HW, just using some standard webhosting service). How much work is required to maintain WordPress? That is, how often are there security updates and new versions that you will probably want? How difficult are updates to perform?


title: get_post_meta not working inside loop

text:
I was hoping for some assistance with a custom meta box that I added to my genesis child theme. The data is being saved properly, and stored properly, but when I try to echo it out using get_post_meta, nothing shows up. But a custom function someone showed me does echo it out. Can someone figure out what it isn't working? This should work but doesn't.               add_action ('genesis_before_post_content', 'gteh_tagline');     function gteh_tagline() {         $meta = get_post_meta($post->ID, $field['dbt_text'], true);         echo $meta;         }      This works but I don't want to use this, would rather use the proper code               add_action ('genesis_before_post_content', 'gteh_tagline');     function gteh_tagline() {         echo "
";         $customs = get_post_custom(get_the_ID());         $text = (isset($customs['dbt_text'][0]))?$customs['dbt_text'][0]:"";         var_dump($customs);         echo "
text=".$text;         echo "
";     }      It dumps this and echoes it out when asked.               ["dbt_text"]=>     array(1) {     [0]=>     string(89) "At vero eos et accusamus et iusto odio dignityr simos ducimus qui blanditiis praesentium "     }      Here is dbt_text               $prefix = 'dbt_';     $meta_box = array(     'id' => 'my-meta-box',     'title' => 'Post Tagline',     'page' => 'post',     'context' => 'normal',     'priority' => 'high',     'fields' => array(         array(             'name' => 'Post Tagline',             'desc' => 'Displayed below the post title',             'id' => $prefix . 'text',             'type' => 'text',             'std' => ''         )     )      );


title: Get number of comments per page

text: I am trying to grab number of comments to display per page. So far unsuccessful, looking for something similar to this `$wp_query->max_num_pages;` Thanks.


title: How do I use get_query_var() within plguin code

text: I am tring to access the author's id using               get_query_var('author')      , but this only seems to work on the page, not within plguin code. How do I access this from within plugin code?


title: Church hope them issue

text: I'm using the church home theme and can't figure out how to modify the three images under the download button page. http://themeforest.net/item/churchope-responsive-wordpress- theme/full_screen_preview/2708562 they say life groups , New here, Every Penny helps The appear on my home page and its the default content.


title: Display Audio Attachment URL

text: To get the image url from a Post Thumbnail in WordPress to display it in a template, I would use:               <?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'large'); $image_url = $image_url[0]; ?><?php echo $image_url;?>      I'm trying to do the same for a MP3 uploaded to a post. I had a snippet a while back to get it done, but I don't know what happened to it. How can I do the same for a MP3 uploaded to a post?


title: Trying to display posts but getting the pages as output

text: I am trying to display the posts on my front page of the `roots theme's base.php` file. I have added the loop as               <?php while (have_posts()) : the_post(); ?>         <?php             echo '<h2>';             the_title();             echo '</h2>';             the_content( 'Read the full post »' ); ?>     <?php endwhile;?>      However, this keeps displaying just the content and title from the first page. How do i get it to display the posts? I have set the number of posts as 3 under settings -> reading .


title: Role scoping for contributors down to the field level

text: We've been looking for a Wordpress plugin or system that lets you scope admin/contributor "roles" down to the field level. We have an immediate need for something like that, but totally coming up empty on options. There's a ton of options that let us scope down to a custom post type, but not necessarily the fields within that custom post type. So far, the only solutions I've found let you customize admin user access to a custom post type, page or post, like add/edit/delete on the custom post type itself; but I haven't been able to find a solution that says "John Smith only gets to edit XYZ custom fields, and read-only access to the rest of the data for an entry". **For example:** > We might have a custom post type called "Inventory", and it may have title, > description, stock number, features, price, status. We'll have sales people > able to edit "description" and "features, but they are not allowed to edit > any of the other information. Those are created when the listing is added by > a manager or website admin. I'm at my wit's end with this, and not sure what the appropriate path to take might be. I may be stuck creating the CMS from scratch as we used to do in the old days. Which would be okay...if not for the timeframe deliverable given to me. That said, if I were not able to find this all wrapped up in a nice plugin (paid or otherwise), is there a way for me to build out the custom post types and fields ahead of time, then apply some type of "functions.php" logic that adds the limitations I'm attempting to impose?


title: Get author id from url

text: I am trying to get the authors `user_id` on a page linked to by using `get_author_posts_url(),`. For example               http://example.com/author/John%20Smith       where `John Smith` is `user_id` is `23`. I need to get `23`.


title: Multiple loops breaking side bar

text:
Trying to put a bunch of loops in the side bar using WP_query.
     <?php $category_query_string = new WP_Query(array( 'post_type' => 'page' , 'posts_per_page' => '-1' , 'post_parent' => '413')); if ( have_posts() ) : while ( $category_query_string->have_posts() ) : $category_query_string->the_post(); ?>          <div <?php          $catspacetitle = get_the_title();          $cattitle = str_replace(" ", "-", $catspacetitle);               echo 'id="',$cattitle,'"'           ?> class="FL-pest-cat">     <p <?php          $pcatspacetitle = get_the_title();          $pcattitle = str_replace(" ", "-", $pcatspacetitle);               echo 'id="',$pcattitle,'-title"'           ?>class="FL-pest-cat-title">       <?php the_title(); ?>
               <?php          $postid  = get_the_ID();          if ($postid == '654') {          $curretnCat = '11';}     elseif ($postid == '661') {          $curretnCat = '12';}     elseif ($postid == '662') {          $curretnCat = '13';}     elseif ($postid == '664') {          $curretnCat = '15';}     elseif ($postid == '665') {          $curretnCat = '16';}     elseif ($postid == '666') {          $curretnCat = '17';}     elseif ($postid == '668') {          $curretnCat = '18';}     elseif ($postid == '669') {          $curretnCat = '19';}     elseif ($postid == '670') {          $curretnCat = '20';}     elseif ($postid == '671') {          $curretnCat = '21';}     elseif ($postid == '673') {          $curretnCat = '22';}     elseif ($postid == '674') {          $curretnCat = '23';}            echo '
';       echo '
';          $query_string = new WP_Query(array( 'post_type' => 'Pests', 'posts_per_page' => '-1' , 'cat' => $curretnCat )); if ( have_posts() ) : while ( $query_string->have_posts() ) : $query_string->the_post(); ?>
         <p <?php          $pestspacetitle = get_the_title();          $pesttitlesearch = array(' ', '(', ')', '.');          $pesttitlereplace = array('-', '', '','');          $pesttitle = str_replace($pesttitlesearch, $pesttitlereplace, $pestspacetitle);               echo 'id="',$pesttitle,'"'           ?>class="FL-pest-indv-title"><a href="<?php the_permalink(); ?>">            <?php the_title(); ?>

     <?php endwhile; endif; ?>     <?php   wp_reset_query(); ?>

     <?php endwhile; endif; ?>     <?php   wp_reset_query(); ?>
      It just ends up breaking the page, but works on it's own as a page template.


title: How can I add my_account_item to my custom theme?

text: Now I am creating a theme for my website. But now on my theme I need to add user account item (`my_account_item()`) that is shown on my admin bar. ![enter image description here](http://i.stack.imgur.com/FqSbI.png) On above image shows my theme part and admin_bar. I need to add this admin bar to my theme. On my image there is a red rectangle named admin,there I want to place admin avatar and **drop down** menu like **admin_bar**.


title: WordPress keeps resizing my 947x947 image down to 500x500 (full-size option)

text: This is driving me crazy. The code for the image is: `<img src="MYLINK" />` Yet it keeps resizing my image down to 500x500 from 947x947. How do I fix this? Also, it disregards the image map I have which lets you click on different parts of the image to go to different sites. EDIT: This is what I'm referring to: http://macaulay.cuny.edu/eportfolios/menatwork/test-page/ Right click and check the image properties: it shows how the 947x947 has been scaled to 500x500.


title: Some user's cant see custom taxonomy meta-box

text: I have strange problem with users who can not see metabox with custom taxonomies. When I delete user and create him again problem is solved, but this is not the best solution :) All my taxonomies are created in functions.php (https://gist.github.com/palcas/aaa87ab9915e08c79c84) Some of them have 20000+ terms (I don't know is this may cause the problem). For displaying terms of taxonomy in metaboxes (with dropdown's) I use this code (https://gist.github.com/palcas/0542c35119d54b4ca7df). And for grouping metaboxe's I use this js file (https://gist.github.com/palcas/c85849618d0ac2fe6261). Where did I made mistake? I hope I provided all information everyone could need to help me solve this strange problem :)


title: Any ideas how to allow CSS input to perfectly work in the text area with wp_kses?

text: I'm having issues with wp_kses. I have a text area that allows CSS input (only) While the rest of the CSS gets through (don't have any issues ever since). Until one user , inputs a CSS Code like this one:               li > mycolor { color: blue; }      It will be rendered like this (after passing through the filter):               li > mycolor { color: blue; }      The greater sign is passed through entities. Any ideas how to make this work while still having the filter?


title: Difference between add_filter and apply_filters

text: I have searched for a suitable explanation of the difference between `add_filter()` and `apply_filters()` in here but couldn't find one. Can anyone tell me what information or logic to consider before using `add_filter` or `apply_filters` in one context. Hhat makes the use of one imperative and not the other ? Is it correct that `add_filter` just adds a function to the queue of functions waiting to be executed on a variable and `apply_filters` executes the functions in order? Is it also correct that `apply_filters` when called with an argument (the name of the function to be run) will execute that function before all the others (if they exist) in the queue?


title: content summary of a post disappears If an images added at the beginning of the post. how to solve it?

text: If I put an image at the beginning of the post my content just disappears at the home page. but when I click read more button it shows full content ( **single.php** ) **index.php**               <?php     if (strlen(get_the_content()) > 10) {         $content = get_the_content();         echo str_replace(' ', '', substr($content, 0, 50)). "....";     ?>      How can I show the content summaryon the home even I add an image at the beginning of the post? Any help will be very much appreciated....


title: Pagination is not working on custom query

text: I have `custom query` with different conditions so that's why my `pagination` is not working with it. When i click on next button it show me the same posts. The `query` i am using are               <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;?>          if($selectedoption){                             $args = array(                                 'posts_per_page' => 30,                                 'paged' => $paged,                                  'post_type' => 'post',                                  'include' => $catID02,                                 'post_status' => 'publish',                                 'meta_query' => array(  array(                                         'key' => $checkkey,                                         'value' => $checktoption                                                     )                                                             ),                                 'author'=> $user_id                                   );                         }                          else if($tag_filter){                         $args = array(                         'posts_per_page' => 30,                         'paged' => $paged,                          'post_type' => 'post',                          'post_status' => 'publish',                         'meta_query' => array(  array(                                 'key' => 'post_state',                                 'value' => $tag_filter                                             )                                                     ),                         'author'=> $user_id                           );                     }     else{      $args = array('posts_per_page' => 10, 'paged' => $paged, 'post_type' => 'post', 'post_status' => 'publish' );                          } ?>               <?php query_posts($args); ?>                <?php if ( have_posts() ) : while (have_posts()) : the_post(); ?>      //content here               <?php endwhile; ?>                     <div class="span10 pagination">                         <?php next_posts_link(); ?>                         <?php previous_posts_link(); ?>                         <?php //if(function_exists('wp_simple_pagination')) {                             //wp_simple_pagination(); } ?>                      </div>                     <!-- pagination -->                          <?php else : ?>     <?php endif; ?>      So what can i do in order to make pagination working. Thanks


title: Is it possible to disable caching of an option when using w3 total cache?

text: a plugin i'm working on has a conflict with w3 total cache. To be more specific, in my code i have               static function get_instance()     {         if( self::$_instance === NULL ) {             // get the settings from the database             self::$_instance = get_option( 'ai1ec_settings' );                  // if there are no settings in the database             // save default values for the settings             if( ! self::$_instance ) {                 self::$_instance = new self();                 delete_option( 'ai1ec_settings' );                 add_option( 'ai1ec_settings', self::$_instance );             } else {                 self::$_instance->set_defaults(); // set default settings             }         }              return self::$_instance;     }      The problem lies in `self::$_instance = get_option( 'ai1ec_settings' );` because un incomplete object is returned (this happens only when using w3 total cache, i have declared an autoloader, but doing some debugging it seems that the incomplete object is stored in the cache) This is the error message > Ai1ec_Settings::get_instance(): The script tried to execute a method or > access a property of an incomplete object. Please ensure that the class > definition "Ai1ec_Settings" of the object you are trying to operate on was > loaded before unserialize() gets called or provide a __autoload() function > to load the class definition 1) Is there a way to tell w3 total cache not to cache that option?   2) If not, it would be correct to handle things like this?               try {         self::$_instance = self::getOptionsFromDb();     } catch (Exception $e) {         //Show a friendly error page     }          private static function getOptionsFromDb(){         $ai1ec_settings =  get_option( 'ai1ec_settings' );         if ( ! $ai1ec_settings instanceof self ) {             if (false === $ai1ec_settings) {                 return false; //option was not set in the db             } elseif( class_exists('W3_Plugin_TotalCacheAdmin') ){                 //let's clear thew cache and try again                 $plugin_totalcacheadmin = & w3_instance('W3_Plugin_TotalCacheAdmin');                 $plugin_totalcacheadmin->flush_all();                 $ai1ec_settings =  get_option( 'ai1ec_settings' );                 if ( $ai1ec_settings instanceof self ) {                     return $ai1ec_settings;                 } else {                     throw new Exception();                 }             } else {                 throw new Exception();             }         }        }


title: Retrieving custom fields with $wpdb->get_results

text: I'm trying to use `$wpdb->get_results` to retrieve an array of all posts including custom fields. I can retrieve the meta_key and meta_value columns like this:               [meta_key] => state [meta_value] => california      but I'm trying to list them in the object like this:               [meta_key] => meta_value [state] => california [city] => san francisco       The Query:               global $wpdb;     $query = "     SELECT ID, post_date, post_title, post_content, guid, meta_key, meta_value     FROM wp_posts INNER JOIN wp_postmeta     ON (wp_posts.ID = wp_postmeta.post_id)     ";          $results = $wpdb->get_results($query);          foreach($results as $result) {         print_r($result);     }      Is it possible to use an alias and/or subquery to achieve this?               SELECT ID, post_date, post_title, post_content, guid, meta_value AS (subquery here??)


title: How to protect post attachments related to a custom post type, from non-logged in users, on 1 subsite of a multisite installation?

text: I'm developing a simple "member's only" section within a website, with the sole intention of allowing the client to post files for their members. I've come to realize quickly that the posts' attachments themselves are not protected in any way within WordPress. For example, if a user was not logged in and if they knew the direct url to the file, they could access it/share it with others. This is a big problem as the documents are rather sensitive to the client' business. The member's area is being built using all the tools you'd expect - a custom page template paired with current_user_can conditionals, wp_redirects, custom roles using the members plugin, and a custom post type for the "file" posts. Each file post within the custom post type has metaboxes that the client can use to attach files/documents (.jpg, .gif, .pdf to name a few). I'm using WPAlchemy and it's Media Access class to satisfy the metabox requirements. The member's area will be running on 1 particular site within a multisite installation, which comprises of 3 sites in total (all related to the same company). I'd be very grateful if someone could steer me in the right direction. I'd prefer not to have to use an array of plugins, as I like to keep things simple and like to know what the code is actually doing. I also realize that this may not necessarily be a WordPress question, and more of a `.htaccess` question (as I've seen from the questions I've come across and their answers), but I can't help thinking that my question is different in that it relates to multisite, and the possible need for a separate upload folder. Here are my thoughts so far on protecting the attachments:   1. I could somehow create a separate media upload directory that the metaboxes upload the files to from each post within the custom post type. Because these files are separated from the rest of the sites' media uploads (only the member's attachments need to be protected) It would make it easier to protect just that folder using .htaccess. 1.1. Is some sort of .htaccess modification definately the way to go here? 1.2. How could I actually create the separate media upload directory, and have WPAlchemy's metaboxes upload the files here? I've seen a `uploads_dir` filter hook but not sure on how to use it.   2. Rather than creating a separate media upload directory as outlined above, maybe the better solution would be to only protect the attachments belonging to my custom post type? But then I have no idea how that ties in with the .htaccess solution. It seems like having a separate folder would be easier... I've seen the following questions that are very similar to my own:   1. How to Protect Uploads, if user is not Logged In? Look like it deals with a non-multisite installation of WP, and also the whole site is a member area vs a section of my site. Remember, I don't want all uploads to be protected, just the ones attached to the custom post type. I do like the idea of passing requests through a php script? Perhaps I could use this script and modify it to use a separate upload directory on the 1 site within my multisite installation?   2. Protect Uploads in Multisite and..   3. How to restrict access to uploaded files? **Update:** Found this thread but no solution to it. Seems like the better way to go if I can get it working. I'll work out how to upload the files to a new uploads directory after I've managed to protect all of the site's files


title: Order posts by custom field and if custom field is empty return remaining posts

text: I have an archive page ordered by a numeric value in a custom field. This returns the ordered posts correctly, but does not display posts that don't have a custom field.               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;      query_posts("paged=$paged&cat=7&posts_per_page=24&meta_key=custom_order&orderby=meta_value_num&order=ASC");      What is the best way to return the ordered posts correctly, followed by any posts that do not have a custom field value associated with them? **Edit** : Just to elaborate -- The final result that I want to accomplish is a category archive page that has specific posts show up first, followed by the rest. Pretty much like sticky posts, but only for a specific category archive. **Edit Two** : I am trying Jessica's suggestion, and I think we're almost there. The problem is that now if I set to `order=ASC` then all of the posts that have the custom field filled, show up after the posts that don't have a value associated. If I set `order=DESC` then the posts that have a custom field value are returned first, but in reverse. So, it would appear 4, 3, 2, 1, and then the rest of the posts with no value associated. How can I correct the order, so it shows 1, 2, 3, 4, and then the rest of the posts with no value in the `custom_order` field? I have added the following to my functions.php:               function wpse_55791_custom_order($clauses)     {         global $wp_query;              // check for order by custom_order         if ($wp_query->get('meta_key') == 'custom_order' && $wp_query->get('orderby') == 'meta_value_num')         {             // change the inner join to a left outer join,              // and change the where so it is applied to the join, not the results of the query             $clauses['join'] = str_replace('INNER JOIN', 'LEFT OUTER JOIN', $clauses['join']).$clauses['where'];             $clauses['where'] = '';         }         return $clauses;     }     add_filter('get_meta_sql', 'wpse_55791_custom_order', 10, 1);     function wpse_55791_custom_orderby($orderby)     {         global $wp_query;              // check for order by custom_order         if ($wp_query->get('meta_key') == 'custom_order' && $wp_query->get('orderby') == 'meta_value_num')         {             $orderby = "{$wpdb->postmeta}.meta_value='', ".$orderby;         }         return $orderby;     }     add_filter('posts_orderby', 'wpse_55791_custom_orderby', 10, 1);


title: Is there a spam comment blocker that blocks IP addresses for a limited amount of time?

text: I'm getting **a lot** of spam on my Wordpress blog. I'd like to cut down on the amount of comments I have to moderate. I'm looking for a plugin that does something like this: automatically marks comments as spam, and allows me to say "yes, this is spam". Once I've marked the comment as spam, block the user's IP address for X number of days. Is there a plugin out there that will do that, rather than me going through and blocking IP addresses manually?


title: How to remove the parentheses from the category widget

text: In the default category widget, when you check the "show posts count" checkbox, the number of posts appear surrounded by parentheses, how to remove them.


title: How do I include background images in my stylesheets in a plugin?

text: I'm trying to specify a background image in a style in a plugin I'm making. I was just outputing tags from the php, but realized I should probably be using enqueue_style... But how do I put a line of code like this:               .star.half {         background:url(<?php echo plugins_url(); ?>/my-plugin/images/star-half.png) no-repeat 0px 0px;     }      Into a plain .css file? What do I put where it says `<?php echo plugins_url(); ?>`?


title: How to display an alert when deleting a plugin?

text: My plugin allows for some custom templates to be installed into it by the user. Problem is, if someone deletes the plugin from WP in order to install a new version, all their custom files get deleted as well. Is there a way to catch deletion and fire an alert warning the user of this, before they delete? Oh and putting their templates into the DB is not an acceptable option.


title: How to Check If A Plugin Is Enabled Through API?

text: How to find out if a particular plugin is enabled in a sub-blog in a multisite blog?


title: Server database problem

text: > i just transferred my website from shared server to VPS, but then it is not > starting, when i inquired with the VPS technical support then they emailed > me something this, which i am not understanding:- email > >> Your site "www.onlinemba.co.in" has been migrated from your previous host and we are now getting a blank page while accessing the database dependant php files. There seems to be an issue with the database codings as all other php files are accessing fine and there is also no problem with the database connectivity. You can check for the same by accessing the site preview URL "http://38.100.101.228/info.php". >> >> Your Kloxo panel details are >> >> URL : XXXXX User : XXXXXX pass : XXXXX >> >> Server root access detail are as follows >> >> IP : 38.100.101.228 User : XXXXXXX Pass : XXXXXXX >> >> Kindly check your database once with your database developers with the details given above and let us know for further help. > > what should i do? ok well i did some changes for this in wp-config.php, but after that the admin guys from hosting are saying me this: > Virtual host entry for the IP is pointing to different folder ( which > doesn't have any contents ), hence you have received the default page. I > have pointed in to the correct folder "onlinemb". You can view the blank > page, please check and resolve it. i edited the database MySql hostname from local host, to the IP-38.100.101.228 but then he changed again to local host, and again the blank page came, what to do now?


title: Pagination for custom query won't let me back on page 1

text:
I have a custom query …               <?php     /**      * The loop that displays the posts.      */     ?>
     <?php              $args = array(             'post_type' => array('post', 'wr_raffle'),             'posts_per_page' => 4,             'order' => 'DESC',             'paged' => (get_query_var('page')) ? get_query_var('page') : 1,         );              $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post(); ?>      At the bottom of this document I have this …               ?>

         <?php             $endsize = $midsize = 1;             $type = 'plain';             $loop->query_vars['paged'] > 1 ? $current = $loop->query_vars['paged'] : $current = 1;                  // Sanitize input argument values             if ( ! in_array( $type, array( 'plain', 'list', 'array' ) ) ) $type = 'plain';             $endsize = (int) $endsize;             $midsize = (int) $midsize;                  // Setup argument array for paginate_links()             $pagination = array(                 //'base'          => @add_query_arg('paged','%#%'),                 'format'       => '?page=%#%#blog',                 'total'         => $loop->max_num_pages,                 'current'       => $current,                 'show_all'      => false,                 'end_size'      => $endsize,                 'mid_size'      => $midsize,                 'type'          => $type,                 'prev_next'     => false,                 //'paged'         => $loop->query_vars['paged']             );                  echo paginate_links( $pagination );         ?>
      Well, I've already read quite a few threads about this but can't figure out why my pagination "almost" works. My pagination works on every page, just if I navigate back to page 1 the pagination link doesn't work. – Before I clicked on Page Number Two: http://cl.ly/TNHx – After I clicked on Page Number Two: http://cl.ly/TN3o (so there is obviously no href for page-number 1) Any ideas why my page number 1 link wouldn't work? Kind regards, Matt


title: Remove quick edit for custom post type

text: Is it possible to remove the quick edit function for a custom post type? I have 14 custom taxonomy with hundreds of terms in each and it takes too much time and resource to load all of them into the source-code of the page. I tried to find a solution using google but most of them just hides the quick edit button, but the code is loaded in the footer by wordpress, so it doesn't really make any difference.


title: Enable comments for author.php

text: > **Possible Duplicate:**   >  Commenting in user profile page? ## Question I have an author.php page and I need to enable comments so when other users come to that authors page they could leave a short message in a form of a comment. Is that possible? I would really appreciate any help :)


title: How to display post from one custom post type in another custom post type with the same taxonomy?

text: I created two custom post types and one custom taxonomy. I wanted to be able to link the two different post types by applying the same taxonomy to both. How could I do this? Scenrio: Custom Post Type One: Places (eg. The Grand Canyon) Custom Post Type Two: Trips (eg. Journey Aboard the Grand Canyon Railway, Grand Canyon National Park South Rim Bus Tour) Custom Taxonomy: Location (eg. Arizona) Now if I add a Place called Grand Canyon and two Trips Called Journey Aboard... & South Rim Bus... I would tag all with the Location Arizona, because they are all related to Arizona. Now, how would I be able to automatically display the list of all Trips that are related to a Place based on the Location that they are tagged with? Also, Is there a better way to accomplish this?


title: Administration Pages Styling

text: I am adding administration pages using `add_menu_page()` function. But it wont look good. Check the image below. ![alt text](http://i.stack.imgur.com/5vrEQ.png) I would like to have it as separated and in between Appearance and Plugins section with rounded borders.


title: After upload on server 404 on all pages, no css

text: I developed a WordPress based site on using XAMPP 1.8.3. On my local machine everything is working fine. On the server I am using php 5.4.12, I copied the site files into subfolder with the same name I had in xampp/htdocs. I changed all occurrences of localhost to mydomain.com in the database with the searchreplacedb2.php script (http://interconnectit.com/products/search-and-replace-for-wordpress- databases). I am confident that the tool is working properly as I have used it several other times with success. On my local machine the site was in localhost/site, on the hosting server is on mydomain.com/site. The problem is that accessing the site home page produces a WordPress managed 404 page with no CSS being loaded. The title, menu and other site specific text is displayed, therefore the db is being read correctly. Trying to access any page other than the home page gets a Webhost managed 404 page. This happens also if I try to access page through non symbolic urls, ei. mydomain.com/site/?page_id=5; therefore it is should not be a redirection issues. What can be the issue? How can I proceed in troubleshooting it?


title: Use of wp_insert_post and parameters

text: I've JUST started using WordPress..i'm trying to add posts to Wordpress using php and i came across this piece of code:               // Create post object     $my_post = array(       'post_title'    => 'My post',       'post_content'  => 'This is my post.',       'post_status'   => 'publish',       'post_author'   => 1,       'post_category' => array(8,39)     );          // Insert the post into the database     wp_insert_post( $my_post );      i understand this is the way to go when creating a post using php..my questions are:   1. how do we execute the above php script and where do we save it in the WordPress folder?   2. what does the 'post_category' array mean(i'd like to use a category id to add posts to WordPress)? i'd like to mention that i've done some descent searching on the net but the resources i've found do not mention how to execute the above script.


title: Removing action from template class

text: I'd like to replace an action in a theme with my own version in a child. In this case, the theme hooks into `wp_head` to add it's own links. My own functions.php resides in the child theme and looks like this:               global $SMTheme;     remove_action('wp_head', array($SMTheme, 'headtext'));     add_action('wp_head', 'custom_headtext');      Unfortunately, it's not working yet and I'm fairly new to this. This is how the theme adds it's action:               class SMTheme {       var $options;            function SMTheme() {         // some unrelated code here                  include TEMPLATEPATH."/inc/settings.php";         $reset='';         // if (current_user_can('administrator')) {}         $this->getparams($settings,$reset);         add_action('wp_head', array(&$this, 'headtext'));       }


title: Help with static front page blog at /blog

text: I'm interested in installing wordpress and having a static front page and have link to the blog at /blog. How do I install wordpress in the root directory, but have the blog live at /blog I see how I could do it for the blog urls, but do I just change the wordpress url in general settings for this? Thanks.


title: How to control accept encoding on HTTP API requests?

text: Related to this ticket about issues with inflating data. So far it had been suggested by API's support to request gzip instead of deflate. However I cannot find a way to override WP settings that set deflate with highest priority as accepted encoding for all requests. Related functions - `WP_Http_Encoding::is_available()` and `WP_Http_Encoding::accept_encoding()`. Is there any hook or other option to control this that I am missing?


title: Trouble highlighting correct menu parent with wp_nav_menu classes while viewing "single posts"

text: I just updated a menu on a site of mine to utilize wp_nav_menu. Setting this up with WP was fairly straight forward however I've run into one small snag with the the way wordpress is outputting its parent/ancestor classes for use in highlighting the current page that the content belongs to, _particularly with single post pages_... Highlighting the current page with `.current_page_item a` and `.current_page_parent a` works perfect as long as its just on a normal page with children, **however as soon as you visit a post from _events_ or _media_ , the blog link in the menu is highlighted instead which is incorrect obviously**. *One thing noticeably wrong when looking at Wordpress' output is that the current page classes are not even being generated on the correct _li tag_ that the post belongs to which seems to be the root of the problem. For future reference, the Events, Media, & Blog pages all use a special query I've written to only grab the respective category for that page, ie.               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     query_posts("category_name=media&paged=$paged");          if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>     <div class="post">     </div>     <?php     endwhile;     else:     endif;      > **It should be noted** : I have a secondary loop in the footer grabbing the > latest blog post, dunno if this could be the culprit but Id like to keep > that as is since it was placed there upon request of the client. > > -- I take it back, I removed the secondary loop in the footer to see what > would happen and the same results occurred so its not the problem as far as > I can tell. Hope thats enough info, if not let me know. Best, SB


title: Make changes of wp-db.php file persistent against updates

text: I've added `$this->query("set session wait_timeout=600");` into `wp- includes/wp-db.php` file because of "MySQL has gone away" errors in every query and I need to find some way to do the changes in file persistent (I suppose update of WordPress rewrites `wp-db.php` file). Any ideas? Thanks


title: permalink is only showing relative path in dashboard

text: Permalink: /blog/blog/      My permalinks are only showing as relative. In the database for each post and image they are stored as relative urls as well. When a user tries to share an article to social media, only the relative path is being shared and the links become broken. Is there a simple setting for this without doing a find and replace in the database?


title: Custom theme hooks / filters - passing arguments

text:
I'm getting confused trying to implement these custom theme hooks. Trying to wrap my head around that. I thought i understood this. but now after reading code for several hours; it's made it worst. How do i modify the argument being passed in the following? `functions.php`               function theme_content() {        do_action('theme_content'); // Initialize my custom hook     }               function theme_content_alter($arg) {        // Do processing        if (!$arg) {          echo '
default
';        }        if ($arg == 'foo')  {          echo '
bar
';        }             echo apply_filters('theme_content','theme_content_alter', $arg);     } add_action('theme_content', 'theme_content_alter');      `index.php`               theme_content($arg = 'foo');      **What i'm trying to achieve** Being able to override hooks and handle contextual processing inside a functions or a separate file from a require. **An example:** on a front page i want theme_content() to have no sidebar but on a subpage it'll contain a sidebar, etc. This could be expressed like so: Is this the proper way to do this? I've tried to write it in my theme and haven't been able to figure out why it's not working. My arguments are not being passed in the parameters. **What i have done** Reviewed several threads on this SE and found them not very helpful for my context:   * Explanation for apply_filters function and its variables   * get_template_part vs action hooks in themes   * Difference Between Filter and Action Hooks?


title: How do I enforce a 404 status for an EXISTING page?

text: I was able to replace the main query for 404 pages with pre_get_posts but as soon as I point to an existing page, the error changes to 301. What function should I hook to to change the status to 404 AFTER a page has been found? The relevant working code is               $query-> set('p' , null);     $query-> set( 'page_id' , $some_page_id);     $query->set_404();     status_header(404);     nocache_headers();      Please, don't suggest using a 404.php page, unless you can explain all the default behavior I should hack to avoid creating one. ( I want to be the one who decides if doing it otherwise is not worth the try, rather than accepting other's limits). Thanks.


title: Set the default category of an attachment

text: I wanted to apply the same categories that exist for posts to attachments, so I wrote this code:               function wpmediacategory_init() {         register_taxonomy_for_object_type( 'category', 'attachment' );     }     add_action( 'init', 'wpmediacategory_init' );      The problem I am having now is that behaviour is not quite like with posts. There a 2 features I would like to achieve:   1. When adding a new attachment, set it to "Uncategorized"   2. When updating an attachment, if it has no categories selected, set it to the "Uncategorized" category. I have been trying to think what hooks I could be using, but without much success. How could I solve this problem?


title: Delete row of custom table in WordPress using AJAX

text: From my custom table (`$table = $wpdb->prefix . 'user_req';`) I'm showing data with `$wpdb->get_results()` and a foreach loop: ![my table](http://i.stack.imgur.com/qYE22.png) I managed to update the database with the individual values from the form where there is a "Submit" button. But, from this table I want to delete any of the row by clicking on the `(x)` button on the right of each row. I can use `$_GET[]` and can easily delete the row, but in this case I want to use AJAX. The `(x)` button on the right of each of the row is actually:               <input type="button" class="delete" title="Exclude This One"/>      I'm not a code-background, so I'm actually struggling with it. Most of the solution comes when I search, are for raw PHP-mySQL, but I'm trying to deal it with a WordPress way. I could prepare my $wpdb delete query:               <?php $wpdb->delete( $table, array( 'post_id' => $products->post_id ) ); ?>      But couldn't manage to go with it in an WordPress-AJAX way. Therefore, any help would be greatly appreciated.


title: how to show images in slider direct?

text: i am newbie in wordpress. i am using http://wordpress.org/support/plugin/nextgen-gallery plugin to show albums... you can have look of my site http://server.clickmak.com/demo.. when i click on any of the albums its opening gallerias and when i click on any of the images then slider will get open... i don't want like this. i want when i click on album link i want to open direct slider with images... in short i don't want to see gallerias page.. please give me some suggestion Thanks in advance


title: Conditionally set post_content in wp_insert_post

text: Is it possible to conditionally set the post_content in wp_insert_post? Im using a foreach to add multiple pages at once:               foreach ($create_pages as $new_page) {         $add_pages = array(             'post_title' => $new_page,             'post_content' => '', // lets say, if the page_title is 'Home', set the post_content to 'Default home page content'             'post_status' => 'publish',             'post_type' => 'page'         );         $page_id = wp_insert_post($add_pages);     }      Would it be also possible to set the default content for all the pages inside a php file?


title: Adding custom Bulk Actions

text: I have been looking around for ways to add custom Bulk Actions to the categories page. Most of them say that it is impossible to do it in a clean way, because of the lack of a hook for this. Most of the solutions include using JS in the client side to add the options though DOM manipulation. While this works, it is still quite an ugly solution. Most of the articles I have been reading are about 2 year old, so I was wondering since then to the present a new hook or solution has been added to this problem, to have a more up-to-date solution to this problem.


title: Not showing up on Wordpress Reader

text: I'm hosting a WordPress site on Name.com (using Jetpack). Although I can access my blog stats, etc. from wordpress.com, my posts aren't showing up on wordpress.com's reader or under topics. I haven't broken any WordPress rules (excessive tags, crappy content, etc.). Any idea how to get my posts to show up on the reader?


title: custom post type and taxonomy URL

text: I'm using following code for my custom post type               function resources_custom() {         $labels = array(             'name'               => _x( 'Resources', 'post type general name' ),             'singular_name'      => _x( 'Resources', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'book' ),             'add_new_item'       => __( 'Add New resources' ),             'edit_item'          => __( 'Edit Resources' ),             'new_item'           => __( 'New Resources' ),             'all_items'          => __( 'All Resources' ),             'view_item'          => __( 'View Resources' ),             'search_items'       => __( 'Search resources' ),             'not_found'          => __( 'No resources found' ),             'not_found_in_trash' => __( 'No resources found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Resources'         );         $args = array(             'labels'        => $labels,             'description'   => 'Holds our products and product specific data',             'public'        => true,             'menu_position' => 5,             'menu_icon' => get_template_directory_uri(). '/images/image-empty.png',             'supports'      => array( 'title', 'editor', 'thumbnail'),             'has_archive'   => true,         );         register_post_type( 'resources', $args );          }     add_action( 'init', 'resources_custom' );      and use the following code for taxonomies,               add_action( 'init', 'create_resources_taxonomies', 0 );          function create_resources_taxonomies() {         $labels = array(             'name'              => _x( 'cat', 'taxonomy general name' ),             'singular_name'     => _x( 'cat', 'taxonomy singular name' ),             'search_items'      => __( 'Search category' ),             'all_items'         => __( 'All category' ),             'parent_item'       => __( 'Parent category' ),             'parent_item_colon' => __( 'Parent category:' ),             'edit_item'         => __( 'Edit category' ),             'update_item'       => __( 'Update Category' ),             'add_new_item'      => __( 'Add New Category' ),             'new_item_name'     => __( 'New category Name' ),             'menu_name'         => __( 'Sections' ),         );              $args = array(             'hierarchical'      => true,             'labels'            => $labels,             'show_ui'           => true,             'show_admin_column' => true,             'query_var'         => true,             'rewrite'           => array( 'slug' => 'cat',             'with_front' => true,             'hierarchical' => true ),         );              register_taxonomy( 'genre', array( 'resources' ), $args );     }      Well, my url for custom post archive is : example.com/resources for custom post taxonomies is : example.com/cat/test-taxonomy and for posts is : example.com/resources/test-post is there any way to use "resources" instead of "cat"? So the custom post taxonomies URL should be like this : example.com/resources/test-taxonomy


title: Alternative to using get_avatar function?

text: I used a WP hack for displaying author's pics. For example, my single.php has an author slug which displays the author's pic. I created a folder called authors in my theme/images folder. Based on the author's ID, I name the file 1.jpg, 2.jpg and so on. So I call this image as               <img src="<?php bloginfo('template_directory') ?>/images/authors/<?php the_author_ID()?>.jpg" alt="<?php the_author(); ?>">      Now i'm modifying a plugin that displays the authors in the sidebar. However this plugin uses the get_avatar function, which is as follows:               /**                      * If show avatar option is checked, add get_avatar function to cache.                      */                     if($jmetc_options['show_avatar'] == 1) {                         $jmevar['cache'] .= get_avatar($tc->comment_author_email, $jmetc_options['avatar_size']);                     }      Can someone advise me on how to use/modify the get_avatar in order to use the default code that I use?


title: Add # to submenu URLs automatically

text: I'm trying to replace all my child page URLs to include a # automatically example: http://www.website.com/parentfoo/#childfoo I tried using `wp_setup_nav_menu_item` to run through all the child menu items and add '#' to it but now $menu_item->post_name brings up the ID so I don't know how to replace the string correctly. What I have so far:               function auto_hashtag( $menu_item ) {         if ( ! is_admin() && $menu_item->post_parent > 0) {                  // url             $url = $menu_item->url;             // slug             $slug = $menu_item->post_name;             $menu_item->url = str_replace($slug, "#"+$slug, $url);         }              return $menu_item;     }     add_filter( 'wp_setup_nav_menu_item', 'auto_hashtag' );


title: How to show pages in menu without link

text: I need to have a menu like this:               - a (link to a)     -- b (link to b, children of a)     -- c (link to c, children of a)     - d (NO LINK, #)     -- e (link to e)      I have the menu composed by the pages, as wordpress default. I want that "d" links to nothing (#), because i have a blank page and it doesn't have sense to exist. How can i achieve this?


title: Why permalinks work with /index.php/%postname% but not with just %postname%?

text: I'm having a problem with Wordpress permalinks. I change the permalinks to pretty permalinks but I am just getting 404s for the pages now. The strange thing is when I use /index.php/%postname% the page links work fine, but I need to get rid of the index.php part. I read about making changes to httpd.conf file but can't find the file anywhere. The htaccess file is correct as far as I can find out, it's below               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Any other ideas? Thanks Emma


title: Displaying a video on the homepage via a custom field inside a php widget

text:
I'm trying to get a video to display inside a widget which is called from a custom field inside a post. The code I am using is here:               <?php query_posts('cat=8&showposts=1'.get_option('posts_per_page')); ?>     <?php if(have_posts()) : while(have_posts()) : the_post(); ?><?php if( get_post_meta($post->ID, "youtube", true) ): ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="The W Club: <?php the_title(); ?>"><?php the_title(); ?>
          <iframe width="250" height="199" src="http://www.youtube.com/embed/<?php echo get_post_meta($post->ID, "youtube", true); ?>?rel=0" frameborder="0" allowfullscreen>          <?php else: ?>          Video can not be displayed.          <?php endif; ?>          <?php endwhile; endif; ?>          <?php echo get_post_meta($post->ID, "youtube", true); ?>          I have created a post inside category 8 (videos), entered a title, added the custom field (youtube) with the right code for the URL to display the video. When I load the page all the widget displays is "Video can not be displayed", it doesn't use the post title and I can't get it to even echo the custom field entry. Any ideas as to what is going on? The custom php widget I am using is http://wordpress.org/extend/plugins/php-code-widget/ Thanks in advance. Of course if anyone has a better way of doing what I'm trying to achieve that would be awesome too :)


title: Admin menu bar dropdown opens when I click on a form <select> element (Chrome)

text: Whenever I click on a `<select>` element within a form, it opens not only the relevant dropdown but at the same time the first dropdown menu of the admin menu bar. It seems to be an issue with _Google Chrome_ , as this doesn't happen with _Firefox_. Does anyone else have the same issue ? Any ideas about how to fix it ?


title: query in category.php repeats itself

text:
I'm need some help on my query. I'm building up a category page where on top a post need to show where custom field key 'uitleg' has value 'ja'. Per category there is only one post with that value. I use this post as an introduction post. Below that post I need to show all other posts in the same category minus the introduction post. This part works like a charm. But then something strange happens. If I got 4 posts in one category (1 introduction post and 3 other posts) the query below repeated itself 4 times beneath eachother. Is there a way to stop this? Must be in one of my foreach queries. But I can't see where this is going wrong. Anyone can see where this is going wrong? Thanks in advance!                               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                          <?php $drukproef = get_post_meta($post->ID, 'drukproef', $single = true); ?>                     <?php $drukproefimage = get_post_meta($post->ID, 'drukproefimage', $single = true); ?>                     <?php $actief = get_post_meta($post->ID, 'actief', $single = true); ?>                     <?php $uitleg = get_post_meta($post->ID, 'uitleg', $single = true); ?>                     <?php $artistnaam = get_post_meta($post->ID, 'artistnaam', $single = true); ?>                     <?php $artisturl = get_post_meta($post->ID, 'artisturl', $single = true); ?>                               <?php global $post;                         $categories = get_the_category();                         foreach ($categories as $category) :                     ?>                           <?php                      global $post;                      $tmp_post = $post;                      $myposts = get_posts('posts_per_page=1' . '&paged=' . get_query_var('paged') . '&meta_key=uitleg&meta_value=ja&category='. $category->term_id);                      foreach($myposts as $post) :                        setup_postdata($post);                      ?>                      <?php $thumb = get_post_meta($post->ID, 'thumb', $single = true); ?>                                    <?php $drukproef = get_post_meta($post->ID, 'drukproef', $single = true); ?>                     <?php $drukproefimage = get_post_meta($post->ID, 'drukproefimage', $single = true); ?>                     <?php $actief = get_post_meta($post->ID, 'actief', $single = true); ?>                     <?php $uitleg = get_post_meta($post->ID, 'uitleg', $single = true); ?>
                             <?php the_title(); ?>:                             <?php echo $drukproef; ?>                              <img src="<?php bloginfo('template_directory'); ?>/images/uitleg-actief-ja.png" width="20" height="20" />

                                       <?php the_content(''); ?>

<img src="<?php bloginfo('template_directory'); ?>/images/uitlegdivider.png" alt="" width="26" height="171" />

                                     <img src="<?php echo $drukproefimage; ?>" />

                         <?php endforeach; ?>                         <?php $post = $tmp_post; ?>

Overige inzendingen

                                  <?php                             $posts = get_posts('posts_per_page=1000&category='. $category->term_id . '&paged=' . get_query_var('paged'));                             foreach($posts as $post) :                             $thumb = get_post_meta($post->ID, 'thumb', $single = true);                             ?>
                                  <?php if (!empty($thumb)) { ?>
                                     <?php $thumb = get_post_meta($post->ID, 'thumb', $single = true); ?>                                     <?php $artistnaam = get_post_meta($post->ID, 'artistnaam', $single = true); ?>                                     <a href="<?php the_permalink(); ?>"><img src="<?php echo $thumb; ?>" class="img" alt="<?php the_title(); ?>" width="171" height="171" />

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

<?php echo $artistnaam; ?>

<?php the_excerpt(); ?>

<?php echo the_ratings_results(get_the_id()); ?>

                             <?php } ?>
                             <?php endforeach; ?>                         <?php endforeach; ?>                         <?php wp_reset_query(); ?>                 <?php endwhile; ?>                         <?php else : ?>                     Sorry, no posts matched your criteria.                 <?php endif; ?>


title: Wrap Meta Box with <li> and </li> for each new line

text: I'm trying to automate one of our posting aspects. We post a lot of lyrics and have a system of meta boxes which we use to input various pieces of information about each set of lyrics we post. One aspect that is a little annoying is having to search & replace `<li>`<`/li>`tags to the start and end of each new line of lyrics. I was hoping to have PHP echo this automatically but my code is not working at the moment. Here is my untouched code which outputs a verse of lyrics (we use `wpautop`so that line breaks are respected):               <?php if ( get_post_meta($post->ID, '_cmb_lyrics_1', true) ) : ?>     <?php $lyrics_1 = get_post_meta($post->ID, '_cmb_lyrics_1', true) ?>     <ul>     <?php echo wpautop( $lyrics_1) ; ?>     </ul>     <?php endif; ?>       And here is my attempt at outputting `<li>`tags, which didn't work. :(               <?php if ( get_post_meta($post->ID, '_cmb_lyrics_1', true) ) : ?>     <?php $lyrics_1 = get_post_meta($post->ID, '_cmb_lyrics_1', true) ?>     <ul>     <?php      echo "<li>\n"; wpautop( $lyrics_1) ; "</li>\n"; ?>     </ul>     <?php endif; ?>      Any help appreciated. Thanks.


title: HTML / Javascript in custom field textarea?

text: Is there a filter for allowing HTML / Javascript into a custom field textarea? I'm using get_post_meta. On the frontpage I want the HTML / Javascript to run, not to be displayed.


title: Custom post query by taxonomy

text:
I am using WordPress 3.5. My query is,               $args = array(         'post_type' => array('product', 'comic', 'magazine'),         'taxonomy' => 'Genres',         'term' => 'hot',         'posts_per_page' => 10     );     $the_query = new WP_Query( $args );          // The Loop     while ( $the_query->have_posts() ) :         $the_query->the_post();         echo '
' . get_the_title() . '
';     endwhile;          // Restore original Query & Post Data     wp_reset_query();     wp_reset_postdata();      This gives the exact result that I want but,               $args = array(         'post_type' => array('product', 'comic', 'magazine'),         'taxonomy' => 'Genres',         'term' => array('hot','home'),         'posts_per_page' => 10     );     $the_query = new WP_Query( $args );          // The Loop     while ( $the_query->have_posts() ) :         $the_query->the_post();         echo '
' . get_the_title() . '
';     endwhile;          // Restore original Query & Post Data     wp_reset_query();     wp_reset_postdata();      This is not working.


title: Adding Language Switcher in header , WP

text: Currently, I'm building multi languages blog. As I know, almost WP language translator plugins are based on .po & .mo files. here is a problem. A new language what I'm going to add does not exist with .po & .mo files, it's just a dialect(local) language. That's why I defined in php and grab the language.php files as below code. **header.php**               <a href="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>/?lang=newlanguage"> New Language     <a href="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>/?lang=eng">English      **function.php**               <?php session_start();     $_SESSION['language'] = $_GET['lang'];     if ( $_SESSION['language'] == 'newlanguage' ) {     require (TEMPLATEPATH .'/languages/new-language.php');     }     else {     require (TEMPLATEPATH .'/languages/english.php');  // default language     } ?>      the problem is it doesn't work, if I load to the new page, "new-language" is disappear and it automatically changes to the default language. My question is Can someone guide me to the right way/codes with developer solution?


title: 3.5 Media Manager - callout in metaboxes

text:
Two ways of doing the same thing: First one:                   var _custom_media = true,         _orig_send_attachment = wp.media.editor.send.attachment;              $('.media-upload-button').click(function(e) {             var send_attachment_bkp = wp.media.editor.send.attachment;             var button = $(this);             var id = button.attr('id').replace('_button', '');             console.log(id);             _custom_media = true;             wp.media.editor.send.attachment = function(props, attachment){                 if ( _custom_media ) {                     $('#'+id).val(attachment.url);                     $('#'+id).prev().attr('src', attachment.url);                     console.log(id);                 } else {                     return _orig_send_attachment.apply( this, [props, attachment] );                 };             }             wp.media.editor.open(button);             return false;         });              $('.add_media').on('click', function(){             _custom_media = false;         });      Second one:               $('.media-upload-button').click(function(e) {         e.preventDefault();         var button = $(this);         var id = button.attr('id').replace('_button', '');         console.log(id);         //If the uploader object has already been created, reopen the dialog         if (custom_uploader) {             custom_uploader.open();             return;         }              //Extend the wp.media object         custom_uploader = wp.media.frames.file_frame = wp.media({             title: 'Wybierz zdjęcie',             button: {                 text: 'Wybierz zdjęcie'             },             multiple: false         });              //When a file is selected, grab the URL and set it as the text field's value         custom_uploader.on('select', function() {             attachment = custom_uploader.state().get('selection').first().toJSON();             $('#'+id).val(attachment.url);             $('#'+id).prev().attr('src', attachment.url);             //console.log(attachment);             console.log(id);             //custom_uploader.close();         });              //Open the uploader dialog         custom_uploader.open();          });      Both works well when there is only one field/button that they are "attached" to, but if there is more than one, only first works ok. The second one always insert data to firstly clicked button/field, even if You click second one (second console.log shows oryginal "id" that is diffrent than one showed in console after click of button). But the second interface looks better for a designed job, so the question is - how the second code should be changed, so it can work with multiple input fields/buttons? AFAIK, the problem with second code is, that Media Manager object that is being created once, stays "in memory" so second callout only displays it, and doesnt ovverrite oryginal "custom_uploader.on" with initial id in it. Maybe somehow object should be destroyed after closing it? To clear thing out - question is: how should I use wp.media.frames.file_frame correctly with more than one button/field instead of wp.media.editor.send.attachment? Ps... for those, who would like to test entire code: functions.php:               add_action( 'add_meta_boxes', 'cs_products_mb_create' );     function cs_products_mb_create() {         //create a custom meta box         add_meta_box( 'products-info', 'Ustawienia Produktu', 'cs_products_mb_function', 'posts', 'normal', 'high' );     }          function cs_products_mb_function( $post ) { ?>

<input id="cs_product_menu_img_src" type="text" name="cs_product_menu_img_src" value="" /> <input id="cs_product_menu_img_src_button" type="button" value="Add / Change" class="button-secondary media-upload-button"  />

<input id="cs_product_bg_img_src" type="text" name="cs_product_bg_img_src" value="" /> <input id="cs_product_bg_img_src_button" type="button" value="Add / Change" class="button-secondary media-upload-button"  />

     <?php        }     add_action('admin_enqueue_scripts', 'cs_admin_customposttype_scripts');     function cs_admin_customposttype_scripts(){         wp_enqueue_media();          wp_enqueue_script( 'cs-image-upload', get_bloginfo('template_url').'/js/admin.js', array( 'jquery') );     }      Its stripped from loading and saving data, but it does what it should The admin.js that works but uses wp.media.editor.send.attachment instead of wp.media.frames.file_frame:               jQuery(document).ready(function($){         var _custom_media = true,         _orig_send_attachment = wp.media.editor.send.attachment;              $('.media-upload-button').click(function(e) {             var send_attachment_bkp = wp.media.editor.send.attachment;             var button = $(this);             var id = button.attr('id').replace('_button', '');             console.log(id);             _custom_media = true;             wp.media.editor.send.attachment = function(props, attachment){                 if ( _custom_media ) {                     $('#'+id).val(attachment.url);                         console.log(id);                 } else {                     return _orig_send_attachment.apply( this, [props, attachment] );                 };             }             wp.media.editor.open(button);             return false;         });              $('.add_media').on('click', function(){             _custom_media = false;         });     });      And admin.js that uses and looks as I would like, but doesnt work coccectly with two or more inputs:               jQuery(document).ready(function($){         var custom_uploader;         $('.media-upload-button').click(function(e) {             e.preventDefault();             var button = $(this);             var id = button.attr('id').replace('_button', '');             console.log(id);             //If the uploader object has already been created, reopen the dialog             if (custom_uploader) {                 custom_uploader.open();                 return;             }                  //Extend the wp.media object             custom_uploader = wp.media.frames.file_frame = wp.media({                 title: 'Wybierz zdjęcie',                 button: {                     text: 'Wybierz zdjęcie'                 },                 multiple: false             });                  //When a file is selected, grab the URL and set it as the text field's value             custom_uploader.on('select', function() {                 attachment = custom_uploader.state().get('selection').first().toJSON();                 $('#'+id).val(attachment.url);                 //console.log(attachment);                 console.log(id);                 //custom_uploader.close();             });                  //Open the uploader dialog             custom_uploader.open();              });     });


title: Display Today's date outside the loop?

text: Is there any way to display the Today's date outside any loop/post using WordPress date/time function instead of using the PHP `date()` function? I'm using the PHP `date()` function but it does not translate the date (month/day names) in the local languages, so it is not possible to translate it without changing the PHP code and setting the locale etc.


title: Filter media upload attachment meta

text: I'm trying to determine a way to access the meta data for an image when it is **first uploaded** with the media uploader. Looking at the media_handle_upload() function in /wp-admin/includes/media.php I can't see any filters before the meta data is sent to wp_insert_attachment() wp_update_attachment_metadata(). Sure, I can filter the meta inside using the 'wp_update_attachment_metadata' filter. But this fires inside the wp_update_attachment_metadata() function. I need a filter the meta data (specifically the title) when a new image is uploaded, not every time meta data is updated.


title: Including Angle Brackets In Pre Sections

text: I am attempting to post some java code between pre tags but the angel brackets get removed. For example:               private HashMap<String, HashMap<String, Integer>> featureCounts;      becomes               private HashMap> featureCounts;      Is there a way I can render the actual code? Also I am not a php developer or a wordpress expert by any means, so modifying the underlying php would be less preferred as a solution. Is there a way I can do this just using the editor?


title: New Plugin: Post update pushes a copy as a revision

text: I've been working alot with editing of posts after they've been published. I know I can hit update on the post to just update it, but I want to have the journey of revisions available for users to view on site. So I was thinking of a plugin. I've looked at http://wordpress.org/extend/plugins/duplicate-post/ which creates another copy on a new permalink. This is a good starting point I think, but I'm wondering if the functionality could be done in reverse. Functionality: When a post is updated (on every update no matter how small), it pushes the new updated content to the original post permalink, and moves the older post to a new permalink with a suffix of the update count. Example: My post is called `hello-world`. I publish it and the permalink becomes http://mysite.com/hello-world. I need to edit it, so I go to posts and edit the page. I click update, and the original `hello-world` post is copied and published under `hello-world-draft-1`, and the newly updated post takes the place of the original `hello-world` post. This way anyone linking to the post would always see the most up-to-date version of it, but all drafts would be available to view to any user by visiting `/hello-world-draft-X`, where 'X' is every update made that is not the main post slug. I'm thinking this is something like being able to show revisions to the user? Comments and suggestions welcome. Thanks. Update: This plugin looks good but only works on uploaded .doc files and not posts. http://wordpress.org/extend/plugins/wp-document-revisions/


title: Checking conditionals

text: We all know about the default WordPress post types, these being aside, gallery, status, chat and so on. any good theme should support all of them. In the case where a theme does support all of them, is it best, from a clean programming standard to do if, elseif, else if, else or should I use a switch case when checking if you are on a specific post type. for example:                   if(is_aside()){                      }elseif(is_status()){                      }elseif(is_quote()){                      }elseif(is_link()){                      }elseif(is_chat()){                      }elseif(is_gallery()){                      }elseif(is_image()){                      }elseif(is_chat()){                      }elseif(is_video()){                      }elseif(is_audio()){                      }else{                     $this->_title($this->_options);                     $this->_author_and_date();                     $this->_thumbnail($this->_options);                          the_content();                                   }      Seems messy and unclean, what would you suggest to do? **note:** some conditionals may be wrong, this is an example.


title: How to display site title with post title?

text: Is it possible to have the site title prepended before each post title, separated by a hyphen? For example:               [my site title] - [my post title]


title: Filter custom post type using multiple taxonomy dropdowns

text:
I'm trying to create two dropdown boxes on a custom post type page called Activities. One taxonomy category is for Activities Grade Level and the other for Activities Type. With what I have now, if you leave one of the drop boxes empty the search will go to a 404 page. I used the code from this wordpress forum and so this is what I have in my functions folder:               function get_terms_dropdown_grade_level($taxonomies, $args){             $myterms = get_terms($taxonomies, $args);             $output ="<select name='activities_grade_level'>";             $output .="<option value='#'>Select grade level</option>";             foreach($myterms as $term){                     $root_url = get_bloginfo('url');                     $term_taxonomy=$term->taxonomy;                     $term_slug=$term->slug;                     $term_name =$term->name;                     $link = $term_slug;                     $output .="<option value='".$link."'>".$term_name."</option>";             }             $output .="</select>";     return $output;     }          function get_terms_dropdown_type($taxonomies, $args){             $myterms = get_terms($taxonomies, $args);             $output ="<select name='activities_type'>";             $output .="<option value='#'>Select  activity type</option>";             foreach($myterms as $term){                     $root_url = get_bloginfo('url');                     $term_taxonomy=$term->taxonomy;                     $term_slug=$term->slug;                     $term_name =$term->name;                     $link = $term_slug;                     $output .="<option value='".$link."'>".$term_name."</option>";             }             $output .="</select>";     return $output;     }      And this is what I have on the post type archive page:
Filter by
         <form action="<?php bloginfo('url'); ?>" method="get">
         <?php         $taxonomies = array('activities_grade_level');         $args = array('orderby'=>'name','hide_empty'=>false);         $select = get_terms_dropdown_grade_level($taxonomies, $args);         $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);         echo $select;         ?>         <?php         $taxonomies = array('activities_type');         $args = array('orderby'=>'name','hide_empty'=>false);         $select = get_terms_dropdown_type($taxonomies, $args);              $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);         echo $select;         ?>         <input type="submit" name="submit" value="filter" />
         </form>      Incase it's good information, I'll include the urls too. A regular url that leads to the correct search is > [...]/?activities_grade_level=elementary- > school&activities_type=engineering&submit=filter A url where one of the drop boxes is empty is > [...]/?activities_grade_level=%23&activities_type=engineering&submit=filter > where %23 replaced something that could have been elementary-school or > middle-school A url that leads to the correct category would be > [...]/activities_type/engineering/ or > [...]/activities_grade_level/middle-school Any suggestions for this php and wordpress beginner?


title: Sticky menu for WP custom menubars

text: This seems simple, except that I am not able to figure it out. In a wordpress theme, how can I make a custom menubar below the header image stick at the top after scrolling down the page? Example sites are www.riverviewford.com and www.forexfactory.com. Here is the code I found on the net and am trying to use in wordpress. http://jsfiddle.net/uFq2k/3/ How do I actually call the script, and where from? Thanks in advance.


title: Plugin:Read More Right Here , How to change the name (more...) to Read More

text: Hi all I am using Read More Right Here Plugin when i using the `<!--more-->` Tag it appears like `(more...)` I need to know how to change the `(more...)` to Read More` Anyone Much appreciated!!


title: Permalinks okay some pages but 404 error on others

text: I recently upgraded to WP 3.4.2 and had multiple issues with custom theme. In the course of trying to fix those, permalinks broke for some pages, not others. I get server 404 page not found for the about page and subpage, services page and subpages, and contact page. But pages of home, health- concerns page and subpages, and resources are okay. I have tried:   1. Undoing and redoing the permalinks. (mod rewrite rules and htaccess is okay). While the pages are all there with page numbers, I must use twentyten theme to access them.   2. Activating twentyten theme. Same 404 behavior. (And it's the server 404, not the WP 404.)   3. Reupdating to 3.4.2. Site is hosted on GoDaddy; I don't have access to any config or log files. Site is: http://phoenixhealingarts.net At one point, I did reupload the database xml backup file. That apparently created a lot of duplicates (custom fields, SEO plugin info), which have since been removed from the database, but possibly could have created problems that persist. I'm looking at the SQL file (exported via phpadmin) but I don't see anything obviously wrong there. I've been reading posts/forums looking for an answer for many hours now. If you have any ideas, please share them.


title: Showing custom post type categories in the menu

text: here is my custom post type and category:               //Register nav     register_nav_menus( array(         'main_nav' => 'Main navigation'     ) );          //Custom post types     add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'assets',             array(                 'labels' => array(                     'name' => __( 'Assets' ),                     'show_in_nav_menus' => true,                     'show_in_menu' => true,                     'singular_name' => __( 'Asset' )                 ),             'public' => true,             'has_archive' => true,             )         );     }          //Custom post type taxonomy/category     add_action( 'init', 'build_taxonomies', 0 );     function build_taxonomies() {         register_taxonomy( 'categories', 'assets',             array(                 'hierarchical' => true,                 'label' => 'Categories',                 'query_var' => true,                 'rewrite' => true             )         );     }      Even though I have 'show_in_nav_menus' turned on, it still won't show. Is there something wrong with my code? It seems to work fine otherwise. Thanks


title: Current Page Highlight Issue

text: I'm currently working on website that has Wp-ecommerce and the current page link doesn't highlight except when I dedicative WP E-commerce. Any Ideas what the problem could be.


title: how to create a menu with all sub categories?

text: Is it possible to create a menu with a category such that each time that I had a sub category that automatically display on the menu? As far as I know, if I have a menu with the category "fruit", and I create the subcategory "bananas", I have to manually add it.


title: How to Migrate Blog Posts (only) from One Server to Another

text: I have a heavily infected and hacked server. I have setup a new server and created a fresh install of WordPress (fyi...it was a Joomla install on my server that got hacked and took the server down, not WordPress). So, now that I have a new and fresh install of WordPress on the new server I have a couple questions:   1. if I run a `check table` query on my current server, would that detect any malicious data in the WP Tables? I know the tables contain just data but I want to be completely sure that I guard against any possible way of transporting the malicious data from my current server to the new server.   2. what WP Tables do I need to move over to the new server now that I already installed a fresh WP copy. I have tweaked the new WP options a bit and all I want to do is move my blog posts and their related data -- nothing else. Which of the following tables should I be moving: wp_commentmeta wp_comments wp_links wp_options wp_postmeta wp_posts wp_terms wp_term_relationships wp_term_taxonomy wp_usermeta wp_users Thank you.


title: How to wrap a text with shortcode into php file?

text:
I want to wrap a text with shortcode into the `single.php` file.   * The shortcode is: `[box type="note" align="aligncenter" ][/box]` and   * the code is:              Διοργανωτής διαγωνισμού: <?php the_field('diorganwths_diagwnismou');?>
     Απαιτεί λογαριασμό Facebook: <?php the_field('apaitei_logariasmo_facebook');?>
      How can i wrap the this php code so i can have it into the box as the shortcode orders?


title: How do I add a new template to my site

text: I am in the template editor for my WP site, and I want to upload a new file, but I can't find that option anywhere. I want to make a new php file for a custom portion of the site. Where can I find this functionality?


title: Removing parent page in URL for one page

text: I have a page e.g.: mysite.com/parent/child1/child2/page And I want the URL to be: mysite.com/page But only for this one page ... not the entire site. Is there a way to do this without using some of the WP plugins which seem to have issues according to the support forums. Thanks for you help :)


title: Wordpress post carousel

text:
I stuck with this. I would like to have a portfolio carousel, that shows 9 of the latest posts in the carousel, and when you click on an arrow, than you will the 9 older posts etc. How can I get this working? My theme code:

                 <?php                      $args = array('post_type' => 'portfolio', 'posts_per_page' => -1, 'paged' => $paged);                     $loop = new WP_Query($args);                     $count = 0;                 ?>                      <?php if ($loop) : while ($loop->have_posts()) : $loop->the_post(); ?>
                 <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">                                              <?php the_post_thumbnail('thumbnail-portfolio'); ?>
<?php the_title(); ?>

<?php the_excerpt(); ?>

                 <?php endwhile; ?>                 <?php else : ?>
No portfolio items were found! I'm not sure what you're looking for.
                 <?php endif; ?>                 <?php wp_reset_query(); ?>

          <?php get_template_part( 'contact' ); ?>


title: get_option() will not work without access to wp-config.php

text:
I've created a plugin. In the initialisation file of my plugin I created an options page with some options to be stored by the admin.               <form method="post" action="options.php">             <?php settings_fields( 'settings-group' );             do_settings_sections( 'settings-group' );             ?>                 API key
                 <input type="email" name="apiemail" value="<?php echo get_option('apiemail'); ?>">
<input type="submit" value="Save" class="button-primary" />
     </form>      This works correctly and options are saved. In **another file** within the plugin folder, I need to get these options back and store them in variables.               $apiemail = get_option('apiemail');      However I get the error:               Fatal error: Call to undefined function get_option()      It seems this file has no concept of get_options. I can get it working if I include an abs path to `wp-config.php`               require_once('../../../wp-config.php');      This then gets the options correctly. But the "require" of wp-config conflicts later on with me trying to do `header(Location:)`               Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/syyco/wp-config.php:85)      **So how do I use`get_option` in this file without `require` of `wp-config` ?** Edit: As requested, more detail regarding what I am trying to acheive. I am creating a newsletter signup plugin which submits an email to an external API. The customer will see an input box, pop their email in and it will be added. Once it's added, I want to reroute them to a success page. I have created a plugin which consists of two files. **Dotmailer.php** is my plugin initialisation file. Included is the creation of the plugin, the creation of an admin menu item and an options page. The options page has a bunch of admin login details needed by the API. This file also creates a widget (the front-facing part of the plugin) with the custom email input box. The widget is pretty simple. It's a form with one input. It POSTs the email address data to another script called **dotmailer-add.php** , also in my plugin folder. **dotmailer-add.php** takes the users email and sends it over to the API to be added to a mailing list. The API required an authorisation key. This auth key is one of the options I have asked the admin to set. **This is where the problem occurs**. Dotmailer-add.php file needs to use `get_option` to get the api key that the admin added through the dashboard. It cannot get this option, I get the error that get_option is undefined. If I `require` wp-config.php, then get_option works fine. You can see the code in it's entirety here. Dotmailer.php (the initialisation file) Dotmailer-add.php (the script that the widget form posts to)


title: Meta query relation 'OR' not working as expected

text: I have the following query, `$the_query = new WP_Query( $args );`, which is supposed to show any properties of H_property_type **bandb** , **hotel** _or_ **dining**. If I do a print_r of $args I get the following, which I would expect to work great:               Array(     [post_type] => property     [posts_per_page] => -1     [orderby] => H_featured     [order] => DESC     [meta_query] => Array         (             [relation] => OR             [0] => Array                 (                     [key] => H_property_type                     [value] => bandb                     [compare] => on                 )                  [1] => Array                 (                     [key] => H_property_type                     [value] => hotel                     [compare] => on                 )                  [2] => Array                 (                     [key] => H_property_type                     [value] => dining                     [compare] => on                 )         )     )      But for some reason this technique is only retrieving results for one of the checkboxes - i.e. they ALL have the H_property_type of hotel. What am I doing wrong? My arguments are set up using this bit of code:               if(isset($_GET['H_property_type'])){         if(count($_GET['H_property_type']) > 1){             $args['meta_query']['relation'] = 'OR';         }         foreach ($_GET['H_property_type'] as $type) {             $args['meta_query'][] = array(                 'key' => 'H_property_type',                 'value' => $type,                 'compare' => 'on'             );         }     }


title: How do you remove a broken theme from WordPress Admin (without FTP or Cpanel)

text: Is it possible to remove a broken theme from WordPress using only the WordPress dashboard? i.e, without using cpanel or FTP? Background: When you are doing customer support, its rare that you have access to the user's FTP or cpanel, but its pretty simple for them to set you up as a temporary user to troubleshoot their site.


title: query if on page/2/?

text: hey guys, is there a way to check if i'm currently not on the frontpage of my blog? I know there are conditional tags like is_home(). However that won't work if I'm on myblog.com/page/2/ I have a pagination on my frontpage that let's users jump to the next page. If I'm on the second page i want to show a "Back Home" link. any idea how I could achieve that? thank you.


title: Sort post's categories by ID

text: I have a blog in which several post's categories have to be outputted first before other categories. Those categories have lower ID compared to other categories. I am using `get_the_category_list` but it is not working as I expected. Makes me confused because I remember a theme doing this very well. Can someone point me in the right direction? Thanks!               <?php get_the_category_list( array(       'orderby'      => 'ID',       'order'     => 'ASC'     ) ); ?>


title: How to load and show comments with AJAX instead of pagination?

text: Is there a plugin that displays comments like this: http://img541.imageshack.us/img541/6541/47905634.jpg when the user clicks "read more", older comments are being appended to the list with ajax.


title: how to properly use comments-template.php

text:
I want to modify comments form for both logged in users, and for those who are not. I modified the form for those who are not logged in by changing my comments.php but I'm not quite sure how to modify my form for logged in users. I know I have to use comments_template(), but when ever I try to use it in my page.php, I get errors like this               Notice: Undefined variable: args in {PATH}/twwr-theme/comments-template.php on line 13       these are the contents of my comments.php, its a bit messy               <?php     if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))         die ('Please do not load this page directly. Thanks!');          if ( post_password_required() ) {         echo "This post is password protected. Enter the password to view comments.";         return;     }     ?>
<?php comments_number('No Comments', 'One Comment', 'Comments' );?>

<?php previous_comments_link() ?>

<?php next_comments_link() ?>

         <?php //comment layout is in functions.php ?>         <?php wp_list_comments('callback=comment_layout'); ?>

<?php previous_comments_link() ?>

<?php next_comments_link() ?>

                    <?php if ( comments_open() ) : ?>                    <?php else : // comments are closed ?>
Comments are closed.
          <?php endif; ?>      ID); ?>


title: Excerpt Word Count

text: The code below from WPSnipps provides an excerpt character counter, but I'd like to count **words** instead. Does anybody have an idea of how to do this?               // Excerpt character count     function excerpt_count_js(){           echo '';     }     add_action( 'admin_head-post.php', 'excerpt_count_js');     add_action( 'admin_head-post-new.php', 'excerpt_count_js');


title: How to edit the Wordpress e-mail that gives the user their password?

text: Can't find the answer in the codex or on here. Just need to know what file to look in to find the e-mail template. The default e-mail that gets sent upon new user registration has a link which points to wp-admin, and I need it to point to frontend.


title: What do these phpMyAdmin errors mean on my WordPress databaes?

text: I'm getting 3 very similar phpMyAdmin errors on one of my WordPress databases.               More than one INDEX key was created for column `comment_approved`          More than one FULLTEXT key was created for column `post_title`          More than one INDEX key was created for column `lead_id`      Anyone know how to resolve these? ![alt text](http://i.stack.imgur.com/T0Ssk.png)


title: The $post variable – Did I get the grasp of how the Backend actions get parsed?

text: I was looking for a way to attach a custom meta box to the edit screen of a page at a specific template. I found and tried this here and from my actual point of view this can't work that way. Let me explain why I think so: To determine, whether I'm on a screen using a specific template I need reference the global $post. But since this function to create the meta box is hooked into the admin_init the global $post will not yet exist. So it has to put out an Error message, doesn't it? After those thoughts I tried to tie my meta_box_init function to edit_post, save_post and such. But the codex says, even they need $post to be set. So how could I achieve my page template specific meta box, really? Is there a clean solution?