Seriously stuck with some custom meta box/plugin stuff

I’m working on a small plugin - part of it needs to add several meta boxes to all custom post types. I’ve tried looping through my array of custom port types in various ways but I keep getting errors that I’ve already called functions such as add_meta_box. The script below is my latest effort, it’s not saving values from the last three meta boxes (only the first). I really want to reduce the size of this. I’m using a class, as per some stuff I learned on a plugin course on net tuts. It’s worked ok for other things, but PHP is not my strength and so I’m pretty damn stuck! Can someone help me loop through or pass the array of custom post types to the function add_meta_box? Here is the part of relevant script, sorry it’s a big large..               //meta boxes...         public function meta_boxes(){         //load the array into a var         $all_post_types = $this->post_types;                  $just_trades = array();             foreach($all_post_types as $trade){                 $just_trades[] = $trade['post_type_name'];               }             //call the action              add_action('add_meta_boxes','make_meta_box');             function make_meta_box(){             //make array of all meta boxes we want to show..                  add_meta_box('landline','Landline Phone Number','landline_function',$just_trades);//id, UI, the function, what page it shows on             add_meta_box('mobile','Mobile Phone Number','mobile_function',$just_trades);//id, UI, the function, what page it shows on             add_meta_box('email','Email Address','email_function',$just_trades);//id, UI, the function, what page it shows on             add_meta_box('website','Website URL','website_function',$just_trades);//id, UI, the function, what page it shows on                  }             function landline_function($post){ // function that makes the HTML for the admin UI             $landline = get_post_meta($post->ID,'landline',true);// id is available, the key we want, return a single or array value. Single for this.             ?>             <label for="landline">Landline Number: </label>             <input type="text" class="widefat" name="landline" id="landline" value="<?php echo $landline;?>" />             <?php                }             add_action('save_post','save_landline');             function save_landline($id){ // ID is available by default                       if(isset($_POST['landline'])){                   update_post_meta($id,'landline',strip_tags($_POST['landline']));                     }                  }             function mobile_function($post){ // function that makes the HTML for the admin UI             $mobile = get_post_meta($post->ID,'mobile',true);// id is available, the key we want, return a single or array value. Single for this.             ?>             <label for="mobile">Mobile Number: </label>             <input type="text" class="widefat" name="mobile" id="mobile" value="<?php echo $mobile;?>" />             <?php                }             add_action('save_post','save_mobile');             function save_mobile($id){ // ID is available by default                       if(isset($_POST['mobile'])){                     update_post_meta($id,'mobile',strip_tags($_POST['mobile']));                     }                  }             function email_function($post){ // function that makes the HTML for the admin UI             $email = get_post_meta($post->ID,'email',true);// id is available, the key we want, return a single or array value. Single for this.             ?>             <label for="email">Email: </label>             <input type="text" class="widefat" name="email" id="email" value="<?php echo $email;?>" />             <?php                }             add_action('save_post','save_email');             function save_email($id){ // ID is available by default                       if(isset($_POST['email'])){                  update_post_meta($id,'email',strip_tags($_POST['email']));                   }                  }             function website_function($post){ // function that makes the HTML for the admin UI             $website = get_post_meta($post->ID,'website',true);// id is available, the key we want, return a single or array value. Single for this.             ?>             <label for="website">Website: </label>             <input type="text" class="widefat" name="website" id="website" value="<?php echo $website;?>" />             <?php                }             add_action('save_post','save_website');             function save_website($id){ // ID is available by default                       if(isset($_POST['website'])){                    update_post_meta($id,'website',strip_tags($_POST['website']));                   }                  }              }      ..any help would be great. Dan.


Creating a custom menu with images as each link

In my current template my main navigation is output by a simple wp_nav_menu function. Now I am thinking of replacing it with a unordered list with background images in css. Assuming I do this I need to put in the direct link to the page, including it's id#, is there a wordpress function that will allow me to grab each pages location separately and place it in the corresponding list item for my main navigation I am creating. **something like**


Add Post Tags to Body Class

Want to add post tag name to body class - I am successful in using the code below to add category to body class -                //adds new body class for post category     add_filter('body_class', 'add_category_class_single');     function add_category_class_single($classes){          global $post;              $category = get_the_category($post->ID);         $slug = $category[0]->slug;         $classes[] = 'post-category-' . $slug;              return $classes;      }      however when i try to use get_the_tags i am not having any luck - any ideas?


why are the term_id and term_taxonomy_id doesn't match on custom taxonomies, but are duplicates on categories

In the wp_term_taxonomy table if I look at the category taxonomy, and then look at all its term_id and term_taxonomy_id, they are all identical. But when I look at the last 4, which are from my custom taxonomy, they don't match. What is a good explanation for this. I am not allowed to add images yet since I am new, so, I am adding a link to the screen-shot. Thanks. Screen Shot


How do I hook an Ajax request into a PHP callback?

Following the directions here http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Administration_Side I wrote this code: EDITED TO INCLUDE DIE(), STILL NOT WORKING               function my_button() {     echo     "<script type = 'text/javascript'>     function ajaxRequest(){         jQuery(document).ready(function(jQuery) {             var sendData = {};             sendData['action'] = 'my_action';             sendData['external_id'] = '$postID';             sendData['title'] = '$post_title';             sendData['content'] = '$post_content';             jQuery.ajax({                 type: 'POST',                 url: 'http://lvh.me:3000/s/wp',                 xhrFields: {                     withCredentials: true                 },                 headers: {'X-Requested-With': 'XMLHttpRequest'},                 data: sendData,                 error: function(jqXHR){                     console.log(jqXHR.responseText);                 },                 success: function(data){                     window.open(data['link']);                 }             });         })     };     </script>     <input type='button' onclick='ajaxRequest()' value='Send' />";     }          add_action( 'dbx_post_sidebar', my_button);          add_action('wp_ajax_my_action', my_action_callback);          function my_action_callback() {       global $wpdb; // this is how you get access to the database       $api_key = $_POST['api_key'];       $user = wp_get_current_user();       $user_id = $user->ID;       add_user_meta($user_id, 'my_api_key', $api_key);       die();     }      I know that's a ton of code, but I just can't figure out where the error is. Thanks a ton.


Fallback when Transient API fails

I'm trying to figure out how to best solve an issue I have with 3rd party API's (OG, Foursquare, Yelp, etc.). I use the transient API to call and store the various data in order to:   1. Not exceed any API limits   2. Increase load speed However, **the issue arises when a new API call errors out** for whichever reason; either there was an issue with the connection, or the API itself was down (hello foursquare). This leads to a scenario where you have no new data and the old data timed out (which is essentially what triggered a new transient to generate). How do you deal with such situations? The **solution I have in mind** is to create a static option within the refresh function that stores a successful response or brings up the last successful response on an error, for example :               <?php          function refresh_api_data() {          ... perform API call ...          if ( $response->status == 'error' ) {          $response = get_option( 'fallback_data' );     } else {          update_option( 'fallback_data', $response );     }          return $response;          }          ?>      Does this make sense, or does anyone have a more elegant solution in mind? Thank you!


How to check what kind of saving it is?

I use `save_post` hook, and I have to know inside this hook function, whether it is a publishing ( `draft to publish` ) or is it an updating, like `publish to publish` or `draft to draft`. Is there a way to check it? I can not use `draft_to_publish` hook for this, and I'll explain why:   The users ask questions on the site, and questions are saved as `draft` posts. A site admin write an answer and then publish the post. A post has `meta box` "status" that can have next values: "not answered", "treatment", "answered". A site admin may change this value as he wants, but when he publish the post (draft to publish, or draft to private), this meta value must be changed automatically to "answered" (although that the `input area` on admin area has another value). So I have a function that fired on `save_post` hook, that save all values according to `input area` values. And also I tried to use `draft_to_publish` hook to assign "answered" to the meta value. The problem is that `save_post` always fired after `draft_to_publish`, so that the value ("answered" that assigned on `draft_to_publish`) is overridden by the value of `input area`.


Display HTML5 jQuery Audio Player On Front Page

I would like to display the plugin _HTML5 jQuery Audio Player_ 'centered' on the front page of my site. The plugin comes with shortcodes for posts and pages but my front(home page) only works with the `'set front page to posts'` option. I'm new to this coding business, so I guess I need to call the plugin from the `index.php` template file.


WP Category Meta plugin fix?

Does anyone know of a fix for WP Category Meta http://wordpress.org/extend/plugins/wp-category-meta/ or a similar solution to add images and meta data to categories? With the latest version of WP it doesn't work anymore and I really need it to work since one of my themes depends heavily on it. If there's any coder that can make it work, I might even drop some $


admin insert media pop up hooks

I want to add the url to a specific image size in the add media (clicking the add media button in the post). At the moment I am adding the image to the post and getting the url and grabbing the url form the img source. I found a function to add the url of the "base" image here, but I need to get the url to a specific image size & for ease add this to the insert into post options.. Anyone help me out?


Remove wpautop from shortcode content / remove whitespace in buffering

I am using the Mailchimp plugin ( http://wordpress.org/extend/plugins/mailchimp/ )and it has a shortcode that uses output buffering to grab it's widget's code and spit it out in the content. however, the widget code has plenty of white space, so the_content filters are throwing useless linebreaks (like after hidden inputs) and empty p tags everywhere... rendering it unusable. I am removing the shortcode to add my own, but i'm not sure what to do to prevent the wordpress wpautop filter from going crazy. my initial thought was to strip out the whitespaces between html tags, but i don't know how to go about doing that. ideally the plugin would concentenate a string to return instead of using output buffering, but i don't know if they'll ever bother.


how to redirect to url.com/wp-admin if url.com/admin is typed in?

How would I create a wordpress function that will redirect a user to myurl.com/wp-admin if they type in myurl.com/admin? I would like to have this as a wordpress function.


After changing permalink structure, How to redirect attachment url to old parent post url

I change my permalink structure successfully. /%year%/%monthnum%/%postname%/ --> /%category%/%postname%/%post_id%/ But now I face a problem. Before change my permalink, I redirect my attachment url to parent post url through Yoast seo plugin and it works well. But after changing permalink structure, it doesn't work and show so many not found errors. Attachment redirection works only for my new permalink structure but not for old permalink sturcutre, I also follow this step and it works well. But my issue is little bit different. My permalink structure was /%year%/%monthnum%/%postname%/ before 21st January, 2013. I redirected Attachment url to parent post url through Yoast's seo plugin and it works. But after 21st January, 2013, I change my permalink structure. /%category%/%postname%/%post_id%/ and I redirect my old permalink structure to new permalink structure. (with Simple 301 Redirects plugin) I uncheck Attachment url to parent post url in Yoast's seo plugin and then once again check the box of Attachment url to parent post url. So that refresh Yoast's seo plugin and it works normally. But it works only with new permalink structure (/%category%/%postname%/%post_id%/), not working with the old permalink structure(/%year%/%monthnum%/%postname%/). And therefore it is result in so many 404 errors. Attachment url to parent post url is working only for those post which I published after 21st January, 2013. Before this date I published almost 594 post and for all those post, Attachment url to parent post url doesn't work. so kindly request you, please suggest me, how to solve this issue. How to redirect attachment url to old parent post url?


owner/group issue on server

We are having some issues in regards to our WordPress and Apache2 Ubuntu server. The issue is that the WordPress install is under a different group/owner than the root. This is causing issues with writing files to the directory. If I change the owner/group then it causes other problems with our ftp server. Is there a workaround for this.


How can i retrieve all custom registered taxonomy?

i am trying to find a way to retrieve all registered taxonomies i was looking at get_taxonomies() but i cant seem to get only the custom registered ones. any idea ?


Stop WordPress Entirely and Run My Own Code

I have a site that must be deployed in a WP Multisite environment but none of the code in the site uses WordPress at all. How can I intercept WordPress, perhaps at 'init', and tell it to stop doing anything and let me take over? I tried just putting everything in my `index.php` file and include everything manually from there. However, this results in the `<head>` of my page being loaded within the body. So it's obvious that I need to interrupt WordPress before it can run `wp_head()`, but don't know how this might be done.


Creating a folder structure

My WP site has a members area which they pay to get access to. I want that area to be a subfolder, so something like site.com/premium/nameofpage. I am aware of url rewriting, htaccess etc. Is that the only way to get this working? Or is there a WP way to create a folder structure in the url?


How to query posts with certain custom meta data, and output Post data

I've been working on modifying the Thesography plugin to include the Google Maps API. So far I've had success doing so. I'm looking to take this one step further and have 1 large Google Map that would display all of my images on 1 map. Then when you hover over a marker, an image thumbnail comes up with the post title. I know the requirements for the Google Maps API to make this possible, but am struggling with trying to get the data out of MySQL. I'm looking for some coding help that'll help me extract the following information from a post, IF it has "latlng_readable" in the post_metadata. For the Google Map, I'd like to be able to grab the post title, the post image URL and the "latlng_readable" meta coordinates for the marker pin. This way I can put this into the Google Maps API so that in the popup box for my marker is a little thumbnail of the image, as well as the title of that image.


how would I include a js file with <script> tags into wordpress?

in my wordpress plugin file I have this code that includes a javascript               function javascript_file-exmp() {         $src = plugins_url('test.js', __FILE__);         wp_register_script( 'links', $src );         wp_enqueue_script( 'links' );         wp_enqueue_script( 'jquery' );         }         add_action('init','javascript_file-exmp');      the test.js file is a little long.               if (!document.layers)             document.write('
')                       <layer id="divStayTopLeft">

Menu

 Dynamic Drive
                    What's New
                    What's Hot
                    FAQs
                    More Zone

                               </layer>                            /*             Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)             Script featured on/available at http://www.dynamicdrive.com/             This notice must stay intact for use             */                  //Enter "frombottom" or "fromtop"             var verticalpos="frombottom"                  if (!document.layers)             document.write('
')                  function JSFX_FloatTopDiv()             {                 var startX = 3,                 startY = 150;                 var ns = (navigator.appName.indexOf("Netscape") != -1);                 var d = document;                 function ml(id)                 {                     var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];                     if(d.layers)el.style=el;                     el.sP=function(x,y){this.style.left=x;this.style.top=y;};                     el.x = startX;                     if (verticalpos=="fromtop")                     el.y = startY;                     else{                     el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;                     el.y -= startY;                     }                     return el;                 }                 window.stayTopLeft=function()                 {                     if (verticalpos=="fromtop"){                     var pY = ns ? pageYOffset : document.body.scrollTop;                     ftlObj.y += (pY + startY - ftlObj.y)/8;                     }                     else{                     var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;                     ftlObj.y += (pY - startY - ftlObj.y)/8;                     }                     ftlObj.sP(ftlObj.x, ftlObj.y);                          setTimeout("stayTopLeft()", 10);                 }                 ftlObj = ml("divStayTopLeft");                 stayTopLeft();             }             JSFX_FloatTopDiv();      I am trying to include this test.js file but nothing happens on my blog. How do i go about including this file in the plugin? I understand it might be something to do with html tags or script tags. But which ones? Thanks.


Settings API - changing add_settings_field() output?

I'm using Settings API and wondering if there's any way of editing default output of add_settings_field() function?               add_settings_field('the_field', 'bar', 'foo', 'page', 'section');                function foo() {         echo 'foo';     }      Outputs:

         bar	         foo
      How to get rid of these table tags and replace them with something else?


Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area

I'm working on my admin area theme and I wanted to make some modifications on the way the thickbox and tinyMCE looks. I could make most of the changes through adding custom stylesheets and JS to my admin area using `wp_enqueue_script()` and `wp_enqueue_style()` but I have had a hard time making some others changes. This is because the iframes containing the elements are either not reachable by my own styles or have in their head some other stylesheet and JS that override mine. I more or less managed to bypass that using some JavaScript and the CSS `!important` declaration but I was wondering if there was any hooks that would allow me to call `wp_enqueue_script()` and `wp_enqueue_style()` to put my scripts inside those iframes headers? Some hook similar to `admin_head` or `admin_init` but for the thickbox or iframes?


Get URL Parameters from referer

Not 100% sure if this one classes as a php question or is specifically Wordpress... I'm implementing the Wordpress Settings API with a tabbed settings page. I've added a 'reset tab' button, but since the validation is done on a separate page (options.php) I can't seem to figure out which tab I'm on - without adding the tab as a hidden field, which I want to avoid. I've found the `wp_get_referer()` function, but that gives me the full URL - I'm not sure how to pull the `tab=tab1` out as a variable. **Update - Answer:**               $url = parse_url(wp_get_referer());     parse_str($url['query'], $path);     $tab = $path['tab'];      As said in the answers, some validation is then required.


Hierarchy between post types

So I'm working on a Wordpress site for a school. I have a page called "Faculty Staff Directory" and I also have a custom type called "Staff", with teacher profiles. I've enabled the "staff" post type to be hierarchical. However, in the admin I'm only to create hierarchical within pages of the same post, not share it across other post types. Is there a way to accomplish this or is this a Wordpress limitation? Thanks!


Use an archive as the parent of a page?

how can I solve the following problem? I have the category "Events" with the permalink `www.myblog.com/events/` and of course single events like `www.myblog.com/events/lets-party/`. Now I want to add a custom page "Event Contacts" which should be located below "Events" like `www.myblog.com/events/contact`. But I can't choose category archives as a parent page in the backend. Any advice?


Count & Display Database Queries

I'm looking for an solution how I can count and display all queries in a WordPress site. Does anybody know, if there is an good plugin? Otherwise it would be an solution to check the queries on the console, because I'm working a lot with the console.


Added if statement to loop

I'm trying to add a feature to my loop.php to use with a custom post type. However, I don't want it displayed on all posts, just the ones that are the custom post type (let's say its called "review"). Is there a way to say if post type = review then show this new section, otherwise hide? I tried using               <?php if( get_post_type() == 'reviews' )       but I don't know how to phrase the else statement to just do nothing and continue on normally. Thank you!


How to get menu location in wp_update_nav_menu hook

I want to get the menu location in the `wp_update_nav_menu` (during menu save action)                 add_action('wp_update_nav_menu', function ($id, $data = NULL)         {             error_log( var_export($data, true) );              }, 10, 2);      However, the data only contains the `menu-name`, so how can I get the menu location?


Split content into multiple columns using more tag?

First of, this is pretty much an exact duplicate of: Split columns into three+ divs? But the given solution does not work (returns blank). I'm guessing it collides with qTranslate which adds some really weird comments to the html, but i'm not sure. I found a great code snippet that simply splits the content into pieces by the more tag. The problem is it seems to only split into two columns. It ignores the rest of the more tags. I am not actually dividing the content into columns, but rather into horisontal sections (with a divider inbetween). The current code:               function split_content() {         global $more;         $more = true;         $content = preg_split('/<span id="more-\d+"><\/span>/i', get_the_content('more'));         for($c = 0, $csize = count($content); $c < $csize; $c++) {             $content[$c] = apply_filters('the_content', $content[$c]);         }         return $content;     }      The suggested solution in the linked thread does not work, and i have searched for other solutions but haven't found anything working. It is important that the content is returned in an array of "columns". Like `$content[0]` is column 1, `$content[1]` is column2 etc. Any ideas?


Change div background acording to the selected category

I'm coding a graphic menu that consist in five divs with a background each. On mouseover the background changes and the child div disappears. On click, each one works like a link to the correspondent category. I want to apply some changes to the clicked div, so I was wonder if there is some function in wordpress to get the selected category. So I can check for It and in function of wich category is selected apply the changes to the correspondent div. Thanks in advance.


Temporarily give 'manage_options' capability

In order to allow editors to edit other's author meta (update_user_attribute), I must give them the 'manage_options' capability or else I get a 'Cheatin' huh' die message. I only want to give them this capability on one specific Edit Author Meta page. I give 'editor' permission to 'list_users' to access the Users admin table. I give 'editor' permission to 'manage_options' upon entering the specific author meta page. (I tried placing at the top of function save_profile_fields but still got the die message.) I remove the 'manage_options' capability at the bottom of the save_profile_fields function. This works, but if the editor neglects to save anything on the author meta page, the editor keeps the 'manage_options' capability.               if( !current_user_can( 'manage_options' ) && current_user_can( 'edit_others_posts' ) ){         $edit_editor_role = get_role( 'editor' );         $edit_editor_role->add_cap( 'manage_options' );     }      Where would one remove the capability 'manage_options' from the editor role?               $edit_editor_role = get_role( 'editor' );     $edit_editor_role->remove_cap( 'manage_options' );


What is the meaning of %s, %1$s etc.?

From a Q&A Thread I've came to meet with some old things, but I'm afraid, I found myself in a condition that, I still don't know the meaning of them and don't know why to use them.   * `%1$s` \- (found to load widget id)   * `%2$s` \- (found to load widget class/classes)   * `%s` \- (found here) And how the following things work? I mean what's the explanation of the code- format?   * `!Website::getThemeOption("format_post/{$post_format}/content/hide")):` \- (found here)   * `if( !wp_verify_nonce( $_POST['my_noncename'] ) plugin_basename( __FILE__ ) ) return;` \- (found here) This question can go on and on..., I know. But things like these are not clearly explained anywhere. I, not just want their meaning and purposes, but want some inner/core explanation so that I can understand their motives and how they works. And also, if such things are already clearly defined in Codex, I'd love to read them. And would love to have a **list** of such curious things if such a list is already sorted out.


What is the "icon" parameter in wp_get_attachment_image_src used for?

On the reference page for `wp_get_attachment_image_src`, there is a parameter called `icon` and it only says:               $icon - (bool) (optional) Use a media icon to represent the attachment.      Default: false      What is this used for and how does it affect the returned value?


Index page is not working

I need help! I am farely new to WordPress and I was setting up a client a small blog for him. When I was done, I tested it on my server and everything was working perfectly with it. The next day I went to send it to him for approval and I got this message: Your website is ready. This site has been successfully created and is ready for content to be added. Replace this default page with your own index page. Can anyone explain what that means? I can view the post pages but I can not view the index page. Thanks


Help with accessing wp-admin page and resolving error messages

I was recently advised to reinstall both wordpress and my wordpress theme due to (i think) a still unresolved error with a slide manager, but on doing so, apppear to have lost access to the admin-wp page login and instead now have a blank page with just the following errors appearing: Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/myusername/public_html/wp-content/themes/Carta/engine/backend.php on line 51 Warning: Invalid argument supplied for foreach() in /home/myusername/public_html/wp-content/themes/Carta/engine/backend.php on line 65 Warning: Cannot modify header information - headers already sent by (output started at /home/myusername/public_html/wp- content/themes/Carta/engine/backend.php:51) in /home/myusername/public_html/wp-includes/pluggable.php on line 890 I had also installed a couple of plugins recently, which I thought might be the problem, but on disabling them via FTP this didn't make a difference. If anyone has any suggestions as to what these errors refer to and how I can resolve them, I'd be very grateful. I'm a total novice with all of this, so the more detailed your instructions, the better. Many thanks.


Creating a Closed Wordpress Community Using Referral Codes

There are a lot of WP plugins for referrals and different ones for generating registration codes for restricted registration pages, but I'm looking for a hybrid. So, my WP-powered community is completely closed and you can only get in by being invited by other members. Just like Gmail in the beginning. Best would be if a registered user could just fill in an email and that address would receive a registration link with a unique one-time registration code. Once that referral / new user would have registered I would like to display by which user this person was invited. Unfortunately I haven't found any suitable plugins for this, even though it sounds like a quite standard situation. Is there anyone who can give me some advice? Help is appreciated.


Is it possible to change a blog's theme through XML-RPC command? (and if so how?)

I can't seem to find such an option listed here: http://codex.wordpress.org/XML-RPC_wp#wp.setOptions Does it exist? Thanks.


Date based redirects of posts that no longer exist

I want a more elegant way to express the following redirect:               RewriteCond %{REQUEST_URI} ^/blog/2008/(.*) [NC, OR]     RewriteCond %{REQUEST_URI} ^/blog/2009/01/(.*) [NC, OR]     RewriteCond %{REQUEST_URI} ^/blog/2009/02/(.*) [NC, OR]     RewriteCond %{REQUEST_URI} ^/blog/2009/03/(.*) [NC, OR]     RewriteCond %{REQUEST_URI} ^/blog/2009/04/(.*) [NC, OR]     RewriteCond %{REQUEST_URI} ^/blog/2009/05/(.*) [NC, OR]     RewriteCond %{REQUEST_URI} ^/blog/2009/06(.*) [NC]     RewriteRule . http://example.com/blog/? [R=301,L]      Ideally, I'd like to use `wp_safe_redirect` or `wp_redirect`. The problem with that, however, is that those pages have already been deleted from within WP. Is this possible to do internally, if the posts have been deleted entirely from the DB?


Can a visitor sign up for multiple sites at once?

Is there a buddpress / wordpress plugin that will allow visitors to sign up to multiple sites during registration? These people seem to have done it: http://injersey.com/join-injersey/ If such a plugin does not exist, could you please tell me which hooks I should be looking at to create this feature? I thank you in advance.


How is a student directory best handled in WordPress?

I am doing a WordPress site for a school. One of the pages would have a list of 20 or so students, which would include their name, photo and small blurb. How is this type of thing handled in Wordpress? I would like the user of the CMS to be able to manage this page effectively - adding/removing students etc. I know Wordpress is being used in e-commerce sites, so people who run these site must be in the same situation on their pages of products. Should I be using plugins? Custom fields? thanks in advance


Cannot access dashboard after upgrading to 3.5

Fatal error: Call to undefined function get_taxonomies_for_attachments() in D:\hosting\10111755\html\wp-admin\menu.php on line 67


Wordpress Dashboard Incoming Links Error

Hy all! I have a problem with the Wordpress Dashboard - the Incoming Links are not working. I only get "A feed could not be found at http://blogsearch.google.com/blogsearch_feeds?hl=de&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:http://www.markus- schober.at/". I have tried a few solution but nothing works for me. Here is the link, that I have added: "http://blogsearch.google.com/blogsearch_feeds?hl=de&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:http://www.markus- schober.at/" Greetings!


Make Database query only when option is updated

Below is a DB query I am using to retrieve values and place them in a WP_List_Table. Values are currently being added by `add_option`, then those values are converted into a custom database table called `wp_testimonials`. I have no clue why I did it this way, but it works! So now I need to create a conditional that says "if user is currently updating the option, then update the table after the option is updated, else don't do anything." However, I do not know how to state this condition. My display table is located in a different file than where the options are being updated. Below is the database query, which is currently updating every time I access the page and needs to be changed.                     $options = get_option('testimonials_settings');                 if ( isset ($options)) {                 global $wpdb;               $table_name = $wpdb->prefix . "testimonials";               $sql = "CREATE TABLE $table_name (               id mediumint(9) NOT NULL AUTO_INCREMENT,               name tinytext NOT NULL,               company_name text NOT NULL,               company_url text NOT NULL,               testimonials_quote text NOT NULL,               UNIQUE KEY id (id)           );";               require_once(ABSPATH . 'wp-admin/includes/upgrade.php');               dbDelta($sql);                   $name = $options['testimonials_name'];              $company_name = $options['testimonials_website_name'];              $company_url = $options['testimonials_website_url'];              $testimonials_quote = $options['testimonials_quote'];              $rows_affected = $wpdb->insert( $table_name, array( 'name' => $name, 'company_name' => $company_name, 'company_url' => $company_url, 'testimonials_quote' => $testimonials_quote ) );                }


Undefined variable _POST

Using 3.1.1 with debug on, I am getting following notice.               Notice: Undefined variable: _POST in <filepath> on line 1000      Code at line 1000 is               $data = $_POST      Why am I getting this notice? How can I remove this particular notice?


Wp security plugin access subfolders

I have install wordpress in the root folder but i have subfolders and give me error 403 for access , i think the problem it´s of htaccess of wordpress i use wp security also as module for security and rewritte also htaccess , i put the content of htaccess :               <IfModule mod_headers.c>     Header set Connection keep-alive     </IfModule>          # BEGIN All In One WP Security     #AIOWPS_BLOCK_WP_FILE_ACCESS_START     <files license.txt>     order allow,deny     deny from all     </files>     <files wp-config-sample.php>     order allow,deny     deny from all     </files>     <files readme.html>     order allow,deny     deny from all     <IfModule mod_deflate.c>     # Insert filters     AddOutputFilterByType DEFLATE text/plain     AddOutputFilterByType DEFLATE text/html     AddOutputFilterByType DEFLATE text/xml     AddOutputFilterByType DEFLATE text/css     AddOutputFilterByType DEFLATE application/xml     AddOutputFilterByType DEFLATE application/xhtml+xml     AddOutputFilterByType DEFLATE application/rss+xml     AddOutputFilterByType DEFLATE application/javascript     AddOutputFilterByType DEFLATE application/x-javascript     AddOutputFilterByType DEFLATE application/x-httpd-php     AddOutputFilterByType DEFLATE application/x-httpd-fastphp     AddOutputFilterByType DEFLATE image/svg+xml          # Drop problematic browsers     BrowserMatch ^Mozilla/4 gzip-only-text/html     BrowserMatch ^Mozilla/4\.0[678] no-gzip     BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html          # Make sure proxies don't deliver the wrong content     Header append Vary User-Agent env=!dont-vary     </IfModule>          </files>     #AIOWPS_BLOCK_WP_FILE_ACCESS_END     #AIOWPS_BASIC_HTACCESS_RULES_START     <files .htaccess>     order allow,deny     deny from all     </files>     ServerSignature Off     LimitRequestBody 10240000     <files wp-config.php>     order allow,deny     deny from all     </files>     #AIOWPS_BASIC_HTACCESS_RULES_END     #AIOWPS_PINGBACK_HTACCESS_RULES_START     <IfModule mod_alias.c>     RedirectMatch 403 /(.*)/xmlrpc\.php$     </IfModule>     #AIOWPS_PINGBACK_HTACCESS_RULES_END     #AIOWPS_DISABLE_INDEX_VIEWS_START     Options All -Indexes     #AIOWPS_DISABLE_INDEX_VIEWS_END     #AIOWPS_DISABLE_TRACE_TRACK_START     RewriteEngine On     RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)     RewriteRule .* - [F]     #AIOWPS_DISABLE_TRACE_TRACK_END     #AIOWPS_FORBID_PROXY_COMMENTS_START     RewriteCond %{REQUEST_METHOD} =POST     RewriteCond %{HTTP:VIA}%{HTTP:FORWARDED}%{HTTP:USERAGENT_VIA}%{HTTP:X_FORWARDED_FOR}%{HTTP:PROXY_CONNECTION} !^$ [OR]     RewriteCond %{HTTP:XPROXY_CONNECTION}%{HTTP:HTTP_PC_REMOTE_ADDR}%{HTTP:HTTP_CLIENT_IP} !^$     RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]     RewriteRule .* - [F,NS,L]     #AIOWPS_FORBID_PROXY_COMMENTS_END     #AIOWPS_DENY_BAD_QUERY_STRINGS_START     RewriteCond %{QUERY_STRING} tag=     [NC,OR]     RewriteCond %{QUERY_STRING} ftp:     [NC,OR]     RewriteCond %{QUERY_STRING} http:    [NC,OR]     RewriteCond %{QUERY_STRING} https:   [NC,OR]     RewriteCond %{QUERY_STRING} mosConfig [NC,OR]     RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]     RewriteCond %{QUERY_STRING} (\;|'|\"|%22).*(request|insert|union|declare|drop) [NC]     RewriteRule ^(.*)$ - [F,L]     #AIOWPS_DENY_BAD_QUERY_STRINGS_END     #AIOWPS_ADVANCED_CHAR_STRING_FILTER_START     <IfModule mod_alias.c>     RedirectMatch 403 \,     RedirectMatch 403 \:     RedirectMatch 403 \;     RedirectMatch 403 \=     RedirectMatch 403 \@     RedirectMatch 403 \[     RedirectMatch 403 \]     RedirectMatch 403 \^     RedirectMatch 403 \`     RedirectMatch 403 \{     RedirectMatch 403 \}     RedirectMatch 403 \~     RedirectMatch 403 \"     RedirectMatch 403 \$     RedirectMatch 403 \<     RedirectMatch 403 \>     RedirectMatch 403 \|     RedirectMatch 403 \.\.     RedirectMatch 403 \%0     RedirectMatch 403 \%A     RedirectMatch 403 \%B     RedirectMatch 403 \%C     RedirectMatch 403 \%D     RedirectMatch 403 \%E     RedirectMatch 403 \%F     RedirectMatch 403 \%22     RedirectMatch 403 \%27     RedirectMatch 403 \%28     RedirectMatch 403 \%29     RedirectMatch 403 \%3C     RedirectMatch 403 \%3E     RedirectMatch 403 \%3F     RedirectMatch 403 \%5B     RedirectMatch 403 \%5C     RedirectMatch 403 \%5D     RedirectMatch 403 \%7B     RedirectMatch 403 \%7C     RedirectMatch 403 \%7D     # COMMON PATTERNS     Redirectmatch 403 \_vpi     RedirectMatch 403 \.inc     Redirectmatch 403 xAou6     Redirectmatch 403 db\_name     Redirectmatch 403 select\(     Redirectmatch 403 convert\(     Redirectmatch 403 \/query\/     RedirectMatch 403 ImpEvData     Redirectmatch 403 \.XMLHTTP     Redirectmatch 403 proxydeny     RedirectMatch 403 function\.     Redirectmatch 403 remoteFile     Redirectmatch 403 servername     Redirectmatch 403 \&rptmode\=     Redirectmatch 403 sys\_cpanel     RedirectMatch 403 db\_connect     RedirectMatch 403 doeditconfig     RedirectMatch 403 check\_proxy     Redirectmatch 403 system\_user     Redirectmatch 403 \/\(null\)\/     Redirectmatch 403 clientrequest     Redirectmatch 403 option\_value     RedirectMatch 403 ref\.outcontrol     # SPECIFIC EXPLOITS     RedirectMatch 403 errors\.     RedirectMatch 403 config\.     RedirectMatch 403 include\.     RedirectMatch 403 display\.     RedirectMatch 403 register\.     Redirectmatch 403 password\.     RedirectMatch 403 maincore\.     RedirectMatch 403 authorize\.     Redirectmatch 403 macromates\.     RedirectMatch 403 head\_auth\.     RedirectMatch 403 submit\_links\.     RedirectMatch 403 change\_action\.     Redirectmatch 403 com\_facileforms\/     RedirectMatch 403 admin\_db\_utilities\.     RedirectMatch 403 admin\.webring\.docs\.     Redirectmatch 403 Table\/Latest\/index\.     </IfModule>     #AIOWPS_ADVANCED_CHAR_STRING_FILTER_END     #AIOWPS_FIVE_G_BLACKLIST_START     # 5G BLACKLIST/FIREWALL (2013)     # @ http://perishablepress.com/5g-blacklist-2013/          # 5G:[QUERY STRINGS]     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteCond %{QUERY_STRING} (\"|%22).*(<|>|%3) [NC,OR]     RewriteCond %{QUERY_STRING} (javascript:).*(\;) [NC,OR]     RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3) [NC,OR]     RewriteCond %{QUERY_STRING} (\\|\.\./|`|='$|=%27$) [NC,OR]     RewriteCond %{QUERY_STRING} (\;|'|\"|%22).*(union|select|insert|drop|update|md5|benchmark|or|and|if) [NC,OR]     RewriteCond %{QUERY_STRING} (base64_encode|localhost|mosconfig) [NC,OR]     RewriteCond %{QUERY_STRING} (boot\.ini|echo.*kae|etc/passwd) [NC,OR]     RewriteCond %{QUERY_STRING} (GLOBALS|REQUEST)(=|\[|%) [NC]     RewriteRule .* - [F]     </IfModule>          # 5G:[USER AGENTS]     <IfModule mod_setenvif.c>     # SetEnvIfNoCase User-Agent ^$ keep_out     SetEnvIfNoCase User-Agent (binlar|casper|cmsworldmap|comodo|diavol|dotbot|feedfinder|flicky|ia_archiver|jakarta|kmccrew|nutch|planetwork|purebot|pycurl|skygrid|sucker|turnit|vikspider|zmeu) keep_out     <limit GET POST PUT>     Order Allow,Deny     Allow from all     Deny from env=keep_out     </limit>     </IfModule>          # 5G:[REQUEST STRINGS]     <IfModule mod_alias.c>     RedirectMatch 403 (https?|ftp|php)\://     RedirectMatch 403 /(https?|ima|ucp)/     RedirectMatch 403 /(Permanent|Better)$     RedirectMatch 403 (\=\\\'|\=\\%27|/\\\'/?|\)\.css\()$     RedirectMatch 403 (\,|\)\+|/\,/|\{0\}|\(/\(|\.\.\.|\+\+\+|\||\\\"\\\")     RedirectMatch 403 \.(cgi|asp|aspx|cfg|dll|exe|jsp|mdb|sql|ini|rar)$     RedirectMatch 403 /(contac|fpw|install|pingserver|register)\.php$     RedirectMatch 403 (base64|crossdomain|localhost|wwwroot|e107\_)     RedirectMatch 403 (eval\(|\_vti\_|\(null\)|echo.*kae|config\.xml)     RedirectMatch 403 \.well\-known/host\-meta     RedirectMatch 403 /function\.array\-rand     RedirectMatch 403 \)\;\$\(this\)\.html\(     RedirectMatch 403 proc/self/environ     RedirectMatch 403 msnbot\.htm\)\.\_     RedirectMatch 403 /ref\.outcontrol     RedirectMatch 403 com\_cropimage     RedirectMatch 403 indonesia\.htm     RedirectMatch 403 \{\$itemURL\}     RedirectMatch 403 function\(\)     RedirectMatch 403 labels\.rdf     RedirectMatch 403 /playing.php     RedirectMatch 403 muieblackcat     </IfModule>          # 5G:[REQUEST METHOD]     <ifModule mod_rewrite.c>     RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)     RewriteRule .* - [F]     </IfModule>          # 5G:[BAD IPS]     <limit GET POST PUT>     Order Allow,Deny     Allow from all     # uncomment/edit/repeat next line to block IPs     # Deny from 123.456.789     </limit>     #AIOWPS_FIVE_G_BLACKLIST_END     #AIOWPS_BLOCK_SPAMBOTS_START     <IfModule mod_rewrite.c>     RewriteCond %{REQUEST_METHOD} POST     RewriteCond %{REQUEST_URI} ^(.*)?wp-comments-post\.php(.*)$     RewriteCond %{HTTP_REFERER} !^http://thefactoyweb\.com [NC,OR]     RewriteCond %{HTTP_USER_AGENT} ^$     RewriteRule .* http://127.0.0.1 [L]     </IfModule>     #AIOWPS_BLOCK_SPAMBOTS_END     # END All In One WP Security          # BEGIN W3TC Browser Cache     <IfModule mod_mime.c>         AddType text/css .css         AddType text/x-component .htc         AddType application/x-javascript .js         AddType application/javascript .js2         AddType text/javascript .js3         AddType text/x-js .js4         AddType text/html .html .htm         AddType text/richtext .rtf .rtx         AddType image/svg+xml .svg .svgz         AddType text/plain .txt         AddType text/xsd .xsd         AddType text/xsl .xsl         AddType text/xml .xml         AddType video/asf .asf .asx .wax .wmv .wmx         AddType video/avi .avi         AddType image/bmp .bmp         AddType application/java .class         AddType video/divx .divx         AddType application/msword .doc .docx         AddType application/vnd.ms-fontobject .eot         AddType application/x-msdownload .exe         AddType image/gif .gif         AddType application/x-gzip .gz .gzip         AddType image/x-icon .ico         AddType image/jpeg .jpg .jpeg .jpe         AddType application/json .json         AddType application/vnd.ms-access .mdb         AddType audio/midi .mid .midi         AddType video/quicktime .mov .qt         AddType audio/mpeg .mp3 .m4a         AddType video/mp4 .mp4 .m4v         AddType video/mpeg .mpeg .mpg .mpe         AddType application/vnd.ms-project .mpp         AddType application/x-font-otf .otf         AddType application/vnd.oasis.opendocument.database .odb         AddType application/vnd.oasis.opendocument.chart .odc         AddType application/vnd.oasis.opendocument.formula .odf         AddType application/vnd.oasis.opendocument.graphics .odg         AddType application/vnd.oasis.opendocument.presentation .odp         AddType application/vnd.oasis.opendocument.spreadsheet .ods         AddType application/vnd.oasis.opendocument.text .odt         AddType audio/ogg .ogg         AddType application/pdf .pdf         AddType image/png .png         AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx         AddType audio/x-realaudio .ra .ram         AddType application/x-shockwave-flash .swf         AddType application/x-tar .tar         AddType image/tiff .tif .tiff         AddType application/x-font-ttf .ttf .ttc         AddType audio/wav .wav         AddType audio/wma .wma         AddType application/vnd.ms-write .wri         AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw         AddType application/zip .zip     </IfModule>     <IfModule mod_expires.c>         ExpiresActive On         ExpiresByType text/css A31536000         ExpiresByType text/x-component A31536000         ExpiresByType application/x-javascript A31536000         ExpiresByType application/javascript A31536000         ExpiresByType text/javascript A31536000         ExpiresByType text/x-js A31536000         ExpiresByType text/html A3600         ExpiresByType text/richtext A3600         ExpiresByType image/svg+xml A3600         ExpiresByType text/plain A3600         ExpiresByType text/xsd A3600         ExpiresByType text/xsl A3600         ExpiresByType text/xml A3600         ExpiresByType video/asf A31536000         ExpiresByType video/avi A31536000         ExpiresByType image/bmp A31536000         ExpiresByType application/java A31536000         ExpiresByType video/divx A31536000         ExpiresByType application/msword A31536000         ExpiresByType application/vnd.ms-fontobject A31536000         ExpiresByType application/x-msdownload A31536000         ExpiresByType image/gif A31536000         ExpiresByType application/x-gzip A31536000         ExpiresByType image/x-icon A31536000         ExpiresByType image/jpeg A31536000         ExpiresByType application/json A31536000         ExpiresByType application/vnd.ms-access A31536000         ExpiresByType audio/midi A31536000         ExpiresByType video/quicktime A31536000         ExpiresByType audio/mpeg A31536000         ExpiresByType video/mp4 A31536000         ExpiresByType video/mpeg A31536000         ExpiresByType application/vnd.ms-project A31536000         ExpiresByType application/x-font-otf A31536000         ExpiresByType application/vnd.oasis.opendocument.database A31536000         ExpiresByType application/vnd.oasis.opendocument.chart A31536000         ExpiresByType application/vnd.oasis.opendocument.formula A31536000         ExpiresByType application/vnd.oasis.opendocument.graphics A31536000         ExpiresByType application/vnd.oasis.opendocument.presentation A31536000         ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000         ExpiresByType application/vnd.oasis.opendocument.text A31536000         ExpiresByType audio/ogg A31536000         ExpiresByType application/pdf A31536000         ExpiresByType image/png A31536000         ExpiresByType application/vnd.ms-powerpoint A31536000         ExpiresByType audio/x-realaudio A31536000         ExpiresByType image/svg+xml A31536000         ExpiresByType application/x-shockwave-flash A31536000         ExpiresByType application/x-tar A31536000         ExpiresByType image/tiff A31536000         ExpiresByType application/x-font-ttf A31536000         ExpiresByType audio/wav A31536000         ExpiresByType audio/wma A31536000         ExpiresByType application/vnd.ms-write A31536000         ExpiresByType application/vnd.ms-excel A31536000         ExpiresByType application/zip A31536000     </IfModule>     <IfModule mod_deflate.c>         <IfModule mod_headers.c>             Header append Vary User-Agent env=!dont-vary         </IfModule>             AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json         <IfModule mod_mime.c>             # DEFLATE by extension             AddOutputFilter DEFLATE js css htm html xml         </IfModule>     </IfModule>     <FilesMatch "\.(css|htc|js|js2|js3|js4|CSS|HTC|JS|JS2|JS3|JS4)$">         FileETag MTime Size         <IfModule mod_headers.c>             Header set Pragma "public"             Header append Cache-Control "public, must-revalidate, proxy-revalidate"              Header set X-Powered-By "W3 Total Cache/0.9.3"         </IfModule>     </FilesMatch>     <FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">         FileETag MTime Size         <IfModule mod_headers.c>             Header set Pragma "public"             Header append Cache-Control "public, must-revalidate, proxy-revalidate"              Header set X-Powered-By "W3 Total Cache/0.9.3"         </IfModule>     </FilesMatch>     <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|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|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|JSON|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)$">         FileETag MTime Size         <IfModule mod_headers.c>             Header set Pragma "public"             Header append Cache-Control "public, must-revalidate, proxy-revalidate"              Header set X-Powered-By "W3 Total Cache/0.9.3"         </IfModule>     </FilesMatch>     # END W3TC Browser Cache     # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     # uploaded ?les     RewriteRule ^([_0-9a-zA-Z-]+/)??les/(.+) wp-includes/ms-?les.php??le=$2 [L]     # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]     RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     #RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?((wp-content).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(admin|includes).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]     RewriteRule . index.php [L]     </IfModule>     # END WordPress      The problem block me the access to subfolders for example /forum , thank´s , regards


How to set up Author archives with sub category URL

So i have a site where i have used the authors.php page so that i can display individual user's profile pages.. the url then looks something like: http://mydomain.com/author/test/ What i would like to do is have it so that I can add subpages to this that are common for each user ie: http://mydomain.com/author/test/liked-posts/ where i can add all the posts that the user has liked ie: liked-posts.php is there a place i should be telling URL's of this structure to be redirecting to a specific file? and how would i do that? This is the complete code that im using to query my posts:               <?php     /**      * Template Name: Posts liked by Author      *      * for a child theme of Twenty_Twelve      */          get_header(); ?>

                  <?php     $author = get_user_by( 'slug', get_query_var( 'author_name' ) );     $post_ids = $wpdb->get_col( "SELECT DISTINCT post_id FROM {$wpdb->prefix}wti_like_post WHERE user_id = {$author->ID}" );     if( strpos( $wp_query->query_vars['liked-posts'] ,'page') !== false ) {         $paged = substr( $wp_query->query_vars['liked-posts'], 5 );     }          $args = array(         'posts_per_page' => 4,         'paged' => $paged,         'order' => 'ASC',         'post__in' => $post_ids     );          $wp_query = new WP_Query();     $wp_query->query( $args ); ? >                      <?php if( have_posts() ) : ?>                      <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>                          <?php get_template_part( 'content', get_post_format() ); ?>                     <?php comments_template( '', true ); ?>                 <?php endwhile; // end of the loop. ?>             <?php twentytwelve_content_nav( 'nav-below' ); ?>                                 <?php else : ?>

<?php _e( 'Nothing Found', 'twentytwelve' ); ?>

<?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?>
                         <?php get_search_form(); ?>

                      <?php endif; wp_reset_postdata(); ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>


Need to build custom metabox select prev posts by category

I am working on a personal project and need the ability to select a previous post based on a selected category. This will be a site devoted to building a pedigree. I really hope this makes sense. I am sitting here trying to think of the best way to describe what I am trying to do. Any help would be greatly appreciated!


Permalink to user profile

How can I retrieve the permalink to a user (author) profile dynamically outside the loop by ID? an alternative to `the_author_link()`, but for outside the loop. ### Example:               get_author_link($user_id);


Why does typing a post in the Quick Draft or comments, eliminate double spaces?

I'm personally a fan of using two spaces after periods, in order to improve readability of my material. But lately I've been using the Quick Draft feature in the dashboard, to jot things down, and then I edit them later into final posts. I've noticed in every case, that when I save a post created this way, all my careful double spaces are converted to single spaces. This does not happen if I use the standard New Post feature. Only when created from a Quick Draft. This appears to happen for comments too. Any comment (or comment reply) left that uses two spaces after periods, will be converted to single spaces upon saving. The spaces are actually modified in the comment source. Anyone know why this is and if it's a bug?


Filtering WP_Query

I'm developing a site that uses a Artist custom post type and I need to query all posts of this type in a page template. I need to set the **is_post_type_archive** property to true too to filter this query using the **posts_orderby** filter. I'm using the following code, but it seems WordPress is ignoring the third line:               $args = array('post_type' => 'artist');     $wp_query = new WP_Query( array_merge( $args, array('nopaging' => true) ) );     $wp_query->is_post_type_archive = true;      This is the filter:               function artist_posts_orderby( $orderby )     {         if (is_post_type_archive('artist')) {             $orderby = "RIGHT(post_title, LOCATE(' ', REVERSE(post_title)) - 1) ASC";         }         return $orderby;     }     add_filter('posts_orderby', 'artist_posts_orderby' );      Any ideas? Thanks in advance


Set terms in a custom post

I have a custom post "artist" and a taxonomy/category "artist category", and i want to create (by development) a new post and set the category of the artist but it doesn't work. I have tested it with this code:               function createNewPost( $response ){         global $userMeta;              $userID = $response->ID;         $user = new WP_User( $userID );              $role = $userMeta->getUserRole();         //$catId = get_cat_ID("dj");              if( $role = 'artiste' ){                   $newPost = array(               'post_title'    => $user->nickname,                'post_content'  => $user->description,               'post_status'   => 'pending',               'post_author'   => $userID,               'post_type'     => 'cpt_artists',               'tax_input' => array('artist-category' => array('dj')             ));                  $post_id = wp_insert_post( $newPost );                  wp_set_post_terms( $post_id, array( 'dj'), 'artist-category');              }          }      But it's not working. For the test I have listed all the taxonomy of wordpress and the result is: category, post_tag, nav_menu, link_category, post_format Why is my custom taxonomy "artist-category" is not listed here?


Custom meta box data not saving after wrapping in class

I followed this tutorial and got everything to display and save properly, however I wanted to create a new class for this to clean up the code. Unfortunately after doing so the data no longer saves and I haven't been able to fix the issue. http://code.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro- and-basic-fields--wp-23259 The meta box fields are output from a switch statement based on the contents of the $custom_meta_fields array.               class VPC_Customization_Meta_Boxes {          protected $custom_meta_fields = array();          function __construct() {         add_action( 'add_meta_boxes', array( $this, 'create_fields_array') );         add_action( 'load-post.php', array( $this,'setup_boxes') );         add_action( 'load-post-new.php', array( $this, 'setup_boxes') );         add_action( 'admin_enqueue_scripts', array($this, 'load_scripts') );          /* Create fields array on the 'add_meta_boxes' hook */          }          /* Meta box setup function. */     function setup_boxes() {            /* Add meta boxes on the 'add_meta_boxes' hook. */       add_action( 'add_meta_boxes', array( $this, 'add_boxes') );       /* Save post meta on the 'save_post' hook. */       add_action('save_post', array( $this, 'save_meta'));     }      ...               // Save the Data     function save_meta($post_id) {              // verify nonce         if (!wp_verify_nonce($_POST['vpc_customization_meta_box_nonce'], basename(__FILE__)))              return;         // check autosave         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)             return;         // check permissions         $post_type_slug = get_post_type( $post_id );         $post_type = get_post_type_object( $post_type_slug );              if( $post_type_slug === $_POST['post_type'] ){             if( !current_user_can( $post_type->cap->edit_post, $post_id ) )                  return;         }              // loop through fields and save the data         foreach ($this->custom_meta_fields as $field) {             $new = false;             $old = get_post_meta($post_id, $field['id'], true);             if ( isset( $_POST[$field['id']] ) )                 $new = $_POST[$field['id']];                  if ( isset( $new ) && $new != $old ) {                 update_post_meta( $post_id, $field['id'], $new );             }              elseif ( isset( $new ) && '' == $new && $old ) {                 delete_post_meta( $post_id, $field['id'], $old );             }         } // end foreach     }      One thing I'm not sure of is if I'm accessing $post and $post_ID properly from within in the class. Full code: http://pastebin.com/rxnyeRar Thanks in advance for your help!


is_user_logged_in function in a sidebar not working

I'm trying to get my sidebar to change when a user is logged in and i'm using the is_user_logged_in function. Here is the code -                         <?php     /**      * The Sidebar containing the primary and secondary widget areas.      *      * @package WordPress      * @subpackage Twenty_Ten      * @since Twenty Ten 1.0      */     ?>

          <?php         /* When we call the dynamic_sidebar() function, it'll spit out          * the widgets for that widget area. If it instead returns false,          * then the sidebar simply doesn't exist, so we'll hard-code in          * some default sidebar stuff just in case.          */         if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>

Sign In / Register

         <?php if ( is_user_logged_in() ) { echo 'Welcome, registered user!';} else { echo 'Welcome, unregistered user!';} ?>

<?php _e( 'Meta', 'twentyten' ); ?>

                         <?php wp_register(); ?>
<?php wp_loginout(); ?>
                         <?php wp_meta(); ?>

                  <?php endif; // end primary widget area ?>

                          When the user is logged in the sidebar shows what it's supposed to. When the user logs out, it disappears completely. What am I doing wrong?


Browser cache for dynamic content (list of tags)

What does WP have to offer when it comes to generating dynamic content that rarely changes? I've created a jQuery backed metabox which implements auto complete and has the option of not allowing users to create new tags. (I want all my tags to be pre thought out and have associated descriptions.) The tags themselves come from WP's built in functions. So without querying the database, it's difficult to know if tags have been added. Ideally, I'd only like to build the list when a new tag has been added and I'd only like to send them to the browser if absolutely necessary. I can think of two methods to solve this:   1. Hook the add new tag actions, build and save an xml file, then have my php script check the version and set the response headers. This introduces file system access issues which I'd like to avoid. Also not quite sure how to handle the version tracking though that isn't really WP related.   2. Have the jQuery script make the request. The browser should in theory return the local cache if available. Then make a second request for the version and/or any new tags. This seems a little over the top. Does WP have anything built in to handle this? If WP doesn't have a cache system built in, perhaps it should. Plugins relying on third party plugins are not an option.


Change 'post_modify' with a query

I'm trying to change the value of `post_modified` columns with a query like that:               $wpdb->query( "UPDATE `$wpdb->posts` SET `post_modified` = ".$data_modifica_post."  WHERE ID = ".$iddelpostdaverificare."");      but it doesn't work. Is it possible to change manually `post_modified` (and `post_modified_gmt`) or it only change automatically with an update of the post from the back-end?


Concatenate and minify dependencies for enqueued JavaScript files

I'm loading a JavaScript file using `wp_enqueue_script` into my theme. However, along with it, I'm loading several jQuery files as well, as dependencies for the enqueued script (which has already been concatenated and minified by Grunt). Here is my code:               add_action('wp_enqueue_scripts', function() {         wp_enqueue_script( 'customscripts', get_template_directory_uri() . '/assets/js/main.min.js', array('jquery', 'jquery-form', 'json2', 'jquery-ui-autocomplete'), NULL, true );     });      For the dependencies array, how would I go about concatenating and minifying those jQuery dependencies? I'm trying to get my site to load as fast as possible, and the less JS files it has to load the better. Also if it were possible to make them load asynchronously (using the `async` property for `<script>` tags) that'd be ace. I'd rather do it without using a plugin but I will use a plugin if necessary. Thanks for any help :)


Only admin should be able to add a particular custom field

I have a multi author blog, I want to restrict authors from adding custom fields with a particular key. For example I dont want authors to edit or add the custom field " **rating** "


How to remove some specfic navigation links only from selected page/pages?

For example: In the client site I have 5 page 1) Home 2) product 3) Services 4) Contact us 5) Blog Only from the blog page I want to remove 2) product and 3) Services but not from other pages. Is there any Plugin to do this?


Making a theme multilingual by adding a custom taxonomy to posts and pages called "Languages"?

Recently, I've been thinking of implementing an easy and simple localization feature in my WordPress site. I thought about adding a custom taxonomy to my posts, and pages called "Languages." So when you click the link of the language it just filters the posts with that Language term. I've been using WPML and it is awesome, but I just wanted an embedded implementation for my theme. Have anyone tried this before? What could be the pros and downsides of doing this?


Too many if's and else if's ?? - Must be better way

Everyone on this forum has helped me tremendously. Thank you. I now have a page that functions the way I want it but my code seems to be cumbersome. To figure out a string to echo I have a long series of `if` `else if` statements that I can't figure out how to streamline. Here is the code in full:
Ongoing
            <?php // This is the loop for quering an individual page's events and upcoming events       date_default_timezone_set('America/New_York');       $todaysDate = date('Y/m/d'); // Get today's date in the right format       $today = date("Y-m-d 00:00");  // set today's date with eastern timezone       $todayevening = date("Y-m-d 17:00");// set limit for "today" events extending to 5 pm same day       $tonight = date("Y-m-d 03:00", strtotime("+1 day"));// set limit for "tonight" events extending to 3:00 am next day       $tomorrow = date("Y-m-d 03:00", strtotime("+2 days"));// set limit for "tonight" events extending to 3:00 am next next day       $lastWeek = date("Y-m-d", strtotime("-7 days"));       $nextWeek = date("Y/m/d", strtotime("+7 days"));            $eventsloop = new WP_Query('post_type=event&location=' . $whatCity .'&meta_key=end_date&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); // Displays the events that have not ended yet            while($eventsloop->have_posts()) : $eventsloop->the_post(); // begin the loop after sorting the posts by location date and removing old end dates            /* Let's get all the meta date in one call rather then so many queries */       $event_custom_meta=get_post_custom($post->ID); // Get all the data        if  ( $event_custom_meta )       {       $event_start_date = $event_custom_meta['start_date'][0];        $event_end_date = $event_custom_meta['end_date'][0];       $event_opening_time = $event_custom_meta['opening_time'][0];       $event_closing_time = $event_custom_meta['closing_time'][0];       $event_artist_talk_time = $event_custom_meta['artist_talk_time'][0];       $event_lecture_time = $event_custom_meta['lecture_time'][0];       $event_panel_time = $event_custom_meta['panel_time'][0];       $event_special_event_time = $event_custom_meta['special_event_time'][0];       $event_workshop_time = $event_custom_meta['workshop_time'][0];       $event_custom_event_venue = $event_custom_meta['custom_event_venue'][0];       $event_venue_info = $pieces = explode("***", $event_custom_meta[$prefix.'event_venue'][0]);       $event_featured_event = $event_custom_meta['featured_event'][0];       }   /* The test works. Alright, now I can echo these variables anyplace that I want */       ?>

            <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title('
', '
'); ?>            <a href="<?php echo $event_venue_info[1]; ?>" title="<?php echo $event_venue_info[0]; ?>">
       <?php             if ($event_venue_info[0] != 'other') {                echo $event_venue_info[0];               }           if ($event_venue_info[0] == 'other') {               echo $event_custom_event_venue;               }       ?>
             <?php // Format the running dates       $writestart = preg_split ( '/\//', $event_start_date );       $writeend = preg_split ( '/\//', $event_end_date );        ?>
       <?php // and print nicely       if ($event_end_date <= $nextWeek) {           echo 'Last Chance: ';           }       echo date('F j', mktime( 0, 0, 0, $writestart[1], $writestart[2], $writestart[0] ) );       echo ' through ';       echo date('F j, Y', mktime( 0, 0, 0, $writeend[1], $writeend[2], $writeend[0] ) );       ?>
                 <?php // Check if Opening or Closing dates exist and echo the information            $convertedtime2 = "F j, Y | g:i a"; // convert to 12 hour clock and minutes              $opening_time_formated = date($convertedtime2, strtotime($event_opening_time));          $closing_time_formated = date($convertedtime2, strtotime($event_closing_time));          $artist_talk_time_formated = date($convertedtime2, strtotime($event_artist_talk_time));          $lecture_time_formated = date($convertedtime2, strtotime($event_lecture_time));          $panel_time_formated = date($convertedtime2, strtotime($event_panel_time));          $special_event_time_formated = date($convertedtime2, strtotime($event_special_event_time));          $workshop_time_formated = date($convertedtime2, strtotime($event_workshop_time));        $end_date_formated = date('F j, Y', mktime( 0, 0, 0, $writeend[1], $writeend[2], $writeend[0] ) );            if ($event_opening_time >= $today) {           echo '
';           if ($event_opening_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_opening_time > $todayevening && $event_opening_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_opening_time > $tonight && $event_opening_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Opening: '.$opening_time_formated .'
';                    }            if ($event_closing_time >= $today) {           echo '
';           if ($event_closing_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_closing_time > $todayevening && $event_closing_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_closing_time > $tonight && $event_closing_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Closing: '.$closing_time_formated .'
';            }            if ($event_artist_talk_time >= $today) {               echo '
';           if ($event_artist_talk_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_artist_talk_time > $todayevening && $event_artist_talk_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_artist_talk_time > $tonight && $event_artist_talk_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Artist Talk: '.$artist_talk_time_formated .'
';            }            if ($event_lecture_time >= $today) {           echo '
';           if ($event_lecture_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_lecture_time > $todayevening && $event_lecture_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_lecture_time > $tonight && $event_lecture_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Lecture: '.$lecture_time_formated .'
';        }            if ($event_panel_time >= $today) {               echo '
';           if ($event_panel_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_panel_time > $todayevening && $event_panel_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_panel_time > $tonight && $event_panel_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Panel: '.$panel_time_formated .'
';       }            if ($event_special_event_time >= $today) {           echo '
';           if ($event_special_event_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_special_event_time > $todayevening && $event_special_event_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_special_event_time > $tonight && $event_special_event_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Special Event: '.$special_event_time_formated .'
';        }            if ($event_workshop_time >= $today) {           echo '
';           if ($event_workshop_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_workshop_time > $todayevening && $event_workshop_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_workshop_time > $tonight && $event_workshop_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Workshop: '.$workshop_time_formated .'
';       }            the_excerpt();       ?>

             <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo get_the_post_thumbnail($post_id, 'half_postcard'); ?>

       <?php endwhile; ?>
       Here are the inefficient `if` statements:                if ($event_opening_time >= $today) {           echo '
';           if ($event_opening_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_opening_time > $todayevening && $event_opening_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_opening_time > $tonight && $event_opening_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Opening: '.$opening_time_formated .'
';                    }            if ($event_closing_time >= $today) {           echo '
';           if ($event_closing_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_closing_time > $todayevening && $event_closing_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_closing_time > $tonight && $event_closing_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Closing: '.$closing_time_formated .'
';            }            if ($event_artist_talk_time >= $today) {               echo '
';           if ($event_artist_talk_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_artist_talk_time > $todayevening && $event_artist_talk_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_artist_talk_time > $tonight && $event_artist_talk_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Artist Talk: '.$artist_talk_time_formated .'
';            }            if ($event_lecture_time >= $today) {           echo '
';           if ($event_lecture_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_lecture_time > $todayevening && $event_lecture_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_lecture_time > $tonight && $event_lecture_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Lecture: '.$lecture_time_formated .'
';        }            if ($event_panel_time >= $today) {               echo '
';           if ($event_panel_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_panel_time > $todayevening && $event_panel_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_panel_time > $tonight && $event_panel_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Panel: '.$panel_time_formated .'
';       }            if ($event_special_event_time >= $today) {           echo '
';           if ($event_special_event_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_special_event_time > $todayevening && $event_special_event_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_special_event_time > $tonight && $event_special_event_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Special Event: '.$special_event_time_formated .'
';        }            if ($event_workshop_time >= $today) {           echo '
';           if ($event_workshop_time <= $todayevening) {               echo 'Today: ';             }           else if ($event_workshop_time > $todayevening && $event_workshop_time <= $tonight) {               echo 'Tonight: ';               }           else if ($event_workshop_time > $tonight && $event_workshop_time <= $tomorrow) {               echo 'Tomorrow: ';           }           echo 'Workshop: '.$workshop_time_formated .'
';       }      Thank you in advance for your help. Excuse my lack of ability to use php efficiently.


How to make my plugin code die gracefully

I've set up a class for my function, and I'd like to implement some form of error handling. But I'm new to this error handling lark. Can I set_error_handler to only show certain messages (and can these be as wordpress alerts in the admin section)? And if there is a fatal error in my plugin (there are none on my dev set up, but I'm trying to catch anything that might occur on a live server), is there a way to catch this to avoid a site crash? Or white screen of death? I'm thinking it must be possible on a fatal error (or anything else that might ruin the site), to automagically deactivate the plugin? and send a wp alert message. Am I on the right track? Does anyone have an example they could show me?


How to disable 3.3 Tooltips?

I find the 3.3 Tooltips annoying when I'm upgrading many live and dev sites. How do I disable them via functions.php? Unenqueue wp-includes/js/wp- pointer.js ?


How to make my plugin theme-independent?

I need a little help and/or consulting for my next steps. (I'm a beginner!) I've been working on my plugin, using a Custom Post Type "Project", some help from the plugin "Advanced Custom Fields" - and now I have succeeded in the general functionality. Have a look at the images here and http://www.project22.org/project/ to see the functionality. _I admit, there might be plugins doing something similar, but I'm not advanced enough yet to understand and adjust their code to my specific needs ;(._ I worked within a child theme of Twentytwelve and needed to work with some template files, e.g. I created single-project.php and project_loop.php to use with get_template_part(). Problem:   * I'm not so happy with Twentytwelve anymore - I'd like to retain some flexibility in changing my themes.   * Maybe one day I want to share my plugin with someone, who knows? So now my aim is to move all parts of the functionality into a plugin ... Questions:   * How can I display these little pieces of information related to various posts on any theme? I couldn't find appropriate hooks nor filters.   * How can I avoid creating theme template files, which might later screw up new themes? I'm really confused, where I should use []-Shortcodes, create template files or snippets, where I can hook or filter into. I appreciate any advice from you, thanks Flo


How to display elements of different post types?

What happens is: I have a custom post type called **"placas"** and have an associated custom taxonomy called **"firmas"** and this **taxonomy** is the terms **"LG", "AOC", "Panavox".** I want to show a certain category post slider and exclude others. What I did was use the following well **WP_Query** object. And I could exclude the term **"LG"** and show all the other               $arg = array (     'post_type' => 'placas',     'orderby' => 'rand',          'tax_query' => array(         array(             'taxonomy'  => 'firmas',             'field'     => 'slug',             'terms'     => array( 'LG' ),             'operator'  => 'NOT IN',         ),        )       );            $query_slider= new WP_Query($arg);     ?>      ## The Problem: I created a regular post type category called **"News"**. I need that post associated with the category News displayed on the slider. How can I do that?


Only show first post to match certain criteria within WP_Query

I have a custom post type, with a custom field associated with it. I've setup a WP_Query to return all the posts of that post type. What I want to do is to show the first one that meets a unique criteria for the custom field, and not any subsequent ones. As an example let's say I have 5 posts, and for those 5 posts the custom field (let's call it 'size') is filled in as follows:   * Post #1 - Field value: Small   * Post #2 - Field value: Medium   * Post #3 - Field value: Small   * Post #4 - Field value: Large   * Post #5 - Field value: Medium What I would like my query to automatically detect when it reaches duplicate field vale, so the list of returned posts would be:   * Post #1   * Post #2   * Post #4 Does anyone have any ideas?


Plugins won't update when Wordpress says they're updated

In a Wordpress 3.5.1 network, I have six plugins which have updates available:   * AddThis Follow Widget   * AddThis Social Bookmarking Widget   * AddThis Welcome Bar   * Jetpack by WordPress.com    * Visual Form Builder   * WordPress SEO I select them, press Update, Wordpress loads through it's update procedure: > The update process is starting. This process may take a while on some hosts, > so please be patient. > > Enabling Maintenance mode… > > All updates have been completed. and then I see that I still have 6 updates available, and the updates have not been applied to these 6 plugins. I have not made any changes to Wordpress, and deactivating plugins does not resolve this. I receive no errors, and the hosting plan we're on is unlimited disk space.


Resolved : Error before doctype after WP4 update Notice: next_post is deprecated since version 2.0!

After WP 4.0 update I am facing issue in pagination. It adds the total number of pages e.g. if three pages available for pagination it will add 3 before This error occurs from the second page of pagination. See the pictures No error on a blog page which is actually index.php inside which I include another blog1.php file which shows the blog content. ![No error on first page](http://i.stack.imgur.com/d8yBI.png) Error on second page ![Error on second page](http://i.stack.imgur.com/Ll7ad.png) When I set debug to true in wp-config.php ![Strange notice](http://i.stack.imgur.com/WpYQG.png) When I set debug true, it give this notice               "Notice: next_post is deprecated since version 2.0! Use next_post_link() instead. in /Users/ahmadawais/Documents/Websites/aa.dev/wp-includes/functions.php on line 3201"      Whereas my pagination function inside functions.php is this               // Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin     function aa_pagination()     {     global $wp_query;     $big = 999999999;     echo paginate_links(array(     'base' => str_replace($big, '%#%', get_pagenum_link($big)),     'format' => '?paged=%#%',     'current' => max(1, get_query_var('paged')),     'total' => $wp_query->max_num_pages     ));     }     add_action('init', 'aa_pagination'); // Add our HTML5 Pagination      Can anyone help? I am trying figure out but in vain. > The issue was nextLink named parameter in functions.php in another function.


Change size of featured image in Edit Post screen

How can I change the size of a featured image thumbnail on the Edit Post screen for one of my custom post types? Please note that I am looking to modify the size of the image displayed in the admin 'Edit Post' screen, and not on the front end of my site. The size is determined by WP itself at the moment, and I don't seem to have any way of changing it.


get_users is expecting unserialized meta_value

I'm trying to get all users assigned to a custom usermeta. I know that `get_users()` is supposed to work; however, it doesn't seem to be working. What I have is a usermeta storing a category ID and I'm trying to use `'meta_value' => $cat_id` to query the database. So this is the code I have:               $args = array(         'meta_key' => 'custom-usermeta',         'meta_value' => $cat_id     );     $users = get_users( $args );      and here is how I'm saving it:               update_user_meta( $user_id,'custom-usermeta',$cat_id);      `$cat_id` is an array. But this isn't working. What I've figured out so far is that the `meta_value` expects an unserialized value. How can I get that to work? I tried the `'meta_compare' => 'LIKE'` but then that just about grabs everything (because of the way Wordpress serializes the values). Is there anything else I can do to fix this?


Wordpress Group By Problem

i have a custom post type called "events". in this post type, i have a metabox with the date of the event. saved as timestamp. my problem is, i want a whole year with every month. current only the month is displayed where an event is - but i want every month of a year ... so this is my loop               query_posts(          array(              'paged' => $paged ,             'post_type' => array (                 'events_national',                  'events_international' ),             'orderby' => 'meta_value_num',             'meta_key' => '_kk_datum_anfang',             'order' => 'ASC'         )     );      this is the output:               <?      if ($event_monat !== $event_monat_check) {         echo "
" . $event_monat . "
";      }      $event_monat = $event_monat;     ?>
<?php echo $event; ?>----<?php the_title(); ?> - <?php echo strftime( "%d.%m.%Y", $event_anfang_datum ); ?>     - <?php echo $event_kategorie[0]->name; ?> - <?php echo $event_veranstaltungsort; ?> -     <?php echo $event_prioritaet [0]->name; ?>
      so current is month with event ... i want every month ... can someone help me ? ... must i created two more taxonimies with every month and a year ?


Custom post type getting wrong categories and tags

Ok i have a custom post type on my blog called videos, where i only post a video. There's a sceen cap below ![enter image description here](http://i.stack.imgur.com/WqOSN.jpg) **On the right are the latest post from the custom post type, on the left is the video, and under the video is the date and time, category and tags. But the problem is that it is getting the wrong, Tags, Categories, and date. How do i fix this?** here is the code of that template page below               <?php     /*     Template Name: Single Videos     */     ?>     <?php get_header() ?>

                        <?php the_post() ?>

<?php the_title() ?>

      <?php the_content() ?>                     <?php wp_link_pages('before=
' . __( 'Pages:', 'wpbx' ) . '&after=
') ?>

           <?php      $queryObject = new WP_Query( 'post_type=videos&posts_per_page=20&orderby=rand' );      // The Loop!      if ($queryObject->have_posts()) {     ?>          <?php     while ($queryObject->have_posts()) {         $queryObject->the_post();              ?>

<a href="<?php the_permalink(); ?>" title="<?php printf(__( 'Read %s', 'wpbx' ), wp_specialchars(get_the_title(), 1)) ?>">                         <?php the_post_thumbnail('video-post'); ?>
      	                   <a href="<?php the_permalink(); ?>"><?php the_title(); ?>

      <?php      }      ?>      <?php      }      ?>

                         <?php the_time(__('F jS, Y', 'kubrick')) ?>                         |                         Published in: <?php the_category(', '); ?>
      <span class='st_facebook_hcount' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'><span class='st_twitter_hcount' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'><span class='st_plusone_hcount' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'>

      <?php the_tags( __( 'More On: ', 'wpbx' ), ", ", "\n" ) ?>
                         <?php the_excerpt(); ?>

           <?php comments_template(); ?>

           <?php get_footer() ?>


for my current theme( own custom ) the default menu options are disabled in wp-admin?

for my current theme( own custom ) the default menu options are disabled in wp-admin, please help me to enable it. The following image shows the problem. ![enter image description here](http://i.stack.imgur.com/9dGum.png) Thanks in advance.


What's the easiest way to change the default landing page for BuddyPress groups?

I'm looking to have the default view for Groups be the Forum component instead of the Activity component. What's the best/easiest way to alter the default landing component/page?


wpdb Custom Meta Data with 2 conditions

This is one of those problems that I've spent way too much time on, and there is probably a VERY simple solution that I am missing. Any help would be greatly appreciated. I am trying to populate a select box with names from custom data (meta_key "pyd_pub_author"). But, I cant just call the data directly, because it also needs to make sure that, meta_key "pyd_pub_type" = "Newsletter" The meta_value for meta_key "pyd_pub_type" needs to be "Newsletter" and the author names needs to come from meta_key "pyd_pub_author". The tricky part is, there are many other "pyd_pub_authors" that are associated with other "pyd_pub_type", I need to filter them out as well. So, I need to filter out the meta_value "Newsletter" and all "pyd_pub_author" that are associated with it. What I've done is this:                $metakey       = $prefix . 'pub_author';         $authors_query = $wpdb->get_col(             $wpdb->prepare(                 "SELECT DISTINCT meta_value, post_id                  FROM $wpdb->postmeta                  WHERE meta_key = %s                  HAVING post_id = ANY (                  SELECT DISTINCT post_id                  FROM $wpdb->postmeta                  WHERE meta_value = 'Newsletter'                  )                 ", $metakey             )         );      This returns the name of an author for each of the post_id(s) that match the list, even if they are duplicate. The "DISTINCT" isnt filtering the names because it is checking the post_id.   So, what this leaves me to to is run an array_unique() to strip out the duplicates. It works, but there has to be an easier, less expensive way to do this. head->desk, head->desk, head->desk...


Delete Post With No Traffic?

My site has over 8k posts, some of which are outdated. To keep site maintainable and tidy, I want to delete all post with no traffic. Can this be done? Is there any plugin for this purpose? Or any way? Thanks in advance,


Wordpress can't fetch the posts from the database after moving to new server

After moving wordpress to a new server , I used the same domain in the old server , it's display "Nothing Found" in the index page , and even can't get the posts in "The most comments" widget , and even in the Admin panel i can't see it but I can see the posts counter (15,000) post , but i can see the posts in wp-posts table .


Navigate through the gallery using keyboard arrows

What I am trying to do is navigate through a post gallery using the left and right arrow key. I am aware the key codes for these are `e.keyCode == 37 and e.keyCode == 39` What will be the best way to tackle this? I looked into the jQuery keyboard plugin. Below is my gallery buttons for anyone who is interested
     <?php      global $page, $pages;     if ($page == count($page)):          $previous_post = get_previous_post();          ?>
         <a href="<?php echo get_permalink( $previous_post->ID ); ?>">Previous Gallery
         <?php            endif;          wp_link_pages( array(          'before' => '
',          'after' => '',         'previouspagelink' => 'Previous post',         'nextpagelink' => '',          'next_or_number' => 'next'      ) );      //echo('
'.$page.' of '.count($pages).'
');          wp_link_pages( array(          'before' => '',         'after' => '
',         'previouspagelink' => '',          'nextpagelink' => 'Next post',         'next_or_number' => 'next'     ) );           // If the current page equals the last page     if ($page == count($pages)):               $next_post = get_next_post();          // Then spit out the next link         ?>
         <a href="<?php echo get_permalink( $next_post->ID ); ?>">Next Gallery
          <?php     // End the if statement     endif; ?>
      I aim to use the functionality in each post. The aim is to switch between each page in that particular post however to have a catch to navigate to the next post when on the last page or if on the first page navigate to the previous post. I'm using the in each post.


Slow query when joining wp_posts with a lookup-table?

I'm developing a map-based website and need to get posts associated with a place. Each place has a post in `wp_posts` and the other associated posts (images of each place etc) is associated with the place using the custom lookup-table `wp_lookup_places` by post_id. How can I query to get the results in ms? I thought it would be a simple task for a mysql to filter based on indexed integers? Rows in lookup: 774 202 Total posts in db: 1 073 777 Current execution time: approx 33 sec My lookup table:               CREATE TABLE wp_lookup_places (         post_id bigint(20),         place_id bigint(20),         PRIMARY KEY (post_id, place_id)     );      Query from extending `WP_Query` with a `posts_where` filter for place with `post_id` `638891`.               SELECT   wp_posts.ID      FROM wp_posts      INNER JOIN wp_lookup_places ON  (wp_lookup_places.post_id = wp_posts.ID AND wp_lookup_places.place_id = 638891)       WHERE 1=1       AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')      ORDER BY wp_posts.post_title ASC LIMIT 0, 250;      Above query with EXPLAIN:               ******************** 1. row *********************                id: 1       select_type: SIMPLE             table: wp_posts              type: ref     possible_keys: PRIMARY,type_status_date               key: type_status_date           key_len: 62               ref: const              rows: 532062             Extra: Using index condition; Using where; Using filesort     ******************** 2. row *********************                id: 1       select_type: SIMPLE             table: wp_bb_places              type: eq_ref     possible_keys: PRIMARY               key: PRIMARY           key_len: 16               ref: server01.wp_posts.ID,const              rows: 1             Extra: Using where; Using index