title: ThinkTanking for design

text: I have a question that doesn't need scripting solutions perse. I would like to have some idea's and people who think along with me. WordPress: I have a script that let's a user upload a .csv file and views the content in a editor screen so the user can edit the form. I have this script working: View content from uploaded file in editor The next step is a design question (this is where you come in).   The whole reason why a user can edit the file is to make some "designy" modifications that can't be created in css because of their variability.   Let's say a user want's a specific cel **bold** or _italic_.   This is not something I can prepare for. If a user saves the content and re-uploads a new .csv file all the "designy" things he made are gone and he needs to do them again.   This is where I need a solution. I need a way that the "designy" things are saved so they can be reapplied to the new table. Also if the .csv file has an extra field or column the applied style must be added to the right cel. This is a pickle because I simply have no clue how to even think about doing this. I hope anyone can share their thoughts with me. M.


title: ouput buffering confusing me!

text: I've coded a plugin that works with an external ReST API. It is possible to get a set of posts in JSON to render a post list in HTML. Now I want to extend it to provide download links for associated documents (in most cases pdf files). So much for the theory. For another PHP CMS I've coded a proxy class. This class requests the API and gets the binary content of the documents. I'm using `ob_clean()` to clear the output buffer. I set a new header for `Content-Disposition: attachment; filename=...`, `Content-Type` and so on. In order to fetch the document I'm using curl. It works fine. But not in WordPress:               Cannot modify header information - headers already sent by (output started at /Users/sebastian/php_workspace/wordpress/wp-includes/admin-bar.php:792) in /Users/sebastian/php_workspace/wordpress/wp-content/plugins/bibsonomy-csl/lib/bibsonomy/CurlHttpRequestProxy.php on line 68      I've tried different ways to delete the output buffer, without any success. I tried:               while ( ob_get_level() ) {         ob_end_clean();     }      Also I tried to use PHP's `header_remove()` function. Nothing works. How can I delete the output buffer in WordPress?


title: Get postlist for each category using query_posts?

text: <?php      $cat_name=array('Breaking News Stories', 'Call-out', 'Featured Story', 'Standard Stories');      $count=count($cat_name);      /*Get category_id by its name*/           for($i=0; $i < $count; $i++)       {       $cat_id5.="'".get_cat_ID($cat_name[$i])."',";       //$cat_id4.="'".$cat_id5;       }      echo  $id1=rtrim($cat_id5,',');      //query_posts("cat=$catIDs&showposts=4");      $args=query_posts(array(                       'category__in' => array($id1),                       'posts_per_page' => -1,                     // 'category_name' => array('breaking-news-stories',);                      //'category_name' =>  array('category_name' ,'breaking-news-stories')                   ));       $posts_array = get_posts($args);       print_r($posts_array);      ?>      When I'm using the above code, I'm getting the first 5 posts. I want to get all the post by the above mentioned **ID**. Guide me how to get that! I'm new to wordpress.


title: Multisite domain mapping leads to registration page

text: I followed this guide: https://rtcamp.com/wordpress- nginx/tutorials/multisite/domain-mappinng/ And installed domain mapping plugin. I'm using subdomains with multisite wordpress but when I try to add new domains to subdomain sites they just redirect to Eg. domain to be mapped = customsite.com mainsite = mainsite.com When I try to access customsite.com I just get redirect to the main site. More accurately here: http://mainsite.com/wp-signup.php?new=customsite.com And it says that registration is disabled just as I want it to be. What is wrong? How can I make the customsite.com domain map to customsite.mainsite.com


title: user change password email when reset by admin

text: I am really new to wordpress programming and I am not even sure if this feature exist. What I am trying to do is send email to users (not admin) when I as an admin change their password/email? At present when I add a new user an email is sent to them which is great but no email is sent to them when i change their password/email. I will really appreciate any assistance here.


title: Metaslider won't appear in front/homepage

text: Page set as static, [metaslider id=25] inputted. Can't find any help in documentation or on forums. ![enter image description here](http://i.stack.imgur.com/wdf52.jpg)Wordpress 4.0 but couldn't get it to appear before latest release either. Two sample pics inputted. All no show.


title: Add class to all images in custom field (textbox)

text: I have a custom field `extra_gallery` for my page. It is basically another WYSIWYG editor where the writer will upload and insert images ( _not as a gallery_ ). How can I automatically add a rel attribute ("lightbox[1]") to all the image links? I'm using the plugin `Advanced Custom Fields` so the template code being used to display the content from the custom field is `<?php the_field('extra_gallery'); ?>` _Reason for question: It seems that most popular Lightbox plugins only check things displayed via`the_content();` as images there worked but the images from my custom field did not have the lightbox style applied._ **edit** To clarify:   1. We have a custom field/textarea with the same functions as the WP WYSIWYG editor.   2. Using this WYSIWYG, we upload and insert images. The images are set to link to the full image file. So each image comes out like `<a href=".../wp-content/uploads/2014/07/thumb20.jpg"><img class="alignnone size-full wp-image-91" src=".../wp-content/uploads/2014/07/thumb20.jpg" alt="thumb" /></a>`   3. Can I ask help with a function (open to other solutions/suggestions) that will (possibly) run every time a page is requested and will search for all of these inserted images, and add `rel="lightbox[1]"`?


title: Saving checkboxes for specific user

text: In my website i have a bunch of checklists with checkboxes                     <input type="checkbox"> Option 1           <input type="checkbox"> Option 2      And so on. How would i be able to save these selections to a specific user so that every time they return to the checklist their last checked boxes will still be checked. I'm wondering if there is maybe a plugin that does this.


title: Datepicker and advanced custom field plugin

text: I am using a datetimepicker js on a custom form, when selected from the calendar - the date format comes out to be: 24-Jul-2014   * I using this string value to update a meta value of a custom field created using Advanced custom field plugin.   * The field's Display Format: dd/mm/yy Save Format: ddmmyy I am not able to update the meta field's value with the value chosen in the date picker field on front-end. I can confirm that values from the form are being passed. And, can be used with strtotime() I believe, this is something with the formats. But, I am not able to collect all the pieces of jQuery and PHP(date,time things) to get the task done. Please suggest something. Link: http://www.omaksolutions.com/clients/neetinpuri/localmag/submit-your- event/ \- It will require you to log-in to see the form. \- You can use, user: sub8 pass: test


title: When moving a WP site, why does wp-admin redirect to old site?

text: I am in the process of moving a WP site from one host to another. I copied the database and all the files, created a new database and imported the old one. I then changed the wp-config file. The home page shows fine, but when I try to access /wp-admin it takes me back to the old site. The new site is a dev server where I plan to make style changes before I take the site live. What am I missing about this transition? How do I get the site to respond to the dev url correctly?


title: Paginate Gallery

text:
I am using the default WordPress Gallery (along with the Cleaner Gallery plugin) to display some images. The one thing that the gallery doesn't seem to have is pagination. What I'd like to do is after 6 images add Previous and Next links to navigate through the pages. Having said that, there are several plugins that claim to add this capability, but all of them were developed without the new Media Library, that comes standard with WordPress 3.5. I don't want to change the experience for the user...I just want to possibly add functionality through functions.php or somehow on the loop itself. I have no problem applying the same thing to all galleries, so if the fix could somehow find the gallery short-code than that would be awesome! Not sure how to do it, just kind of thinking out loud here. Any help is appreciated. The code generated looks like this:

      Thanks,   Josh


title: Showing profile pages content in tabs

text:
I've got my profile page setup which shows the users posts/comments in tabs beside each other i've added a achievement tab and would like to display the achievements users have earned. Here's the code, where am I failing?

<?php _e( "Posts",   "framework" ); ?>

<?php _e( "Comments", "framework" ); ?>

<?php _e( "Achievements", "framework" ); ?>
      I've also inserted this to my functions               function get_user_achievement_page ($user_id) {         $user_profile_url = dpa_get_user_avatar_link( array(             'type'    => 'url',             'user_id' => get_current_user_id(),         ) );         return $user_profile_url;     }      The Achievement tab shows fine and correctly but doesn't function. This is the website, and you can view the profile page with the problem in question. Then you can view the achievements I'd like to add into the tab here. It isn't showing errors or anything it just isn't loading the achievement box when I select the achievement tab.


title: How to get posts published on the latest date?

text: Is there a way of getting all posts published on the latest date? It might not necessarily be today, it might be yesterday or the day before yesterday or even a day last week.


title: Limit checklist by the current user

text:
Bare with me as I explain this. I'm adding an Assistant Editor feature to my multiple author platform. In the box that appears in post-edit page, the Editors can tick which task that they have done (for instance proofread the article) and then check their username (so that they will be credited on the front post page). The box looks something like this: ![enter image description here](http://i.stack.imgur.com/LEVXc.png) The code for the box:               // author checkboxes     add_action( 'add_meta_boxes', 'assisting_editor' );     function assisting_editor() {         add_meta_box(             'assisting_editor', // id, used as the html id att             __( 'Editorial Tasks' ), // meta box title             'editor_tasks', // callback function, spits out the content             'post', // post type or page. This adds to posts only             'side', // context, where on the screen             'low' // priority, where should this go in the context         );          }          function editor_tasks( $post ) {         global $wpdb;         $value = get_post_meta($post->ID, 'ratings', true);              echo '
Editorial tasks: ';              $ratings = array(             1 => ' Proofread ',             2 => ' Graphics Added ',             3 => ' SEO Fixed ',             4 => ' Ready for Publish '         );              foreach ($ratings as $id => $text) {         $checked = (in_array($id,(array)$value)) ? ' checked="checked"' : '';         echo '<input type="checkbox" name="ratings[]" value="' . $id . '"'.  $checked . '/>'.$text.'';         }              $qry['relation'] = 'OR';         $qry[] = array(           'key' => $wpdb->prefix.'capabilities',           'value' => 'editor',           'compare' => 'like'         );         $qry[] = array(           'key' => $wpdb->prefix.'capabilities',           'value' => 'administrator',           'compare' => 'like'         );         $qry = array('fields' => 'all_with_meta','meta_query'=>$qry);              $alleds = get_users($qry);              $currenteds = get_post_meta($post->ID, 'currenteds', true);              foreach ($alleds as $ed) {         $checked = (in_array($ed->ID,(array)$currenteds)) ? ' checked="checked"' : '';         echo '<input type="checkbox" name="currenteds[]" value="' . $ed->ID . '"' .$checked . '"/>'.$ed->user_nicename.'';         }         echo '
';     }          add_action( 'save_post', 'save_metadata');          function save_metadata($postid)     {            if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return false;         if ( !current_user_can( 'edit_page', $postid ) ) return false;         if( empty($postid) ) return false;              if ( is_null($_REQUEST["ratings"]) ) {             delete_post_meta($postid, 'ratings');         } else {             update_post_meta($postid, 'ratings', $_REQUEST['ratings']);         }              if ( is_null($_REQUEST["currenteds"]) ) {         delete_post_meta($postid, 'currenteds');         } else {         update_post_meta($postid, 'currenteds', $_REQUEST['currenteds']);         }     }          function display_current_eds($ID = '') {       if (empty($ID)) {         global $post;         if (!empty($post)) {           $ID = $post->ID;         }       }       if (empty($ID)) return false;       $eds = get_post_meta($post->ID,'currenteds',true);       if (!empty($eds)) {         foreach ($eds as $e) {           $edu = get_userdata($e);           $edusers[] = sprintf(             '%3$s',             get_author_posts_url( $edu->ID, $edu->user_nicename ),             esc_attr( sprintf( __( 'Posts by %s' ), $edu->user_nicename ) ),             $edu->user_nicename           );         }         return $edusers;       }       return false;     }          function authors_content_filter($content) {       $authors = display_current_eds();       if (false !== $authors) {         $content .= implode(', ',$authors);       }       return $content;     }     add_filter('the_content','authors_content_filter');              // add author checkboxes      Now, the problem is that the user can tick his own name **and any of the other editors**. This means that the user can as well untick any of the names too. That is not good. My question is, how do I make it so that the user can only tick his own name and the other names are greyed out?


title: Breadcrumb Not Linking to the Correct Custom Post Type Index Page(s)

text: I wrote this code for 2 **custom post types** to link back to their respective index   pages from the single post view. It works. However the "Portfolio" and "Artwork" will have **multiple** pages and I am unclear on what to append to this code to recognize those additional pages as they are created by the user. The page name progression is (for example) `portfolio/page/2/`, `portfolio/page/3/` etc, but all **single post** breadcrumbs are linking back to the **first** custom post type index page. Any help is so appreciated but please be concise because my coding skills and Wordpress knowledge are _intermediate_ at best.               global $post;         $type = get_post_type($post->ID);         if($type == 'portfolio'){       echo '' . 'Portfolio' .  '' . $markup;       } else if($type == 'artwork'){     echo '' . 'Artwork' .  '' . $markup;     }}


title: Wordpress Security - How to block alternative Wordpress access

text: I own a self-hosted Wordpress 3.5 blog. I'm working on its security and I'm trying to prevent non-writers from accessing anything admin-ish they shouldn't. Recently I tried Better Wordpress Security, I really liked some of the htaccess suggestions they have. Primarily the one hiding /wp-admin/ with a unique key, even though it had a few loop holes, you could figure the key using the logout query. Anyway: Assuming my /wp-admin/ and wp-login.php now bring up a 404 not found, I thought automated bots would stop hitting on me. But they didn't. I'm still getting site lockout notifications. My guess is that Wordpress have other standard routes for remote logins which attackers are still trying to exploit. I can't find any documentation about that or anything in the settings. However, earlier this week one of our writers asked me about writing to our Wordpress through his smartphone. There's this Android/iOS app. So I tried it, and I thought it won't work because the normal route now returns 404. But I actually managed to login successfully in the app. So how does the it work - where does it send the query? In short I could really use an explanation/article about how Wordpress logins work. Note: I currently don't have basicauth over /wp-admin/


title: Accept AJAX call with serialized form data

text: I'm trying to pass a wordpress plugin some form data via ajax and it works just fine, unless the form data is serialized, then the server responds with an error message. I'm stuck with this for days now, but I can't get it to work. What am I doing wrong, this can't be so hard, right? Here's the error message: > call_user_func_array() expects parameter 1 to be a valid callback, function > 'process_request' not found or invalid function name in > X:\xampp\htdocs\testsite\wp-includes\plugin.php on line 406 The AJAX call:               jQuery(document).ready(function($) {          nonce: whatever          //if i use this variable, it works fine      var data = {action: 'process_request', add_my_data: 'whatever', 'my_data[name]':'whatever', my_nonce: nonce};          //if i use this variable, the server returns the above error .     //because .serialize() doesn't include the submit button's name     //and the form doesn't contain the name of the function to be called, i added them manually to the string. nonce is pulled from form.          var data2 ='action=process_request&add_my_data=whatever&' + $('#my-form').serialize();               $('.my_submit_button').click(function(event) {            event.preventDefault();           jQuery.ajax({     type : 'post',     url : ajaxurl,     timeout: 25000,     data : //data (works) or data2 (doesn't work),     [...]      The strange thing is, the post data for 'data2' seems to be ok and has the same syntax like for 'data'. I controlled the post data with firebug: for 'data':               action=process_request&add_my_data=whatever&my_data%5Bname%5D=whatever&my_nonce=1b444dd703       for 'data2' (with the form serialized, the only difference I see is the referer):               action=process_request&add_my_data=whatever&my_data%5Bname%5D=whatever&my_nonce=1b444dd703&_wp_http_referer=%2Ftestsite%2Fadmin%2Ftestpage%2F      The PHP function that handles the request:               function process_request() {              //nonce validation left out for readability              if( isset ($_POST['add_my_data']) ) {             $this->add_info_array('placeholder', 'Database updated');         }                 //do some stuff here                 die();             }           add_action('wp_ajax_process_request', 'process_request');      UPDATE: The problem is the referer in the string that is created for 'data2'. Check my comment below.


title: Using the Loop to show all levels of subpages under a parent page? Halfway there

text: I have a need to make the Loop run through all of the children of a parent, all of the children of each child, etc. The reason I need the Loop instead of a listing tag like wp_list_pages is so that I can display any information associated with the pages using WP template tags and functions. It's for a showcase-style display that has hierarchical content and gets rearranged, so pages > posts for this usage. I've gotten as far as getting the loop to show children of the current page and an inner loop going to show grandchildren, but this is just a brute-force prototype, and I need to take it to the next level. What I think I need to do is use 1 loop that starts with post_parent (so that it shows child pages) but insert a function to change the post ID to each child page found so that the loop continues to drill down until it runs out, then backs out 1 level, goes to the next available ID, etc. My problem is that I'm not enough of a WP programmer (or real programmer at all) to get that going. If it were all out in code I bet I could work it out, but WP has obviously got hidden functions going with have_post and the_post to cycle through the available post IDs, and that has me lost as to how to integrate what I need. Here's where I am at the moment. Any help will be greatly appreciated!               <?php        $args = array(     'posts_per_page' => -1,     'post_parent' => $post->ID,     'post_type' => 'page',     'post_status' => '',     'orderby' => 'title',     'order' => 'ASC',);          query_posts($args); ?>          <?php if(have_posts()) : while (have_posts()) : the_post(); ?>          <a href="<?php the_permalink();?>"><?php the_title();?>:          <?php     $inner_query = new WP_Query("post_type=page&posts_per_page=-1&post_parent={$id}&order_by=title&order=ASC"); ?>          <?php while ($inner_query->have_posts()) : $inner_query->the_post(); ?>          <a href="<?php the_permalink();?>"><?php the_title();?>:          <?php endwhile; // end inner loop ?>     <?php endwhile; //end outer loop ?>          <?php endif; // end outer if have_posts?>


title: Get the user type of an author

text: I'm working on a site and I need to get the type of user the author is so I can mark it. The idea is that if an Admin level user post something it has a [ADMIN] tag or something next to their name. I know how to compare things within php but how do I check to see what user type an author is if possible? I can't seem to find any good documentation on the matter.


title: Copy custom post types and admin

text: I'm copying over a site from a former developer. I've installed a new instance of wordpress and database on new server, copied all but the wp-config from old server to new, but in admin it does not show the custom post types that are showing in old admin. I would think that these settings are in the functions.php, but I'm copying that over. Shouldn't they show? How can I make this work? Thanks so much!


title: Create cron job without a plugin?

text: Basically I wrote a function that lets me change the post status to draft depending of a field in the postmeta table:               /**      * Remove ads if they have been sold for over 5 days      */     function cp_remove_sold_ads(){              global $wpdb;         // Get all sold ads         $sold_ads = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "postmeta WHERE `meta_key` = 'cp_ad_sold_date' AND `meta_value` <> ''");              foreach ($sold_ads as $ad) {             $today = time();                  // Get day, month, year             $date = explode('-',get_post_meta($ad->post_id, 'cp_ad_sold_date', true));                  $sold_date = mktime(null, null, null, $date[1], $date[2], $date[0]);             $date_diff = $today - $sold_date;                  // Get the days difference             $sold_day_diff = floor($date_diff / (60*60*24));                  if ($sold_day_diff >= 5) {                 wp_update_post(array('ID' => $ad->post_id, 'post_status' => 'draft'));             }         }     }      This works fine, and if I add the function to the init action it does what its supposed to:               add_action( 'init' , 'cp_remove_sold_ads' );      However I'd like to make this action execute daily instead, I've been looking around and found that WP uses wp_schedule_event to hanlde cron jobs, but I have no idea how to use it, does anyone know what do I have to add to handle it? Thanks in advance!


title: Truncating varying lengths of information

text: I was helped not long ago with a form of custom truncating by Toscho on this post it works very well but I'm finding that I need to create multiple length variations for different bits of content. For instance on my support page I need to 80 max_chars vs. my home page which I need 200 max_chars. I tried adding a second instance of this function but unsurprisingly it totally killed other aspects of my site. As always, any help would be appreciated. Thanks guys!               function utf8_truncate( $string, $max_chars = 200, $append = "\xC2\xA0…" )     {         $string = strip_tags( $string );         $string = html_entity_decode( $string, ENT_QUOTES, 'utf-8' );         // \xC2\xA0 is the no-break space         $string = trim( $string, "\n\r\t .-;–,—\xC2\xA0" );         $length = strlen( utf8_decode( $string ) );              // Nothing to do.         if ( $length < $max_chars )         {             return $string;         }              // mb_substr() is in /wp-includes/compat.php as a fallback if         // your the current PHP installation doesn't have it.         $string = mb_substr( $string, 0, $max_chars, 'utf-8' );              // No white space. One long word or chinese/korean/japanese text.         if ( FALSE === strpos( $string, ' ' ) )         {             return $string . $append;         }              // Avoid breaks within words. Find the last white space.         if ( extension_loaded( 'mbstring' ) )         {             $pos   = mb_strrpos( $string, ' ', 'utf-8' );             $short = mb_substr( $string, 0, $pos, 'utf-8' );         }         else         {             // Workaround. May be slow on long strings.             $words = explode( ' ', $string );             // Drop the last word.             array_pop( $words );             $short = implode( ' ', $words );         }              return $short . $append;     }


title: Search multiple custom fields by using meta_query

text: I'm trying to create a search results listing for a custom post type and the problem I'm running in to is with the way the 'meta_query' parameter is stringing the passed values together. It appears to be treating each 'meta_query' value as an 'AND' rather than 'OR'. Here is the code I'm using:               $strsearch = 'lorem';     $args = array(         'post_type' => 'products',         'meta_query' => array(             array('key' => '_product_make','compare' => 'LIKE','value' => $strsearch),             array('key' => '_product_model','compare' => 'LIKE','value' => $strsearch)             )         ,'s' => $strsearch);     $resource_query = new WP_Query($args);      When I search anyone of the fields individually I get the desired results. When I use them together it comes up as not found since the string I'm searching for may only occur in one of the three fields listed below. Is there any way to have 'meta_query' treat each of the passed field comparisons as 'OR'?


title: Limit the length of the Author Profile Biographical Text

text: What it says on the tin: how can I limit the amount of text a user enters in the Biographical Info area of the User Profile? With a function? Or, jQuery if there is no way with a function? If it matters, I'm using `<?php echo $curauth->user_description; ?>` to grab the text. Thanks.


title: Changing background color depending on parent page?

text: I created a WordPress template and now I would like to use that template for several pages, however I would like to have different background color on some of the elements such as footer, header etc... which will depend on the parent. So lets say I have PARENT A (green background) and PARENT B (white background) now when I will create child of PARENT A I would like it to have green background automatically. I know something similar could be done with posts using               <div class="post <?php     foreach((get_the_category()) as $cat) {     echo $cat->cat_name . ' ';     } ?>">     </div>      I need some advice what would be the best way to do that.


title: How to avoid wordpress permalink rules to inherit in a sub-folder

text: I have WordPress installation on the root of a website, I need to install another application on a sub-folder but that application got its own set of rules for URLs on its .htaccess file, my problem is that WordPress takes the control, and when I try to go to a URL on that sub-folder WordPress would just show me an 404 error. I need the sub-folder app to work ignoring WordPress rules completely, or the opposite, WordPress to ignore the application on that sub-folder and leave it work on its own. Any ideas? Thanks! **UPDATE** I think I found a solution, on the inside folder .htaccess file I added the base url with the sub-folder on it, and now it is working.


title: Help with a custom page template - listing contents of childpages?

text: hey guys, I have no idea how to solve the following problem. I'd love to have a page-template that lists all it's child-pages but with the content. e.g. Imagine I have a page called "WORK. And "Work" has childpages like "Work 01", "Work 02", "Work 03", etc. I don't just want "WORK" to list the names of the childpages as a navigation, but rather just show all the pages under each other! Any idea how to solve that? Thank you.


title: Domain redirect in Wordpress multisite

text: I have two domains www.domain1.com and www.domain2.com, both pointing to the same host. What I want to do is redirect www.domain2.com to www.domain1.com/domain2. I got this code for a .htaccess from the hosting provider but is giving me a error "500 Internal Server Error" when I install it. What is the problem?               RewriteEngine On     RewriteCond% {HTTP_HOST} ^ [www.] domain1.com $ [NC]     RewriteCond% {REQUEST_URI}! ^ / domain2 / .*     ^(.*) RewriteRule / index / $ 1 [L]


title: Modify human_time_diff() to shorten "days" to "d" and "hours" to "h" etc

text: I'm using the function echo time_ago() that displays the time like this: **5 days ago** what's the best way to change it to **5d ago** ? My research led me to human_time_diff() function located in "formatting.php" So I have tried directly editing the function located at /wp- includes/formatting.php but when I change **"hours"** to **"h"** and so on... it goes crazy and gives me errors. I know modifying the core isn't the best way, so any ideas? Thank you.


title: How to retrieve the list of all posts ever published via the feed?

text: I'd like to customize the feed URL of a certain Wordpress-based blog that I don't own in order to show all posts ever published. This is because I like that blog and I want to read everything the author has written, without missing a single post. Is this possible? Or should I surf this blog manually? Thank you.


title: How can I add dropdown widget/box to admin post page?

text: I am trying to figure out how to add a dropdown widget to the post page. The reason I ask is because I would like to be able to have a few different post classes that the user can select while making a post that they can select. I figure I can use post_class and define a few different classes and allow the user to use this as a post template. Has anyone done this before and could lead me in the right direction?


title: Change labels of custom post type via child theme

text: I have a WordPress parent theme that uses a custom post type called `portfolio`, which I'd like to change to `property`. I'd like to have all of the contextual elements changed to show `property` like, `"show properties"`, `"add new property"`, `"delete property"`, etc.   I know I can do this by updating the parent theme, but I'd prefer not to, if I can avoid it. I found this answer, but unfortunately, I'm not PHP savvy enough to write my own function and change this. Can someone help me out with this? I'm kind of stuck.   I have a feeling this is something simple for a PHP Dev. I just don't know how to do it.


title: Why isn't my Twitter widget working in my theme?

text: I have Twitter's own widget set to load on my website, which works just fine. However, on my WP-powered blog the script is included but not rendered. I call it inside an empty `div` like this: > >     <?php include $_SERVER['DOCUMENT_ROOT'].'/twtr-widget.html' ?> >   But it appears in the page source as HTML (I'm putting '...' to save room): > >     <script src="http://widgets.twimg.com/j/2/widget.js"></script> >     <script> >     new TWTR.Widget({... >     ...</script> >   In other words, the script is not being executed. Why is this? EDIT: The blog is located here.


title: huge error log with database errors

text: The website started to behave erratically - so in the process of trying to restore a backup, I discovered that it had a error_log file with 1.2 million lines of errors. Most of these errors - most errors reading like ....               [27-Feb-2012 10:57:04] WordPress database error Table 'kidspart_kpbshop.wp_wpsc_product_categories' doesn't exist for query SELECT * FROM wp_wpsc_product_categories WHERE active = 1 ORDER BY name made by require, require_once, require_once, require_once, do_action, call_user_func_array, storefront_options      I remove this file, restored the site from an old backup a got a new error_log file which has already 496,000+ lines of error codes, mostly the same "doesn't exist" type errors. How can I sort out the problem? Is it a wp-ecommerce fault? Or what?


title: Change Wordpress's URL from "abc.com" to "abc.com/de"

text: I have a domain. Currently, the site loads at that domain's root-- `abc.com`\-- but I want it to to load at `abc.com/de` because I intend for the site to later become international. I looked already at these resources but they don't work for me:   http://wordpress.org/support/topic/easy-fix-changed-my-website-url   http://yoast.com/move-wordpress-blog-domain-10-steps/ (301 redirect wastes time) How can I do it?


title: Table of Contents with a shortcode

text:
I have this Table of Contents class below that will find all `<h2>` `<h3>` and `<h4>` tags in a wordpress post and it will create a Table of Contents out of them, it adds an ID to each heading so when you click a link it will take you to that part of the page. Here is a snapshot of what the generated TOC can look like... ![enter image description here](http://i.stack.imgur.com/q8hAL.png) Now the problem I have with this class it is simply finds all Headings and builds the TOC on page load, it then prepends the generated TOC to the beginning of the `$content` post. I would like to figure out a way where I can specify where the TOC will be shown in the post. So for example if a post has a featured image, then I would like to show the TOC below the image instead of at the very beginning of the post. Something like a `shortcode` would be ideal for this but I am not sure how to get it to work with a shortcode, I tried creating a shortcode which would run this class but it doesn't work as I am wanting it to, it doesn't create the TOC when I run it with a shortcode. Anyone have any ideas how to improve this and get it working as I describe? The class is ran with this Filter               add_filter('the_content', array('TableOfContents', 'writeTOC'));      The class               /**      * cd-table-of-contents.php      */          class TableOfContents {              /**          * Counts the occurence of header elements in Wordpress content          *           * @param type $content          * @return null|boolean|array          */         static function hasToc($tiers, $content) {                  $pattern = '/<h[2-' . $tiers . ']*[^>]*>(.*?)<\/h([2-' . $tiers . '])>/';             $return = array();             if (empty($content))                 return null;                  if (!preg_match_all($pattern, $content, $return)) {                 return false;             }             return $return;         }              /**          * Generates a table of content only when singular pages are being viewed          *           * @param type $tiers          * @param type $text          */         static function generateTableOfContents($tiers, $content, $draw = TRUE, $return = array()) {                  if (!is_singular())                 return $content;                  // numbers on or off?             $num_on = true;                  $content = $toc . $content;             $searches = array();             $replaces = array();             $return = (is_array($return) && !empty($return) ) ? $return : TableOfContents::hasToc($tiers, $content);                  if ($draw && !empty($return)):                 if($num_on){                     $toc = '
';                 }else{                     $toc = '
';                 }                      $toc .= "
Table of Contents
";                 $toc .= "
";                 $tags = reset($return);                 $titles = $return[1];                 $levels = end($return);                 $_level = 2;                 $chapters = array('0','0','0','0','0','0');                      $count = 0;                 foreach ($tags as $i => $htag) {                     $count++;                     $attributes = array();                     $href = $count;                          $newId = 'id="' . $href . '"';                     $newhtag = '>';                     $htagr = str_replace('>' . $titles[$i], "\t" . $newhtag  . $titles[$i], $htag);                     $searches[] = $htag;                     $replaces[] = $htagr;                               if ((int)$levels[$i] === (int)$_level):                         if($num_on){                             $chapters[$_level-1] = ((int)$chapters[$_level-1]+1);                             $chapter = implode('.', array_slice($chapters, 1, ($levels[$i]-1)  ) );                             $toc .= '
' . strval($chapter) . ' ' . $titles[$i] . '
';                         }else{                             $toc .= '
' . $titles[$i] . '
';                         }                          endif;                          if ($levels[$i] > $_level) {                         $_steps = ((int) $levels[$i] - (int) $_level);                              for ($j = 0; $j < $_steps; $j++):                             $toc .= '
';                             $chapters[$levels[$i]-1+$j] = (int)$chapters[$levels[$i]-1+$j]+1;                             $_level++;                         endfor;                         $chapter = implode('.', array_slice($chapters, 1, ($levels[$i]-1)  ) );                              if($num_on){                             $toc .= '
' . strval($chapter) . ' ' . $titles[$i] . '
';                         }else{                             $toc .= '
' . $titles[$i] . '
';                         }                          }                          if ($levels[$i] < $_level) {                              $_steps = ((int) $_level - (int) $levels[$i]);                         $chapters[$levels[$i]-1] = (int)$chapters[$levels[$i]-1]+1;                         $_olevel = $_level;                         for ($j = 0; $j < $_steps; $j++):                             $chapters[$levels[$i]+$j] = 0;                             $toc .= '
';                             $_level--;                         endfor;                              $chapters[$_olevel-1] = 0;                         $chapter = implode('.', array_slice($chapters, 1, ($levels[$i]-1)  ) );                              if($num_on){                             $toc .= '
' . strval($chapter) . ' ' . $titles[$i] . '
';                         }else{                             $toc .= '
' . $titles[$i] . '
';                         }                          }                 }                 $toc .= '
';                 $toc .= '

';                 $content = str_replace($searches, $replaces, $content);                 $content = $toc . $content;             endif;                  return $content;         }              /**          * Appends the table of content to the $content          * AKA. Executes our filter          *           * @param type $content          * @return type          */         static function writeToc($content) {                  $content = TableOfContents::generateTableOfContents(4, $content, TRUE);             return $content;         }          }          add_filter('the_content', array('TableOfContents', 'writeTOC'));


title: Odd/even class on article tag

text:
I am using the article tag with the following code:               <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix span4 '); ?> role="article">
      and I would like to add "odd" and "even" to the current `post_class`. I found the following code on other site:               <?php echo (++$j % 2 == 0) ? 'evenpost' : 'oddpost'; ?>      Why it isn't working with my code?               <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix span4 <?php echo (++$j % 2 == 0) ? 'evenpost' : 'oddpost'; ?>'); ?> role="article">


title: Remove specific page/post from feed

text: I'm working on a website with lots of tutorials/pages. I have made a separate rss feed for the pages - works fine. But then I had to create a sitemap (a page), and it shows up in my "pages" rss feed! **My Question:** How can I remove a specific post/page from a feed?


title: $query->query_var['post_type'] not set for pages

text: Bulding off of this response from @kaiser about being able to filter by post types on a search page, I wanted to be able to automatically add-in all of the public post types available. So, after some help with @kaiser, I came up with:               function sw_custom_post_type_includes($query) {         $args = array(             'public'   => true         );          $output = 'names'; // names or objects, note names is the default         $operator = 'and'; // 'and' or 'or'         $post_types = get_post_types( $args, $output, $operator );          if ( !is_search() && !in_array( get_post_type(), $post_types ) )             return;              $query->set( 'post_type', $post_types );         return $query;     }     add_filter('pre_get_posts', 'sw_custom_post_type_includes');      Which initially seemed to work great, but I ran into an issue -> everything filtered by post type correctly EXCEPT when I tried to use `&post_type=page`. I was actually getting an undefined index error for `post_type`. I couldn't figure out why this wasn't working. So, I decided to use `print_r($query->query_vars)` to see if everything was being pulled in correctly. Low and behold - for all post types EXCEPT for pages, that variable was set. I conferred with another dev on this and they verified the issue. This is what I ended up using as a workaround:               function sw_custom_post_type_includes($query) {         if(isset($_GET['post_type']) && ((!isset($query->query_vars['post_type'])) || (isset($query->query_vars['post_type']) && $query->query_vars['post_type'] != 'nav_menu_item'))) {             $query->set('post_type', urldecode($_GET['post_type']));         }     }     add_action('pre_get_posts', 'sw_custom_post_type_includes');      This honestly seems like an odd workaround for something that has been baffling me for a few hours. Anyone with input on this will be rewarded with virtual high-fives.


title: Need to get transaction id of the user logged in

text: I need to get the transaction id of the logged in the user.   I am Using wishlist Membership plugin with Clickbank They have an API. But I am not able to get the txnid of the logged in user using I was able to get member data using this               $member = wlmapi_get_member(1);     print_r($member);      Here is the result TxnID can be seen in the result page posted but how i can get the specific id of logged in current user ? ### Other way I have tried to get the values of transaction id from database but here the problem I am facing is the transaction id is not directly linked to the user id it is linked to the userlevel id which is different from the user id. So how could I get the transaction id of the logged in user which I would like to pass to a URL? My database tables images are shown in this link


title: Why do I get email notifications about comments that Wordpress has already determined are spam?

text: I have a wordpress.org blog that I host on my own site. I have the Akismet plugin installed, and in general I keep both up-to-date (e.g. at the moment, Akismet is at version 2.5.7, and Wordpress at 3.5.1). From time-to-time (maybe every week or so), I get a notification email from Wordpress that a (generally spam) comment needs moderating. When I log in to moderate it, Wordpress informs me that it has already been marked as spam (although I haven't marked it so, but I assume Wordpress means that Akismet has determined that). In this case, why do I get the notification email in the first place? Is Akismet failing to connect to the Akismet service, notifying me, and retrying later? If so, is it possible to turn off the initial notification email in this case? It's irritating to log in to moderate something only to discover Wordpress already knows the answer!


title: Unable to access MySQL in Powweb

text:
I wanted to retrieve my data in powweb's mysql but I get an error:                   Warning: mysql_connect() [function.mysql-connect]: Access denied for user      'snursing'@'walcustweb1601.int.bizland.net' (using password: YES) in      /hermes/waloraweb049/b2838/pow.snursing/htdocs/southjerseyrn/wp-content/plugins/wp-retrieve-database/powweb-connect.php on line 8             Unable to connect to MySQL      well basically, I cannot activate my wordpress plugin because of THAT error(note that there is no typo for details). My powweb-connect.php               <?php          $myServer = "username.powwebmysql.com";     $myUser = "username";     $myPass = "password";     $myDB = "dbname";              $s = mysql_connect($myServer, $myUser, $myPass)             or die("Unable to connect to MySQL");         $d = mysql_select_db($myDB, $s)             or die("Couldn't open database $myDB");               ?>      which is called by the main plugin:               <?php          /**      * Plugin Name: wp-retrieve-database      * Description: retrieves data from the database.      * Version: 0.5      * Author: Chan */               include_once('powweb-connect.php');     add_filter( 'the_content', 'get_scrapy_scraped' );          function get_scrapy_scraped( $content )     {         global $wpdb;              if ( ! is_page( 'jobs' ) )             return $content;              $table_name    = $wpdb->prefix . "Careers";         $retrieve_data = $wpdb->get_results( "SELECT * FROM $table_name" );              if ( ! $retrieve_data )             return $content;              $table = '

         Job Name	         Location/Dept	         Complete Info	         Application Link
';              foreach ( $retrieve_data as $row )         {             $table .= "
                 {$row->Job_Name}	                 {$row->Job_Department}	                 {$row->Job_Link_Info}	                 {$row->Job_Link_Apply}
";         }              $table .= "
";              return $table . $content;     }     ?>


title: Is it possible to activate page template without manually selecting it in wp-admin?

text: I'm launching a new WordPress theme and was wondering if it's possible to select and activate that specific page's template in code rather than going into the CMS and manually selecting it from the drop-down. I ask because once I launch the theme, a whole bunch of pages won't have a template associated with them until I manually select it and I have traffic visiting my site already.


title: How To Add One Tag to Multiple Posts?

text: I have nearly 1500 posts in my wordpress blog. Before moving to a new design, I need to tag all these posts with one tag 'old'. How can I do this? I tried to bulk edit posts and it will always go only upto 78 posts every time I tried. I tried increasing server limits and still it won't work! How can I do this?


title: How we store error/success messages to the next page

text: I am working on site. I uses some custom `error/success` messages for front end form but currently it display messages to on same page, But as soon as I refresh the page or redirect the user to next page messages not save. To save the `success messages` I use the `code`               $success = __('You have successfully Login.', 'frontendprofile');      And for the error messages I use the default varible that is `$error`. How can save them the for next page or for when if I refresh the page?


title: Can't custom taxonomies have same terms (slugs) as categories?

text: I knew that it's not possible to have same terms (term slugs) under categories and tags, but surprisingly, as I realized today, that's the case with custom taxonomies as well. So for instance, if my site has a category called `Linux (linux)` and I want to create a custom taxonomy term called 'Linux' as well, it'd look something like `Linux (linux-2)`, i.e. the slugs have to be different. And if I try to rename the slug back to `linux`, I get the error, _"The slug 'linux' is already in use by another term"_. Is it possible to have the same terms under categories/tags and custom taxonomies (without wreaking havoc)? * * * **How to replicate the issue?**   1. Create 3-5 new posts. Create a new category and tag and assign them to those posts (just for testing purposes).   2. Save permalink settings.   3. create two new terms under the custom taxonomy with the same name and slug as the category and tag you created earlier, and assign them to a new post under a custom post type.   4. Delete the custom taxonomies.   5. Try recreating them, and you'll now get the error: _"The slug 'XXX' is already in use by another term."_ Sometimes that'd replicate the issue, sometimes it doesn't. **But...** If you are able to create a category (or tag) and a custom taxonomy with the same name and slug, do it. Then, rename one of them, and you'll notice that both the category (or tag) and the custom taxonomy are renamed!


title: Does Wordpress have a built in message function for presenting notifications to users?

text: Does Wordpress have something similar to Drupal's drupal_set_message function? I want to notify the user of something and was hoping there was a built in API call to do this.


title: Stop Authors from submitting spam post

text: I am designing a frontend for users, where they can submit an article/post from. But i am worrying if someone puts javascipt code, or SQL injection, or other malicious code. Is there a plugin or some sort of scripts which can help me to filter the post contents from security point of view. I'll appriate if someone can suggest me some code/script/plugin which can help to define rule over submmited contents like   1. No. of external hyperlinks    2. No. of Images   3. Length of content etc. Although i can do it manually. So the lower part of the question is less important.


title: Not Found when using activity stream as front page with BuddyPress

text: I'm trying to create a Thematic child theme that uses BuddyPress. First, I tried using BuddyMatic -- which currently doesn't work with WP3. Next, I tried the BuddyPress compatibility pack -- which totally works! Except for one thing: when I select "Activity Feed" as an option for the front page, I get a Not Found error. Going to /activity/, /groups/, /members/, and all other BuddyPress pages, however, works fine. Any idea what the issue might be? Thanks!


title: Event Calendar on hosted wordpress?

text: I see a number of posts on various plugins for doing an Event Calendar that work with Wordpress, but the free hosted version does not allow me to use these. Are there any solutions that would work for hosting a calendar of events for an organization that I volunteer for? Even embedding a Live/Google calendar would work, although I understand that iframes are also not allowed. Thanks!


title: Why when I submit a form in wordpress it loads a 404 page though URL is correct

text:
I am just creating a simple contact form, but I notice that it seems to post to an invalid page. The url in the browser is correct but the title of the page is "Page not found" on the top of the page               $emailed = false;     if (isset($_POST['submit'])) {         wp_mail('example@example.com', $_POST['subject'], $_POST['content']);         $emailed = true;     }      below ... the HTML:               <form action="<?php the_permalink(); ?>" method="post" id="contactform">
             Name             <input type="text" name="name" class="required" />

             Email             <input type="text" name="email" class="required email" />

             Subject             <input type="text" name="subject" class="required" />

             Content             <textarea name="content" cols="30" rows="10" class="required"></textarea>
              <input type="submit" value="Submit Message" name="submit" value="submit" />     </form>


title: "Error: Options Page Not Found" on Settings Page Submission for an OOP Plugin

text:
I am developing a plugin using Tom McFarlin's Boilerplate repository as a template, which utilizes OOP practices. I've been trying to figure out exactly why I'm unable to correctly submit my settings. I've tried setting the action attribute to an empty string as suggested on another question around here, but that hasn't helped... Below is the general code setup I am using... **The Form (/views/admin.php):**

<?php echo esc_html( get_admin_page_title() ); ?>
         <form action="options.php" method="post">             <?php             settings_fields( $this->plugin_slug );             do_settings_sections( $this->plugin_slug );             submit_button( 'Save Settings' );             ?>         </form>
      For the following code, assume all of the callbacks for add_settings_field() and add_settings_section() exist, except for 'option_list_selection'. **The Plugin Admin Class(/{plugin_name}-class-admin.php):**               namespace wp_plugin_name;          class Plugin_Name_Admin     {         /**          * Note: Some portions of the class code and method functions are missing for brevity          * Let me know if you need more information...          */              private function __construct()         {             $plugin              = Plugin_Name::get_instance();                  $this->plugin_slug   = $plugin->get_plugin_slug();             $this->friendly_name = $plugin->get_name(); // Get "Human Friendly" presentable name                  // Adds all of the options for the administrative settings             add_action( 'admin_init', array( $this, 'plugin_options_init' ) );                  // Add the options page and menu item             add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );                   }              public function add_plugin_admin_menu()         {                  // Add an Options Page             $this->plugin_screen_hook_suffix =             add_options_page(                 __( $this->friendly_name . " Options", $this->plugin_slug ),                 __( $this->friendly_name, $this->plugin_slug ),                 "manage_options",                  $this->plugin_slug,                 array( $this, "display_plugin_admin_page" )             );              }              public function display_plugin_admin_page()         {             include_once( 'views/admin.php' );         }              public function plugin_options_init()         {             // Update Settings             add_settings_section(                 'maintenance',                 'Maintenance',                 array( $this, 'maintenance_section' ),                 $this->plugin_slug             );                  // Check Updates Option             register_setting(                  'maintenance',                 'plugin-name_check_updates',                 'wp_plugin_name\validate_bool'             );                  add_settings_field(                 'check_updates',                 'Should ' . $this->friendly_name . ' Check For Updates?',                 array( $this, 'check_updates_field' ),                 $this->plugin_slug,                 'maintenance'             );                  // Update Period Option             register_setting(                 'maintenance',                 'plugin-name_update_period',                 'wp_plugin_name\validate_int'             );                  add_settings_field(                 'update_frequency',                 'How Often Should ' . $this->friendly_name . ' Check for Updates?',                 array( $this, 'update_frequency_field' ),                 $this->plugin_slug,                 'maintenance'             );                  // Plugin Option Configurations             add_settings_section(                 'category-option-list', 'Widget Options List',                 array( $this, 'option_list_section' ),                 $this->plugin_slug             );         }     }      **Some Requested Updates:** Changing the action attribute to:               <form action="../../options.php" method="post">      ...simply results in a 404 Error. The following below is the excerpt of the Apache Logs. Note that the default WordPress scripts and CSS en-queues are removed:               # Changed to ../../options.php     127.0.0.1 - - [01/Apr/2014:15:59:43 -0400] "GET /wp-admin/options-general.php?page=pluginname-widget HTTP/1.1" 200 18525     127.0.0.1 - - [01/Apr/2014:15:59:43 -0400] "GET /wp-content/plugins/PluginName/admin/assets/css/admin.css?ver=0.1.1 HTTP/1.1" 304 -     127.0.0.1 - - [01/Apr/2014:15:59:43 -0400] "GET /wp-content/plugins/PluginName/admin/assets/js/admin.js?ver=0.1.1 HTTP/1.1" 304 -     127.0.0.1 - - [01/Apr/2014:15:59:52 -0400] "POST /options.php HTTP/1.1" 404 1305     127.0.0.1 - - [01/Apr/2014:16:00:32 -0400] "POST /options.php HTTP/1.1" 404 1305          #Changed to options.php     127.0.0.1 - - [01/Apr/2014:16:00:35 -0400] "GET /wp-admin/options-general.php?page=pluginname-widget HTTP/1.1" 200 18519     127.0.0.1 - - [01/Apr/2014:16:00:35 -0400] "GET /wp-content/plugins/PluginName/admin/assets/css/admin.css?ver=0.1.1 HTTP/1.1" 304 -     127.0.0.1 - - [01/Apr/2014:16:00:35 -0400] "GET /wp-content/plugins/PluginName/admin/assets/js/admin.js?ver=0.1.1 HTTP/1.1" 304 -     127.0.0.1 - - [01/Apr/2014:16:00:38 -0400] "POST /wp-admin/options.php HTTP/1.1" 500 2958      Both the php-errors.log file and the debug.log file when WP_DEBUG is true are empty. **The Plugin Class (/{plugin-name}-class.php)**               namespace wp_plugin_name;          class Plugin_Name     {         const VERSION = '1.1.2';         const TABLE_VERSION = 1;         const CHECK_UPDATE_DEFAULT = 1;         const UPDATE_PERIOD_DEFAULT = 604800;              protected $plugin_slug = 'pluginname-widget';         protected $friendly_name = 'PluginName Widget';              protected static $instance = null;              private function __construct()         {                  // Load plugin text domain             add_action( 'init',                         array(                 $this,                 'load_plugin_textdomain' ) );                  // Activate plugin when new blog is added             add_action( 'wpmu_new_blog',                         array(                 $this,                 'activate_new_site' ) );                  // Load public-facing style sheet and JavaScript.             add_action( 'wp_enqueue_scripts',                         array(                 $this,                 'enqueue_styles' ) );             add_action( 'wp_enqueue_scripts',                         array(                 $this,                 'enqueue_scripts' ) );                  /* Define custom functionality.              * Refer To http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters              */              }              public function get_plugin_slug()         {             return $this->plugin_slug;         }              public function get_name()         {             return $this->friendly_name;         }              public static function get_instance()         {                  // If the single instance hasn't been set, set it now.             if ( null == self::$instance )             {                 self::$instance = new self;             }                  return self::$instance;              }              /**          * The member functions activate(), deactivate(), and update() are very similar.          * See the Boilerplate plugin for more details...          *          */              private static function single_activate()         {             if ( !current_user_can( 'activate_plugins' ) )                 return;                  $plugin_request = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';                  check_admin_referer( "activate-plugin_$plugin_request" );                  /**              *  Test to see if this is a fresh installation              */             if ( get_option( 'plugin-name_version' ) === false )             {                 // Get the time as a Unix Timestamp, and add one week                 $unix_time_utc = time() + Plugin_Name::UPDATE_PERIOD_DEFAULT;                      add_option( 'plugin-name_version', Plugin_Name::VERSION );                 add_option( 'plugin-name_check_updates',                             Plugin_Name::CHECK_UPDATE_DEFAULT );                 add_option( 'plugin-name_update_frequency',                             Plugin_Name::UPDATE_PERIOD_DEFAULT );                 add_option( 'plugin-name_next_check', $unix_time_utc );                      // Create options table                 table_update();                      // Let user know PluginName was installed successfully                 is_admin() && add_filter( 'gettext', 'finalization_message', 99, 3 );             }             else             {                 // Let user know PluginName was activated successfully                 is_admin() && add_filter( 'gettext', 'activate_message', 99, 3 );             }              }              private static function single_update()         {             if ( !current_user_can( 'activate_plugins' ) )                 return;                  $plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';                  check_admin_referer( "activate-plugin_{$plugin}" );                  $cache_plugin_version         = get_option( 'plugin-name_version' );             $cache_table_version          = get_option( 'plugin-name_table_version' );             $cache_deferred_admin_notices = get_option( 'plugin-name_admin_messages',                                                         array() );                  /**              * Find out what version of our plugin we're running and compare it to our              * defined version here              */             if ( $cache_plugin_version > self::VERSION )             {                 $cache_deferred_admin_notices[] = array(                     'error',                     "You seem to be attempting to revert to an older version of " . $this->get_name() . ". Reverting via the update feature is not supported."                 );             }             else if ( $cache_plugin_version === self::VERSION )             {                 $cache_deferred_admin_notices[] = array(                     'updated',                     "You're already using the latest version of " . $this->get_name() . "!"                 );                 return;             }                  /**              * If we can't determine what version the table is at, update it...              */             if ( !is_int( $cache_table_version ) )             {                 update_option( 'plugin-name_table_version', TABLE_VERSION );                 table_update();             }                  /**              * Otherwise, we'll just check if there's a needed update              */             else if ( $cache_table_version < TABLE_VERSION )             {                 table_update();             }                  /**              * The table didn't need updating.              * Note we cannot update any other options because we cannot assume they are still              * the defaults for our plugin... ( unless we stored them in the db )              */              }              private static function single_deactivate()         {                  // Determine if the current user has the proper permissions             if ( !current_user_can( 'activate_plugins' ) )                 return;                  // Is there any request data?             $plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';                  // Check if the nonce was valid             check_admin_referer( "deactivate-plugin_{$plugin}" );                  // We'll, technically the plugin isn't included when deactivated so...             // Do nothing              }              public function load_plugin_textdomain()         {                  $domain = $this->plugin_slug;             $locale = apply_filters( 'plugin_locale', get_locale(), $domain );                  load_textdomain( $domain,                              trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );             load_plugin_textdomain( $domain, FALSE,                                     basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages/' );              }              public function activate_message( $translated_text, $untranslated_text,                                           $domain )         {             $old = "Plugin activated.";             $new = FRIENDLY_NAME . " was  successfully activated ";                  if ( $untranslated_text === $old )                 $translated_text = $new;                  return $translated_text;              }              public function finalization_message( $translated_text, $untranslated_text,                                               $domain )         {             $old = "Plugin activated.";             $new = "Captain, The Core is stable and PluginName was successfully installed and ready for Warp speed";                  if ( $untranslated_text === $old )                 $translated_text = $new;                  return $translated_text;              }          }      **References:**   * The Settings API     * add_settings_section()     * add_settings_field()     * register_setting()   * Creating Options Pages


title: Pages not appearing?

text: I've created 6 different custom post types, each with their own archive. I've also created a page with the same name as the custom post type, and a sub-page called 'About' for each. For some reason, I'm only able to access the About page under one Custom Post Type, even though I've checked to make sure the code in `functions.php` is the exact same for all of them. The live site is at test.isthispavilion.com; the code for each is:               add_action("init", "zac_init");          function zac_init() {         $labels = array(              'name' => _x('Shrike', 'post type general name'),              'singular_name' => _x('Shrike', 'post type singular name'),              'add_new' => _x('Add New', 'shrike'),              'add_new_item' => __('Add New Piece'),              'edit_item' => __('Edit Piece'),              'new_item' => __('New Piece'),              'view_item' => __('View Piece'),              'search_items' => __('Search Pieces'),              'not_found' => __('No pieces found'),              'not_found_in_trash' => __('No pieces found in Trash'),         );         $args = array(               'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'query_var' => true,             'rewrite' => array('slug' => 'shrike'),             'capability_type' => 'post',             'hierarchical' => false,             'menu_position' => null,             'supports' => array('title', 'editor', 'author', 'custom-fields', 'thumbnail', 'revisions', 'page-attributes', 'post-formats', 'excerpt'),             'taxonomies' => array('category', 'post_tag', 'portfolio'),             'with_front' => false,             'has_archive' => 'shrike',         );              register_post_type('shrike', $args, $taxonomies);     }      As you can see, http://test.isthispavilion.com/shrike/about/ works fine, but http://test.isthispavilion.com/darya/about/ is 'not found'. Has anyone experienced a similar problem? What might be causing it?


title: Let user change posts per page

text: How can I allow a user to have the option of choosing the number of posts to display per page? I'd like to have it similar to how it's done on this site: 15, 30, 50 per page (see the bottom of the page to the right of the pagination).


title: Wordpress post enumeration

text:
I am using wordpress as a quick fix for a blog for my site. I am using a short loop in an external page (i got the links to use the wordpress set-up correctly):               query_posts('p='.$thisPost); //$thisPost enumerates 1,2..etc up to a maximum number of posts          <?php      while (have_posts()): the_post(); ?>
<?php the_title(); ?>
     <?php the_content(); ?>     <?php endwhile; ?>      The issue that in the database the wordpress would store post #2 as "p=6", which essentially screws up this setup. How would I get a post number 2 ( or 3 or n ) from the start?


title: How do I order my loop query?

text: I have a table in my database containing vote a tally I'm trying to order posts by. screenshot: the table I've tried something like this, which brings up all the voted posts and pagination okay but does not order them by DESC. Any advice if I'm approaching this right is appreciated.                  <?php      global $wpdb;     $my_posts = $wpdb->get_col("SELECT like_pid FROM wp_likes_count ORDER BY like_count");     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args = array(         'post__in' => $my_posts['like_pid'],         'paged' => $paged,         'posts_per_page' => 6,              'order' => 'DESC'         );     query_posts($args); ?>                              <?php while (have_posts()) : the_post(); ?>                        <!-- do stuff -->                    <?php endwhile; ?>


title: How to Set an Individual Homepage for Each User?

text: I would like to give my users the ability to customize the homepage of the site. For example, if somebody is not logged in only the default categories appear. Once someone creates an account and logs in, he/she has opportunity to ' **add/follow** ' more categories and topics ( _tags_ ) and search results. These new posts will then be added to the stream on the homepage that they see. I've looked and searched a lot for tutorials and plugins, but I haven't found a lot. There is one premium theme though that kind of has this function. > Category watching Pressboard lets you set individual homepage for each user: > simply enable category watching so users can choose for themselves which > topics to load.   >  ( http://freetotry.me/pressboard/ -> settings button top right ) I want to replicate something similar like the above. But thinking about it, I'm not sure what would be the best approach.   * adding variables to the url (http://codex.wordpress.org/Function_Reference/add_query_arg) and save the result somewhere. And perhaps use jQuery to 'normalise' to url location afterwards.   * Enable rssfeeds for each tag, search results and category, where users can subscribe to. Store these feed values and build their homepage from those feeds.   * Add the categories/tags etc to their user profile to follow/unfollow, save that data and adjust the query post.   * Some other way?  Does anyone know how to achieve a custom homepage for each user?


title: What should I do when a plugin is not updated anymore?

text: The author of a plugin has abandoned it. The community has created patches and I have created updates. Right now it's in another public repository but it's becoming unyielding to maintain both. Is it possible to fork it? **UPDATE**   The link in the similar post provided some answers. But it did not answer can I create my own version?


title: Trying to exclude custom posts based on date, while sorting by custom field

text: I have a custom post type named "performance". I have a custom post query that orders posts by a custom field value (order-date). Now I want to exclude posts that have order-dates that are in the past. I would think I could use the same "order-date" value to compare against todays date to determine if a post should be shown, but I can't find an example that works with the ordering. Everything I've tried breaks the ordering. This seems to work!               <?php       $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;       $today = date('Y-m-d');       query_posts(array(         'post_type' => 'performance',          'posts_per_page' => 5,          'caller_get_posts' => 5,          'paged' => $paged,         'meta_key' => 'order-date',         'orderby' => 'meta_value',         'order' => 'ASC',         'meta_query' => array(           array(             'key' => 'order-date',             'meta-value' => $value,             'value' => $today,             'compare' => '>=',             'type' => 'CHAR'             )           )         ));     if (have_posts()) :     while (have_posts()) : the_post();     ?>      Note that I defined "$today" and added it to the meta_array for comparison with the meta-value. The past-dated performance items disappeared from the list and everything looks like it should. Thanks to Brady for putting me on the right track.


title: Custom Upload Panel in Menu Bar

text: I'd like to add a second custom Wordpress image uploader to the WP admin panel sidebar that will upload images to a specific directory. To be more specific I am designing a custom theme for a client and I have set up a custom Nivo Slider with a custom PHP function in the #slider div that pulls all images from a certain directory i.e. /wp-content/themes/my-theme/images/slider and displays them in the Nivo slider. How would I create a panel in the admin panel menu bar that would allow my client to upload new images to /wp- content/themes/my-theme/images/slider? Thanks y'all! JWinton


title: Why values dont shows in custom post column?

text:
I have some trouble.               /* Catalog */     function my_post_type_catalog() {         register_post_type( 'catalog',                     array(                      'label' => __('Catalog'),                      'public' => true,                      'show_ui' => true,                     'show_in_nav_menus' => true,                     'rewrite' => true,                     'hierarchical' => true,                     'menu_position' => 5,                     'supports' => array(                             'title',                             'editor',                             'thumbnail',                             'excerpt')                         )                      );         register_taxonomy('catalog_cat', 'catalog', array('hierarchical' => true, 'label' => 'Catalog category', 'singular_name' => 'catalog_category'));     }          add_action('init', 'my_post_type_catalog');               add_action("admin_init", "admin_init");          function admin_init(){         add_meta_box("catalogdetails_meta", "Price:", "catalog_meta",  "catalog", "normal", "low");     }          function catalog_meta() {       global $post;       $custom = get_post_custom($post->ID);       $price = $custom["price"][0];       ?>

<input name="price" size="35" value="<?php echo $price; ?>">

       <?php     }          add_action('save_post', 'save_details');          function save_details(){       global $post;            update_post_meta($post->ID, "price", $_POST["price"]);     }               // Register the column     function price_column_register( $columns ) {         $columns['price'] = __( 'Price' );              return $columns;     }     add_filter( 'manage_edit-catalog_columns', 'price_column_register' );               // Display the column content     function price_column_display( $column_name, $post_id ) {         if ( 'price' != $column_name )             return;              $price = get_post_meta($post_id, 'price', true);         if ( !$price )             $price = '' . __( 'undefined' ) . '';              echo $price;     }     add_action( 'manage_catalog_post_custom_column', 'price_column_display', 10, 2 );               // Register the column as sortable     function price_column_register_sortable( $columns ) {         $columns['price'] = 'price';              return $columns;     }     add_filter( 'manage_edit-catalog_sortable_columns', 'price_column_register_sortable' );               function price_column_orderby( $vars ) {         if ( isset( $vars['orderby'] ) && 'price' == $vars['orderby'] ) {             $vars = array_merge( $vars, array(                 'meta_key' => 'price',                 'orderby' => 'meta_value_num'             ) );         }              return $vars;     }     add_filter( 'request', 'price_column_orderby' );      The price values not shows. What do I wrong ?   ... Thanks for **@Brady** need replace this code:               // Display the column content     function price_column_display( $column_name, $post_id ) {         if ( 'price' != $column_name )             return;              $price = get_post_meta($post_id, 'price', true);         if ( !$price )             $price = '' . __( 'undefined' ) . '';              echo $price;     }     add_action( 'manage_catalog_post_custom_column', 'price_column_display', 10, 2 );      to:               // Display the column content     add_action('manage_catalog_posts_custom_column', 'sc_stores_manage_columns', 10, 2);     function sc_stores_manage_columns($column_name, $id) {         $custom = get_post_custom($id);         switch ($column_name) {             case 'price':                 if ($custom["price"][0]==""){echo "none";}                 echo $custom["price"][0];             break;         }     }


title: Writing a cache manifest file for a WordPress blog (app cache, offline web applications)

text: I'm wondering if anyone has implemented Offline Web Applications from HTML5 in a WordPress blog? When you write a manifest file, all files must be accounted for, thought you can specify the wildcard * in the NETWORK section. So, given how MANY files and dirs makeup a typical WordPress install, does anyone have guidance on which files/dirs should be cached, and which can be fetched from the network? Here's what I figure I need in the CACHE (explicit) section:   * the theme I'm using (so wp-content/theme/theme-name & associate files)   * wp-content/uploads/ + everything inside Here's what I'm thinking of leaving OUT of the cache (i.e being caught by the * in the NETWORK section):   * the wp-admin/ folder and all its content   * wp-content/upgrade/    * wp-content/plugins/ I'm unsure whether to cache anything in the wp-includes/ folder or not. The other problem I foresee is that since the uploads/ file will be changing as images are added, I am going to have to update my cache.manifest for each new piece of content -- unless I am ok with that images/video/whatever not caching. Any thoughts on this from someone who's done it, or been thinking about doing it?


title: Can I upgrade plugins via FTP?

text: I'm having some trouble upgrading my plguins through the Dashboard, If i upgrade plugins manually via FTP, will i lose any info from plugins like statpress and all in one seo?


title: How to include this jQuery File in wordpress?

text:
Ok I have this jQuery that I have tested in a static html page and it works fine. How would I include jQuery to work on wordpress in a plugin? So this is the html page.                    <title> Welcome to my page</title>     <link rel="stylesheet" type="text/css" href="css/style.css">     <link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8.17.custom.css">                         Google      a powerful search engine
                               SO this is the jQuery file that works for this html page               $('a').mousemove(function(){              $('#hoovertext').show();          });          $('#hoovertext').mouseleave(function(){         $(this).fadeOut();          });      Basically I want this jQuery to work on specific words on my wordpress site.. in the sense that when somebody hovers mouse over text it gives a description. exactly what my code above does. Can somebody please show me how, since I including jQuery into wordpress is the one thing that I still don't quite understand. Thanks.


title: Customize Activity Stream - Buddypress

text: Where would I begin if I wanted to rename a string in the buddypress activity stream? Instead of it saying "so and so wrote a new post", I would like it to say "so and so wrote a new **article** " (or whatever word I choose) Thanx.


title: Replace image attributes for lazyload plugin (data-src)

text: I want to apply jquery lazyload plugin. For this to work I have to create a new attribute which is data-src place there the src value and then replace the src value with a specific value `'...nothing.gif'`. I found a solution on wordpress.org support ### This is my adapted code -               function add_lazyload($content)      {         global $post;         $search = '/src\=\"([^\s]+(?=\.(bmp|gif|jpeg|jpg|png))\.\2)\"/';         $content = replacer($content, $search, '/src/', 'data-original');         $search = '/img\ class\=\"/';         $content = replacer($content, $search, '/class\=\"/', 'class="lazy ');         $search = '/alt/';         $content = replacer($content, $search, '/alt/', 'src="'.get_template_directory_uri().'/library/images/nothing.gif"');         return $content;     }          function replacer($src, $search, $find, $replace)     {         preg_match_all($search, $src, $result, PREG_OFFSET_CAPTURE);         foreach($result[0] as $entry)         {             $org = $entry[0];             $rep = preg_replace($find, $replace, $entry[0]);             $org = "/" .str_replace(array("=",":","/",".","-","_",'"',"'"," "),     array("\=","\:","\/","\.","\-","\_",'\"',"\'","\ "), $org). "/";             $src = preg_replace($org, $rep, $src);         }     return $src;     }          add_filter('the_content', 'add_lazyload');      The problem with this code is that it replaces every `alt` string (for example in a paragraph) with `.../library/images/nothing.gif`, not just the alt image attribute. Does anyone know how to solve this?


title: How can I get Taxonomy Images to work with 'orderby' argument?

text:
I'm using the Taxonomy Images plugin and am trying to sort the taxonomy but Taxonomy Images isn't playing nice. This works:               $terms = get_terms( 'work_cat', $args );      but this doesn't:               $terms = apply_filters( 'taxonomy-images-get-terms', '', $args );      Any ideas? Here's the full query:               <?php         $args = array(             'taxonomy'     => 'work_cat',             'orderby'      => 'id',             'order'        => 'ASC',             'hierarchical' => 1,         );              $terms = apply_filters( 'taxonomy-images-get-terms', '', $args );              $i = 0;         $len = count($categories);         foreach ($terms as $term) {         ?>             <div class="fourcol <?php if ($i == 0): ?> first<?php elseif ($i == $len - 1): ?> last<?php endif; ?>">             <a href="<?php echo get_term_link($term->slug, 'work_cat'); ?>"><?php echo wp_get_attachment_image( $term->image_id, 'full' ); ?>
<?php echo $term->name; ?>

<?php echo $term->description; ?>
             <a href="<?php echo get_term_link($term->slug, 'work_cat'); ?>">See More »
              <?php $i++;         }     ?>      Original post: http://wordpress.org/support/topic/plugin-taxonomy-images- doesnt-adhere-to-orderby-argument


title: Different URL for homepage then all your other pages

text: I'm using a theme (in this case woocommerce) but doesnt matter not a theme specific question. And I want to have the homepage on main domain like domain.nl and have all the other pages on product.domain.nl. So all the links/menu links, should be pointing to the subdomain. But the homepage should be on the main domain. Is there any easy way to do this? And if not what would be the hard way to do it?


title: forming WP_Query for posts of all post types but from specific categories

text: I need to get post from blog, custom post type 1, custom post type 2. custom post type 3 and either from category 1 or category 2 or category 3 or category 4 or category 5 or category 6 or category 7 or category 8. I have this but isn't working. I get no results, no errors either.               <?php               function filter_where_categs() {             $where .= " AND (category_name => array('black-star-crescent-moon', 'audio', 'blackward', 'ghost', 'protect', 'remember', 'return', 'video'))";             return $where;         }              $args=array(             'post_type'=> array( 'test-bscm', 'post', 'test-btum', 'test-other' ),             'posts_per_page' => 19         );              $temp = $wp_query;          $wp_query = null;         $wp_query = new WP_Query();         add_filter('posts_where', 'filter_where_categs');         $wp_query->query($args);          ?>


title: Theme's default styles are overriding my plugin's custom CSS

text: I have created a little plugin that creates a widget that I've made, basically just a pretty `<ul>` element. Unfortunately, all default widget styles are overriding my custom CSS, and adding `!important` to certain styles are breaking a few things due to various sizes and color variations. Is there a way around this? I just want the stylesheet to work for the one widget I have made and it not load from the defaults. Any tips/suggestions would be greatly appreciated.


title: wp_mail bcc admin

text: I've this code and he does exactly what i want but i want to add the username of the author of the post.                           // BCC Admin             if (get_option('jr_bcc_apply_emails')=='yes') :                 wp_mail( get_option('admin_email'), __('[copy] going for "', APP_TD).$post->post_title.'"',  $message, '', $attachments );             endif;      i tried this id_author in almost everywhere but don't work.               .., APP_TD).$post->post_title.'".$post->id_author',  $message, '', $attachments );      Someone could help me?


title: Scheduling doesn't work due to caching?

text: I'm using W3 Total Cache and Nginx with Varnish, and I'm very happy with the speed. However, I noticed that when I schedule a post, the post doesn't get automatically posted when I'm a _visitor_. When I'm logged in as an _admin_ and I reload the page it correctly posts the new content. Varnish config (default.vcl)               #     # Varnish 3 configuration for Wordpress     #     # On Debian OS:  /etc/varnish/default.vcl     #     # Nicolas Hennion (aka) Nicolargo     #          # Set the default backend (Nginx server for me)     backend default {         # My Nginx server listen on IP address 127.0.0.1 and TCP port 8080         .host = "127.0.0.1";         .port = "8080";         # Increase guru timeout         # http://vincentfretin.ecreall.com/articles/varnish-guru-meditation-on-timeout         .first_byte_timeout = 300s;     }          # Forbidden IP ACL     acl forbidden {         "41.194.61.2"/32;         "192.54.144.229"/32;     }          # Purge ACL     acl purge {         # Only localhost can purge my cache         "127.0.0.1";         "localhost";     }          # This function is used when a request is send by a HTTP client (Browser)      sub vcl_recv {         # Block the forbidden IP addresse         if (client.ip ~ forbidden) {                 error 403 "Forbidden";         }              # Only cache the following sites         #if ((req.http.host ~ "(blog.nicolargo.com)") || (req.http.host ~ "(blogtest.nicolargo.com)")) {          if ((req.http.host ~ "(blog.nicolargo.com)")) {              set req.backend = default;          } else {              return (pass);          }              # Compatibility with Apache format log         if (req.restarts == 0) {             if (req.http.x-forwarded-for) {                     set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip;             } else {                 set req.http.X-Forwarded-For = client.ip;             }          }              # Normalize the header, remove the port (in case you're testing this on various TCP ports)         set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");              # Allow purging from ACL         if (req.request == "PURGE") {             # If not allowed then a error 405 is returned             if (!client.ip ~ purge) {                 error 405 "This IP is not allowed to send PURGE requests.";             }                # If allowed, do a cache_lookup -> vlc_hit() or vlc_miss()             return (lookup);         }              # Post requests will not be cached         if (req.request == "POST") {             return (pass);         }              # --- Wordpress specific configuration              # Did not cache the RSS feed         if (req.url ~ "/feed") {             return (pass);         }              # Blitz hack             if (req.url ~ "/mu-.*") {                     return (pass);             }                   # Did not cache the admin and login pages         if (req.url ~ "/wp-(login|admin)") {             return (pass);         }              # Remove the "has_js" cookie         set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", "");              # Remove any Google Analytics based cookies         set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");              # Remove the Quant Capital cookies (added by some plugin, all __qca)         set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", "");              # Remove the wp-settings-1 cookie         set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-1=[^;]+(; )?", "");              # Remove the wp-settings-time-1 cookie         set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-time-1=[^;]+(; )?", "");              # Remove the wp test cookie         set req.http.Cookie = regsuball(req.http.Cookie, "wordpress_test_cookie=[^;]+(; )?", "");              # Are there cookies left with only spaces or that are empty?         if (req.http.cookie ~ "^ *$") {                 unset req.http.cookie;         }              # Cache the following files extensions          if (req.url ~ "\.(css|js|png|gif|jp(e)?g|swf|ico)") {             unset req.http.cookie;         }              # Normalize Accept-Encoding header and compression         # https://www.varnish-cache.org/docs/3.0/tutorial/vary.html         if (req.http.Accept-Encoding) {             # Do no compress compressed files...             if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {                     remove req.http.Accept-Encoding;             } elsif (req.http.Accept-Encoding ~ "gzip") {                     set req.http.Accept-Encoding = "gzip";             } elsif (req.http.Accept-Encoding ~ "deflate") {                     set req.http.Accept-Encoding = "deflate";             } else {                 remove req.http.Accept-Encoding;             }         }              # Check the cookies for wordpress-specific items         if (req.http.Cookie ~ "wordpress_" || req.http.Cookie ~ "comment_") {             return (pass);         }         if (!req.http.cookie) {             unset req.http.cookie;         }              # --- End of Wordpress specific configuration              # Did not cache HTTP authentication and HTTP Cookie         if (req.http.Authorization || req.http.Cookie) {             # Not cacheable by default             return (pass);         }              # Cache all others requests         return (lookup);     }          sub vcl_pipe {         return (pipe);     }          sub vcl_pass {         return (pass);     }          # The data on which the hashing will take place     sub vcl_hash {         hash_data(req.url);         if (req.http.host) {             hash_data(req.http.host);         } else {             hash_data(server.ip);         }              # If the client supports compression, keep that in a different cache             if (req.http.Accept-Encoding) {                 hash_data(req.http.Accept-Encoding);         }              return (hash);     }          sub vcl_hit {         # Allow purges         if (req.request == "PURGE") {             purge;             error 200 "Purged.";         }              return (deliver);     }          sub vcl_miss {         # Allow purges         if (req.request == "PURGE") {             purge;             error 200 "Purged.";         }              return (fetch);     }          # This function is used when a request is sent by our backend (Nginx server)     sub vcl_fetch {         # For static content strip all backend cookies         if (req.url ~ "\.(css|js|png|gif|jp(e?)g)|swf|ico") {             unset beresp.http.cookie;         }              # A TTL of 30 minutes         set beresp.ttl = 1800s;              return (deliver);     }          # The routine when we deliver the HTTP request to the user     # Last chance to modify headers that are sent to the client     sub vcl_deliver {         if (obj.hits > 0) {              set resp.http.X-Cache = "cached";         } else {             set resp.http.x-Cache = "uncached";         }              # Remove some headers: PHP version         unset resp.http.X-Powered-By;              # Remove some headers: Apache version & OS         unset resp.http.Server;              return (deliver);     }          sub vcl_init {         return (ok);     }          sub vcl_fini {         return (ok);     }      nginx (examplesite.conf)               server {         ## Your website name goes here.         server_name examplesite.com www.examplesite.com;         ## Your only path reference.         root /var/www/examplesite.com;         listen 8080;         ## This should be in your http block and if it is, it's not needed here.         index index.html index.htm index.php;         ##set body size         client_max_body_size 20M;                   include conf.d/drop;                  location / {                     # This is cool because no php is touched for static content                 try_files $uri $uri/ /index.php?q=$uri&$args;             }                  location ~ \.php$ {                 fastcgi_intercept_errors on;                 include fastcgi_params;                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                 fastcgi_pass unix:/dev/shm/php-fpm-www.sock;                       }               # BEGIN W3TC Page Cache cache     location ~ /wp-content/w3tc/pgcache.*html$ {         add_header Vary "Accept-Encoding, Cookie";     }     location ~ /wp-content/w3tc/pgcache.*gzip$ {         gzip off;         types {}         default_type text/html;         add_header Vary "Accept-Encoding, Cookie";         add_header Content-Encoding gzip;     }     # END W3TC Page Cache cache     # BEGIN W3TC Browser Cache     gzip on;     gzip_types text/css application/x-javascript text/x-component text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;     location ~ \.(css|js|htc)$ {     }     location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {     expires 1y;     log_not_found off;     }     location ~ \.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ {     }     location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ {     }     # END W3TC Browser Cache     # BEGIN W3TC Page Cache core     rewrite ^(.*\/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 last;     set $w3tc_rewrite 1;     if ($request_method = POST) {         set $w3tc_rewrite 0;     }     if ($query_string != "") {         set $w3tc_rewrite 0;     }     if ($http_host !~ "examplesite.com") {         set $w3tc_rewrite 0;     }     set $w3tc_rewrite3 1;     if ($request_uri ~* "(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|\/feed\/|wp-.*\.php|index\.php)") {         set $w3tc_rewrite3 0;     }     if ($request_uri ~* "(wp\-comments\-popup\.php|wp\-links\-opml\.php|wp\-locations\.php)") {         set $w3tc_rewrite3 1;     }     if ($w3tc_rewrite3 != 1) {         set $w3tc_rewrite 0;     }     if ($http_cookie ~* "(comment_author|wp\-postpass|wordpress_\[a\-f0\-9\]\+|wordpress_logged_in)") {         set $w3tc_rewrite 0;     }     if ($http_user_agent ~* "(W3\ Total\ Cache/0\.9\.2\.4)") {         set $w3tc_rewrite 0;     }     set $w3tc_ua "";     set $w3tc_ref "";     set $w3tc_ssl "";     set $w3tc_enc "";     if ($http_accept_encoding ~ gzip) {         set $w3tc_enc _gzip;     }     set $w3tc_ext "";     if (-f "$document_root/wp-content/w3tc/pgcache/$request_uri/_index$w3tc_ua$w3tc_ref$w3tc_ssl.html$w3tc_enc") {         set $w3tc_ext .html;     }     if ($w3tc_ext = "") {       set $w3tc_rewrite 0;     }     if ($w3tc_rewrite = 1) {         rewrite .* "/wp-content/w3tc/pgcache/$request_uri/_index$w3tc_ua$w3tc_ref$w3tc_ssl$w3tc_ext$w3tc_enc" last;     }     # END W3TC Page Cache core          }      How can I fix this? Thanks!


title: How to support letting users add their OWN logo to a custom theme?

text: I am a rookie theme developer (3 months in) and I am trying to figure out how to implement the following functionality:   1. The theme I am building has a logo which I would like for users **to be able to change**.   2. I'd like for them to NOT have to do so in the code.    3. Rather I'd like to develop some type of low-tech "Theme Control Panel" or some such thing where they can add the logo to the header. **Here is ascreenshot so you can see more clearly what I am trying to do.** I am using Theme-Check which is currently telling me: > RECOMMENDED: No reference to add_custom_image_header was found in the theme. > It is recommended that the theme implement this functionality if using an > image for the header. But I don't **think** this applies to my theme as I am NOT using the ENTIRE header for an image. Rather, just a portion is used for the logo (plus it is absolutely positioned). So is there some **template tag** which can accomplish this? Cuz, I surely cant find it in the Codex. Thanks In Advance, sleeper