How can I run shortcode after click with ajax

I have a little problem and need your help. I have tabs on my page and in one tab i have google maps. This tab is hidden by default and when i clik on it, i can see only small piece of maps. Map it is shortcode from one installed plugin. I found solution how to run ajax request (here) to load content after click and it looks like working right with simple html code, but when I try place php code with shortcode it doesn't work. I think it is simple but my knowledge is too small to write working code :(


Loop starts from the beginning with second while loop on author.php

I am using the same template for author.php and home/blog.php. I have a loop split into 3 parts.               <?php          if(have_posts()): the_post;       //do a thing     endif:          $i = 0;     while(have_posts()): the_post();       //do three things     $i++; if ($i == 3): break; endif;      endwhile;          while(have_posts()): the_post();       //do the rest     endwhile;          ?>      This seems to be working fine on the home/blog page but on the author.php, in the 2nd while loop, I'm getting posts starting from 1, when I shouldn't be getting any. For this particular author I have 2 posts so I should be getting something like:               <?php          if(have_posts()): the_post();       //post1     endif:          $i = 0;     while(have_posts()): the_post();       //post2     $i++; if ($i == 3): break; endif;      endwhile;          while(have_posts()): the_post();       //no posts     endwhile;          ?>       But instead I'm getting:               <?php          if(have_posts()): the_post();       //post1     endif:          $i = 0;     while(have_posts()): the_post();       //post2     $i++; if ($i == 3): break; endif;      endwhile;          while(have_posts()): the_post();       //post1 + post2     endwhile;          ?>      What's up with my loops?


Theme my login and update user meta

I'm french and I use the plugin "Theme my login". I want to know how I could update user's meta in a basic page. Thank's for help. In the template of my page , I have this code :                   $user_adresse_key = 'user_adresse';                 $user_adresse = get_user_meta( $user_id, $user_adresse_key, $single );                 ?>                 <form id="form_livraison" action="#formulaire" method='post'>                     <input type='text' name='user_adresse' value="<?php echo $user_adresse;?>" />                     <input type='submit' value='mettre à jour' name='submit_form' />                 </form>                 <?php                 update_user_meta($user_id, 'user_adresse', $_POST['user_adresse']);                 ?>


How to get rid of the strange sizing of links around posts?

I am currently running into a bit of a problem on my Wordpress site. I am designing a theme using the Bones framework, and after working for a while I have discovered a weird bug with links. Any time that I attempt to surround an image with a link using the a tag, the link 1) does not take the size of the image, and 2) Creates a weird 6px overhang on the bottom that makes it impossible to have a tight-fitting box around it. When I use a browser to inspect the styles, I see that there aren't any css styles that change the height or padding of the link, and using inline styles to set both to 0px doesn't have any effect either. How should I go about fixing this? This is what I mean: ![enter image description here](http://i.stack.imgur.com/SuRHO.png) As you can see, there are no link styles that change height. (The inherited body styles just change line-height and font-size.)


Rss feeds outside the loop, how do I sort by most viewed? Cookie?

I have a wordpress site with aggregated Youtube and Vimeo clips. I use WP RSS Aggregator for this, who doesn't store anything in posts, therefor makes it hard to create a most viewed function. I was thinking maybe a cookie would be the right way to go? This is the site: Skatevids.me.


Shotcode error on functions

Hello i have this shortcode that is generating a error. Can someone help?               add_shortcode('do-action', 'do_action_shortcode');          function do_action_shortcode($atts, $content = '') {       ob_start();       do_action($content);       $out = ob_get_contents();       ob_end_clean();       return $out;     }


How we redirect to other pages in WordPress?

I am using an `onclick` function to redirect the user if they are not login. I am calling a php function in achor tag like this               <a href="#" class="fright hrtacnhor" onclick="<?php checkstatus(); ?>">save to my favorite      and the function I am using is               <?php     function checkstatus(){         wp_redirect( get_permalink( 8 ) );exit;      }     ?>      But the problem is that when i click it not call the fucntion. I also try to use `wp_redirect()` function directly in `onclick` but it not working so any one please guide me how it works. Thanks


How to relate the Category to user?

I am developing one new plugin, In that i had a section to create new category, and having the field Created By(listing all the users in this field). I am storing the category name in WP_terms and the user name in the WP_usermeta. And now i need to display the Category list by corresponding users created, how can i make this please give me an idea.


Identify and display the fact that user is admin next to username in comment section

For all users to see. Not only the admin in cause. Also I am using a plugin called simple user ranking for displaying the user rank which is calculated for the number of comments posted, so I need to override this somehow; I dont want my admins to have a status of rookie or smth like that if he doesn't post a lot of comments. For displaying the rank Im using this in my comment- template.php                <?php if( function_exists('get_user_rank') ) echo get_user_rank(); ?>      I want to something like:                 if ( current_user_can('...')) echo 'admin' else  ( current_user_can('....'))       else if or end if : ( function_exists('get_user_rank') ) echo get_user_rank();       I have multiples choices when I add a new username like: moderator, editor, author ... maybe have a function based on these roles.. Thanks a bunch. Note: asking because Im noob in creating a function like that. Core of the plugin :                  if( !function_exists('get_user_rank') ) {          function get_user_rank()      {            if( !$ranks = get_option('_user_rank_comments_fields') ) return false;              $count = get_transient( 'user_rank_comments_' . substr(md5( strtolower(get_comment_author_email( $comment_id )) ),0,8) );              if ( false === $count ) {                  global $wpdb;             $count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(comment_ID)                                                        FROM ' . $wpdb->comments. '                                                        WHERE comment_author_email = %s                                                         AND comment_approved = 1'                                                         ,                                                          get_comment_author_email()                                                          )                                              );             set_transient( 'user_rank_comments_' . substr(md5( strtolower(get_comment_author_email( $comment_id )) ),0,8), $count );         }                    foreach( $ranks as $row ) {             if( $count >= (int)$row['count'] )                 $rank = $row['name'];             else break;         }         return $rank;     }         }


Wrong date returned by get_the_time

I have this line of code :               $registration_date = get_the_time('F j, Y').' at '.get_the_time('g:i a');      I just ran this on my BlueHost hosted website and it returned : January 29, 2013 at 12:54 pm However, on the same site I can see in the dashboard that post publication dates are correct.


Want to add more option in "Sexy Login"

I am using Sexy Login in my new website. Its a beautiful plugins. But i need to add some more options. I want to add more button for both who are logged in & who are not logged in like "Write New Post" "Add New Media". There is another problem which is by default its widgets wide limit is 240px but i want to make it 300px. So please help me to solve those problems.


Plugin update, is a deactivation and activation done?

When a plugin is being updated via the automatic updater, is that plugin deactivated and then re activated when the plugin update is finished? Also is a maintenance file created during theme and plugin updates, or only during core updates?


Using Custom Posts with Metaboxes and Drop-downs

When using Custom Posts and adding a Metabox, I was wondering how I could add a drop-down menu that would populate data that was added by the user. For example I want to be able to select a 'source' for the post using the drop-down, but under that I want the user to be able to add sources to that same drop-down. I've tried doing this on my own by using taxonomies for the sources and trying to populate the drop-down with those taxonomies, but I probably did it wrong. Any idea of how I can go about this?


Permalink doesn't get displayed in Twitter button (Local WordPress problem?)

I'm trying to add a custom "Tweet this" button to my WordPress posts. I'm sticking to the official Twitter guidelines. Here is what I'm actually trying to pull of; I don't want the button, I want a custom look - for me it's _only text_. This is the code I use:               <a href="https://twitter.com/share?url=<?php echo urlencode(get_permalink($post->ID)); ?> &text=<?php the_title(); ?> &via=username&count=horizontal" class="custom-tweet-button">Tweet      **Output:** > This is the post title via @username So the problem is that the permalink (`<?php the_permalink(); ?>`)doesn't get displayed. I tried:   * `https://twitter.com/share?url=<?php echo urlencode(get_permalink($post->ID)); ?>`   * `https://twitter.com/share?url=<?php the_permalink(); ?>` PS: I also tried the standard twitter button, not the custom one, but the permalink doesn't get displayed either. Does anyone one if something is wrong with my code or if this is a problem since I'm using a **local WordPress** for development?


sub posts to parent post

How to make a sub posts like this example http://www.samsung.com/us/mobile/cell-phones/SGH-I717RWAATT Overview Features Specs Gallery .... with link structure just like it! ....cell-phones/SGH-I717RWAATT-features ....cell-phones/SGH-I717RWAATT-specs can't find any plugin or something to do this! thanks


locate_template with multiple categories?

in this example (from Wrox book), if a `single-category-$slug.php` file exists, it will be shown, otherwise it's the `single.php` file. But if we have more than one category for each post (let's consider that the array `$templates` will contain more than one result), what will `$template`contain? where do we choose the right slug with this code?               <?php          add_filter( 'single_template', 'boj_single_template' );          function boj_single_template( $template ) {         global $wp_query;              /* Check if viewing a singular post. */         if ( is_singular( 'post' ) ) {                  /* Get the post ID. */             $post_id = $wp_query->get_queried_object_id();                  /* Get the post categories. */             $terms = get_the_terms( $post_id, 'category' );                  /* Loop through the categories, adding slugs as part of the file name. */             $templates = array();             foreach ( $terms as $term )                 $templates[] = "single-category-{$term->slug}.php";                  /* Check if the template exists. */             $locate = locate_template( $templates );                  /* If a template was found, make it the new template. */             if ( !empty( $locate ) )                 $template = $locate;         }              /* Return the template file name. */         return $template;     }          ?>      Thanks


custom change in front page

I want to remove the archive widget on the front page. How do I do it please? The archive section is at the bottom of site. Kirkuk Now Best Regards


How to get back to same page of post-list - after updating a post

I'm going back and reworking categories and tags on some older posts. So I'm going back in time, to say for example page 4 of my posts. I know there are search filters, which might help, but let's follow through with this scenario. I'm on page 4, and update the first post on that page. Now, is there a fast way to get back to page 4 to update the second post on that page? If I've changed a lot of tags or categories, I don't want to hit the browser back key five to ten times. Any shortcut I don't see in this case?


Post image in WordPress not appearing on home page

I just installed WordPress and I'm trying to set a image to every post I have. I did this: Custom fields ----name: paddimage-gallery --value: URL of image. I go to my home page and it does not appear. Example of a page were it does work: MAIMPOK THEME


Switching Code plugins

I am currently using "Wordpress Code Snippet" to add functionality to my code i insert into my posts. The way this plugin works is that you add the code into the plugins library in the settings and then do something like [code: 1] (cant quite remember the exact syntax off the top of my head) I'm not really too keen on its styling, so i'm hoping to use Google's Prettify. What implications would deactivating this plugin have? Would i lose all my code snippets? Would i have to go through every post and edit all the code snippets (ie. the [code: 1])?


Ability to leave comments broken

At some point, my readers were able to add comments on both the main (front) page of my site and from the post pages as well. Without any obvious change to the configuration of my site, the comment form has disappeared from my article page and, when I click the link from the front page to "add a comment," I'm brought to the article page with no comment form. You can see the behavior at http://www.full-stack.net.


Best Apache Log Analyzer Plugin?

What is the best apache log analyzer plugin for WordPress? Requirements: should produce all reports as available in flashstats: http://www.maximized.com/products/flashstats2006/ Im looking for things such as:   * files that have the highest impact on bandwidth usage,    * potential leechers,    * bad robots, etc... (on posting it said 'the question you are asking appears subjective and is likely to be closed...' no idea why, im really looking for a plugin that gives really a load of reports preferably multisite wide reporting so that i can see which sites use the highest resources). **a little update:** There are analyzers based on embedded elements in a page, the counters and the counter 2.0: pretty complete list: http://tellertest.com/tellers.php. There are many plugins for each of them (currently clicky is #1 and GA is #5) and even so much blockers: http://www.google.nl/search?sourceid=chrome&ie=UTF-8&q=block+google+analytics There are also log file analyzers like e.g. http://en.wikipedia.org/wiki/List_of_web_analytics_software I think the first class is more for marketing and the second class more for technical people. I think personally that the second class is more useful than the first class of analyzing what is happening on a server but maybe i am wrong. Analyzing data can produce infinite reports depending on imagination. Therefore I was wondering if there was a WordPress specific weblog-weblog Analyzer which among other has Apache logs / Syslogs / Other OS logs as data input. There are 69 pages when i search for 'statistics' in the WordPress Plugin dir.... If not, maybe it is interesting BI addon to create.


Login in Wordpress using external database data

I have a WP site and also have a external DB (means not WP DB) with users. The insertion process at that table uses the same algorithm as WP uses. What I'm need to do here is login in WP but using this external DB which is in the same host by the way. I check this links http://www.tyssendesign.com.au/articles/cms/connecting-to-external-database- from-within-wordpress/ and http://wordpress.org/extend/plugins/external- database-authentication/ and for the first is not what I'm want but for the second one is not compatible with WP 3+ and I'm using 3.3.1, any suggestion or docs or something else?


How do I get image url only on the_post_thumbnail

I want to know how to get image url on `the_post_thumbnail()` Default `the_post_thumbnail()`               <img width="800" height="533" src="http://domain.com/wp-content/uploads/2011/02/book06.jpg" class="attachment-post-thumbnail wp-post-image" alt="book06" title="book06" />      Here I want grab the src only. How do I filter `the_post_thumbnail()` only to get `http://domain.com/wp-content/uploads/2011/02/book06.jpg` Let me know


How to call the_time current?

I'm using the_time function to print the current date on my site. The problem is, that it's returning post or page creation times on pages other than the front page. Can I force it to print the _current_ time on all views?


Posts URL structure like site.com/category/the-post-title

I'm new with `wordpress` and I would like to understand better if it's possible to create pages with an url based on the `category` and then the `post title`, so: something like `http://mysite.com/category-name/the-post-title`   or `http://mysite.com/category-name/12345` (the post id)   or `http://mysite.com/category-name/12345/the-post-title` does exist some plug-in do this or should I consider other ways like `url_rewrite` to do this?


How to submit readme.txt file in wordpress directory

Hello i created a wordpress plugin and submit to wordpress directory, i got an email that my plugin approved but the problem is i've no readme.txt file so its not visible for public, I wants to know how to submit readme.txt after approval ?


WooCommerce - How can I list the same product as a variation and also as a simple product

In setting up a new WooCommerce store, I have a number of products that have size variations. (For example - Gizmo #26 in widths: 10mm 15mm 20mm etc.) No problem; Woocommerce can handle this. All of those products will be in a "complete range" category. My challenge is to offer another category "select products," made up of products from the "complete range" category, but only for one specific variation. (For example - Gizmo #26 in 15mm only) For inventory control purposes, I would like to have the single/simple product in the "select products" category be managed as part of the inventory represented by the the variation of the equivalent product in the "complete range" category. A variant of this challenge is defining "sets" made up of specific variations. (For example - Gizmo #26 in 15mm + Gizmo #12 in 20mm + Gizmo #3 in 8mm) I see an extension called Product Bundles that looks promising for this part of the puzzle, but don't know if it can answer the primary question: a single product referencing a variation of another product. How I can tie these disparate product definitions together for inventory control purposes? A SKU seems the logical answer, but I don't know if WooCommerce is adept at managing inventory by SKU. THANKS in advance for all suggestions!


How to add more fields to bbPress registration form

How can I add one or more extra fields to the registration form in bbpress 2.0.2? I want to add a textarea where prospective users can write their reason for joining the forum.


Don't publish/update a post when a plugin finds errors in custom fields

I have a question about how to stop processing a post when a plugin(server side) finds errors on custom fields. Basically I developed a plugin which adds and process some custom fields in the edit post panel. When i click on publish/update button i'd like to stop the process of updating or saving the post...in fact the plugin can stop the process of storing data from the custom fields when occurres errors but even with errors, posts can be published or updated anyway. How can I handle this situation? Thank you all!


How can I generate a RSS feed based on a custom WP_Query?

I have a WP_Query returning a list of posts of a particular post type and with a certain meta_value (custom field value) Is there a way generate an RSS feed based of these results ?


Exclude current post but keep the same posts-per_page amount

Okay I have a custom loop within the main loop of the page that shows 4 posts but obviously excludes the current main post. I'll show you:               <?php $my_query = new WP_Query( "cat=3&posts_per_page=4" );         if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post();             if($post->ID == $mainPost) continue; ?>             <?php get_template_part('workThumb'); ?>         <?php endwhile; endif; wp_reset_postdata(); ?>      However I want to show 4 posts in this loop but obviously if it contains the current post then it only shows 3. However if I increase the posts_per_page to 5 then on pages when it doesn't include the current post it shows 5 posts, which I don't want. I hope this makes sense. Any ideas?


MediaElement.js  works on one site but not the other?

I love the MediaElement.js plugin but I seem a little stumped. I have installed it on two WordPress sites: http://blog.mattforget.com/?p=94 and http://oedipus1.com/home/?p=3822 The sites are hosted with different providers. On `blog.mattforget.com`, in Firefox, the player looks great. It looks great just like it was inserted into Chrome, the iPhone browser, IE and safari. On the `oedipus1.com` site however, this does not happen. I end up seeing the broken player. My original thought was that maybe a mime type of some sort was not active on the `oedipus1.com` site that allows the plugin to work correctly, or that there is something conflicting with the plugin that is not allowing the player to show correctly. Regardless of my thoughts, I'd like to run this past you to see if by looking at the two sites or maybe from your past experience, you may be able to tell me what the issue is. Could you let me know if there is something I am missing? I would appreciate it immensely.


Pass data between pages

How would you solve this? On a post page (single.php) I need to echo out name of taxonomy that lead to it. So if I browse a list of posts from certain taxonomy and click on a post, I need on that post page (single.php) to show the previously viewed taxonomy name, that lead to post page. > taxonomy-albums.php > > taxonomy-songs.php > > single.php Is there a way without using GET, POST or COOKIE method?


Wordpress Rotating Background Images

I would like to be able to create a rotating background image that resizes with the browser window. I would like to also be able to set a certain amount of images to rotate per page or at the least start at a random number. Here is an example > http://www.theme-dutch.com/presents/screen/ Is there a plugin for this? I am assuming it's Jquery. Thanks.


How to make only posts show date

Made template but how to make date to show only in posts not anywhere else?
<?php the_date(); ?>
      This makes date to show in Home, Pages but i need only for posts. Something like if is post then the_date(); ?


Identify current wordpress theme

I want a theme very similar to these two websites. I am a newbie to wordpress and am trying to understand what theme is it. It looks like both the sites have a similar theme. Is there a way I can fin out what is the theme that they are using? Any help would be appreciated. http://www.evanmarckatz.com/ http://www.winggirlmethod.com/


Best practice for versioning wp-config.php?

Is there a best practice for including your `wp-config.php` file in your version control repository? I'm considering creating a new site with this type of configuration, (similar to Alex King and Mark Jaquith):               /index.php     /local-config.php     /wp-config.php     /wp/ (core)     /wp-content/ (plugins, themes, etc.)      **How can I do this without exposing my passwords to git, in case this repository ever becomes public?** Especially in Mark's post, it looks like the local-config.php can store local database details and passwords, but the production ones stay in the wp- config.php. Is this too much trouble and should I just leave wp-config.php unversioned?


show other images from same gallery

suppose you are viewing a single image from the gallery. You have both previous and next links there (for navigation). but is there a way to also show all the other images from the same gallery in the same page (for example i want to show other images from same gallery) if there is a way then can anyone please provide me the simplest code please.


Add post-new.php?post_cat=catslug to admin menu

I made it possible to use post-new.php?post_cat=catslug in the wordpress admin for creating a new post with a pre-filled category by using the answer here: How to add category to: 'wp-admin/post-new.php'? Now I want to create multiple menu items with this format under the "Posts" -> "Add new" admin menu item. So the menu will be: POSTS   * All posts    * Add New    * Add New Profile -> post-new.php?post_cat=profile   * Add New News -> post-new.php?post_cat=news    * Add New Pitch ->post-new.php?post_cat=pitch    * Categories   * etc. I have been able to add one item to the bottom of the menu with this code in functions.php               add_action( 'admin_menu' , 'admin_menu_new_items' );     function admin_menu_new_items() {         global $submenu;         $submenu['edit.php'][500] = array( 'Add new profile', 'manage_options' , '/wp-admin/post-new.php?post_cat=pitches' );      }        Questions:   1. Is this the best way to do this? Or do I need to use one of the functions as described here http://codex.wordpress.org/Administration_Menus. I tried some but I couldn't get it to work the way I want.   2. If the above code is the best way to go, how do I add more items?   3. How do I add the menu item below "Add new" (instead of below "tags")


How to make title for home to be News, but if page has parent then its name else just post/page name

Made own template from scratch and tutorials. This is showing description of post/page Title and in home its showing website name.
<?php is_home() ? bloginfo('description') : wp_title(''); ?>
      I wanted to change that if home page then that it writes News and if page then its name but if page is subpage then parent name.


How to only publish posts with image in it

I use a standard loop in my index.php and that shows all the posts beeing posted. What i'm looking for is a code that only shows the posts that have image(s) in it. With other words: i only want to show posts that have images in content in my loop.


MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?

**EDIT:** I want to update one field (post_content) within a known record (id of 4) of a known table (wp_posts) in a new database (new_db). The update has to come from one field (post_content) within a known record (id of 5) of a known table (wp_posts) in the _old_ database (old_db). Is this possible, or is something like this too atomic (?) for MySQL? Greetingz! When manipulating WordPress's database directly, I've seen many examples here where people replace a URL like so;               mysql> UPDATE wp_db.wp_post SET post_content=REPLACE(post_content, 'http://oldsite', 'http://newsite' ) ;      However, I have a .sql dump file from my old site, that I wish to import correctly. (I cannot create an XML export file, it's too late) I have created "dummy" posts on my new blog, and have imported the old database. Now I'm trying to do something like this;               UPDATE new_db.new SET post_content = REPLACE(post_content,(SELECT post_content FROM old_db.wp_posts WHERE id = oldpost#) WHERE id = newpost#;      I realize I'll have to do this for post_date, post_title, and post_content between old_db.wp_posts and new_db.posts, I'm just hoping this is actually possible somehow....


Getting the top level permalink using get_post_ancestors()

I have a function for displaying **the title** of the top-level page of the current sub-level page. It's working quite well, but I can't figure out how to also link to the same top level page that is displayed.               function my_page_ancestor() {         global $post;         if( !is_front_page() ) {             $parents = get_post_ancestors( $post );             $top_parent_link = get_permalink( end($parents) );             echo '' . get_the_title( end($parents) ) . '';         }     }      I've tried `get_the_permalink()` inside the function, but it just breaks. **Edit:** I've corrected the function above, and it now works as I wanted.


add_filter to post-gallery and remove all <br>'s?

hey guys, i really need your help. Whenever I use a gallery in wordpress and set it's columns to just 1 Wordpress automatically adds `<br style="clear: both"/>` after every `<dl class="gallery-item">`. I really need to prevent this behaviour and therefore I'd like to add a filter to my functions.php The following to examples don't work.               add_filter( 'post_gallery', 'remove_br_gallery', 9);          function remove_br_gallery($output) {              return preg_replace('#\<br*.?\>#is', '',  $output);          }                 add_filter( 'the_content', 'remove_br_gallery', 9);          function remove_br_gallery($output) {              return preg_replace('#\<br*.?\>#is', '',  $output);          }      Neither does this:               return str_replace('<br style="clear: both">', '',  $output);        Any idea how I could solve that? I just don't want to have any `<br style="clear: both"/>` inside of my galleries.


Copy price categories to custom field

I have just made a big mistake today using a plugin to convert my 1000+ price custom fields into child categories under Price. I didn't know the custom fields will be deleted after the conversion. The prices are still attach to their respective posts and I'll really appreciate it if somebody can help me with sql query to copy the values back to the price custom field. this is my function.php including your code               <?php     //get all categories ID's in to array     $args = array( 'child_of'  =>3678);     $categories = get_categories( $args );     $cat_array = array();     foreach ($categories as $category) {         $cat_array[] = $category->term_id;       }          $Query_args = array(         'category__in' =>$cat_array );     $new_query = new WP_Query();     $new_query->query($Query_args);     if ($new_query->have_posts()){         while ($new_query->have_posts()){             $new_query->the_post();             foreach((get_the_category()) as $category) {                  if (in_array($category->cat_ID,$cat_array){                     update_post_meta($post_id, 'price', $category->cat_name);                 }             }         }     }               /*************************************************************     * Do not modify unless you know what you're doing, SERIOUSLY!     *************************************************************/          /* Admin framework version 2.0 by Zeljan Topic */          // Theme variables     require_once (TEMPLATEPATH . '/library/functions/theme_variables.php');          //** ADMINISTRATION FILES **//          // Theme admin functions     require_once ($functions_path . 'admin_functions.php');          // Theme admin options     require_once ($functions_path . 'admin_options.php');          // Theme admin Settings     require_once ($functions_path . 'admin_settings.php');                    //** FRONT-END FILES **//          // Widgets     require_once ($functions_path . 'widgets_functions.php');          // Comments     require_once ($functions_path . 'comments_functions.php');          // Yoast's plugins     require_once ($functions_path . 'yoast-breadcrumbs.php');          require_once ($functions_path . 'yoast-posts.php');          //require_once ($functions_path . 'yoast-canonical.php');          require_once ($functions_path . 'yoast-breadcrumbs.php');          /////////shopping cart new function files     require($functions_path . "general_functions.php");     require($functions_path . "cart.php");     require($functions_path . "product.php");     require($functions_path . "custom.php");     require(TEMPLATEPATH . "/product_menu.php");     // Custom     require_once ($functions_path . 'custom_functions.php');          ///message - language file     require(TEMPLATEPATH . "/message.php");     if('themes.php' == basename($_SERVER['SCRIPT_FILENAME'])  && $_REQUEST['page']=='')      {         if($_REQUEST['dummy']=='del')         {             delete_dummy_data();                 echo THEME_DUMMY_DELETE_MESSAGE;         }         $post_counts = $wpdb->get_var("select count(post_id) from $wpdb->postmeta where meta_key='pt_dummy_content'");         if(($_REQUEST['template']=='' && $post_counts>0 && $_REQUEST['page']=='') || $_REQUEST['activated']=='true')         {             echo THEME_ACTIVE_MESSAGE;         }         if($_REQUEST['activated'])         {             require_once (TEMPLATEPATH . '/auto_install.php');         }     }          function delete_dummy_data()     {         global $wpdb;         $productArray = array();         $pids_sql = "select p.ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id=p.ID where meta_key='pt_dummy_content' and meta_value=1";         $pids_info = $wpdb->get_results($pids_sql);         foreach($pids_info as $pids_info_obj)         {             wp_delete_post($pids_info_obj->ID);         }     }          ?>


Display latest post of taxonomy

I have custom post type (entertainment) and I set up a taxonomy (review) as hierarchal so there are check boxes under the taxonomy. Most of the post in the entertainment are just post but we also have reviews. What I was hoping is that if it's a review then you can just check what type of review in the review taxonomy box, an example is "movie". I am trying to display the latest review using               query_posts( array('tax_query' => array(array('taxonomy' => 'review','field' => 'slug','term' => 'movie')), 'posts_per_page'=>'1', 'caller_get_posts'=>'1') );       But it's showing the latest post and not the one selected as movie. I'm on WP 3.1


How do I combine my shortcodes?

Example I want combine shortcode for first paragraph and dropcap.               function st_dropcap( $atts, $content = null ) {         return ''.$content.'';     }     add_shortcode('dropcap', 'st_dropcap');          function st_paragraph( $atts, $content = null ) {         return '
'.$content.'
';     }     add_shortcode('paragraph', 'st_paragraph');      On post I tried something like this               [paragraph][dropcap]W[/dropcap]elcome to my blog[/paragraph]      Only paragraph is working. How do I combine this code? Let me know


Using date stored as custom field to filter posts displayed in admin

This seems like a fairly common problem, but I'm posting this as I've yet to find a solution to my problem here on WP Answers - any help is HUGELY appreciated! Ok - so I have a custom post type of 'events' where I capture the date of the event using a custom field and store it as a unix timestamp. Filtering posts on the front end is not a problem using the following code to show future events only:               $events = new WP_Query( 'post_type=events&posts_per_page=-1&meta_key=date_value&orderby=meta_value&meta_compare=>=&meta_value='.time().'&order=ASC' );      I've tried to filter the results in the admin in the same way using a `pre_get_posts` filter:               function events_pre_get_posts($query) {       if (is_admin()) {         if (isset($query->query_vars['post_type'])) {           if ($query->query_vars['post_type'] == 'events') {               $query->set('meta_key', 'date_value');               $query->set('orderby', 'meta_value');               $query->set('meta_compare', '>=');               $query->set('meta_value', time());               $query->set('order', 'ASC');           }         }       }     }     add_filter('pre_get_posts' , 'events_pre_get_posts');      But in the admin this code just makes all my posts disappear! I'm also trying to find a way to show past events in the back end and I'm really stuck there too! I not sure the best way to do this - perhaps a toggle on the 'events' posts page to view past / future events. Help!!


Is there some jQuery conflict here?

I'm customizing a wordpress theme called Accordium, and I have decided to add infinite scroll to it using a wordpress plugin called pbd-ajax-load-posts. In the theme, when you click on a post in archive view, an accordian animation plays by standard. The problem is, the plugin fails to render the default accordion style of posts in the archive when you click on Load More Posts [farthest bottom, in Persian] and shows it like when a post is clicked, leaving it with a fixed open accordian. >   * screenshot #1: h.dropcanvas.com/bf49k/ajax_load.jpg >   * screenshot #2: h.dropcanvas.com/5aoza/ajax_load2.jpg > On my site, it seems that it only shows class="pk_entry", rather than the entire class="pk_post", but I might be mistaken. It seems to me that there should be a jQuery or PHP conflict, but you know I'm no professional. You can see my site at > etrewp.ir/ezdevaj.ma


Editor background colour in full screen

In this Q&A, How do you change the visual editor's background color?, it is shown how to modify WordPress' editor background colour.   My question is how can I modify the editor's background colour, in full screen mode? (also called "distraction free" mode).   The solution in the linked thread does not work for full screen editor mode.


Settings options not showing up in WordPress plugin

I dont know why is that all the plugins that i installed rigth now didnt showed the "settings" buttom ![enter image description here](http://i.stack.imgur.com/zmHkw.png)


dynamically update permalink and title with the values of custom fileds

Im working on an interface for a custom post type where I need the post title to carry the date and venue name. So on the Admin end I've got js that dynamically populate the title as the user fills out the form. If the user dosen't languish this information is then saved as a part of the permalink. Sometimes however the post is saved as a draft before the title is populated and we end up with an misleading URL. My feeling is that it would be best I were to just hide the title all together on this post type, and look for a hook to populate the title AND rework the post url with the field values the user has set when saving the post. As of now I cant find any hooks or filters that look like they would be of help. ![example screen shot](http://i.stack.imgur.com/gwd8V.png) Help?


Updated WordPress and now image crop, thumbnail setting and thumbnails are gone

I've updated to WordPress 3.7.1 and when I upload images to my site, it's not generating thumbnails. It's also missing the image crop and thumbnail setting sidebar. I created a simple theme but didn't make any kind of changes. Everything was working just fine up until the update. I'm also using the default WordPress Gallery. I've been searching but can't find anything on this.


Can I save part of the post in an external file and join it on the fly to avoid redundancy in the wp_posts table?

To start with, I apologise if this is a double, which I believe is the case, but searching for similar posts is not easy. In my blog, I will have a lot of posts(more than 1000 at one stage) where the only change between these posts is data. The content - made up of heavy HTML - will be the same. A good example - although my HTML will be bigger - is: ![a busy cat](http://www.w3.org/TR/html401/images/mergedcells.gif) ... where the only difference between posts are the values. Now I know I can save the same HTML for every post I publish, but is there a more efficient way of doing it in order NOT to save the same HTML over and over again in the wp_posts table? It would be such a big waste in my opinion. What I thought so far is that I can: a. Keep the empty HTML in - let's say - a text file with dummy data      b. In the post I save only the data, so if we are to use the above image as an example, I save 1.9|0.003|40%   and   1.7|0.002|43%      c. In the single.php file, on the fly that is, I get the HTML from the text file, the data from the post and I merge them by manipulating the pipe- delimited string Does it make sense and if yes, is my way of doing it the best way? Or maybe I should keep the HTML in the database, in a custom table maybe? Thanks!


How to change the order of elements in comment_form()

I’ve put the class for 'logged_in_as' into another container to display the content in another column:
                 <?php                    $fields =  array(                      'author' => '

                                 <input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />
',                 'email'  => '
                                 <input id="email" name="email" type="text" value="Name' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />
',                 'url'    => '
                                 <input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />

',             );                    comment_form( array(                     'label_submit' => 'Beitrag kommentieren',                 'title_reply' => '',                 'fields' => apply_filters(                    'comment_form_default_fields', $fields ),                 'comment_notes_before' => '',                 'comment_notes_after' => '',                'logged_in_as' => '

'                                      . sprintf(                                            __( 'Logged in as %s .                                                 Log out?

'                                            )                                           , admin_url( 'profile.php' )                                           , $user_identity                                           , wp_logout_url( apply_filters( 'the_permalink'                                                                           , get_permalink( $post_id )                                                                           )                                                            )                                        )                 ?>
      But the submit-button for the comment-field (which is in the left column) only displays after the content of 'logged_in_as'. ![screenshot of the comment- form](http://i.stack.imgur.com/sY1h0.png) But I want to place the submit-button on the left side below the comment- field. How can I place the Submit-Button before the 'logged_in_as'-Content?


How to benchmark a WordPress installation?

I'm trying to gather some benchmarking data to determine how well my optimizations to WordPress are fairing. I've found this page on High Traffic Tips but it doesn't contain any data. Are there any tools that benchmark WordPress? Not just how well it holds up against traffic, but things like how caching fairs when you're performing X Posts an hour and X comments a minute as well as other normal use cases for WordPress. For the record, I've run Siege and Blitz.io against installations, but that's merely how well your site can cache and serve/spread the requests around. If that's the only the only measurement that can be consistently produced (maybe req/s is the only way to go) then that's fine. If there are other tools that can show how many req/s can be sustained over varying usage (have to regenerate the cache ever 10 mins will have a big impact if it's serve while refreshing, or clear out cache then refresh cache).


How to delete remain data in WP database after deleting custom post via admin interface

I'm trying to create a plugin that will delete pictures and additional info from database on deleting custom post (sp_venue) via admin panel (wp- admin/edit-tags.php) In the plugin I'm using this to catch the event:               add_action( 'delete_post', 'kg_delete_post' );          function kg_delete_post($postId) {              $post = get_post($postId);              if ($post->post_type != 'attachment') {             return false;         }              $url = str_replace($dirs['baseurl'],'',$post->guid);         $urlParts = explode("/",$url);         $numberOfParts = sizeof($urlParts) - 1;              $dirs = wp_upload_dir();         $fileNameParts = explode(".", $urlParts[$numberOfParts]);         $fileName = str_replace('.' . end($fileNameParts), '', $urlParts[$numberOfParts]) . "-*." . end($fileNameParts);         $path =$dirs['basedir'] ."/".  $urlParts[$numberOfParts-2] . "/" . $urlParts[$numberOfParts-1] . "/";         $fullPath = $path  . $urlParts[$numberOfParts];         $fullPathSearch = $path . $fileName;              @unlink($fullPath);         foreach (glob($fullPathSearch) as $filename) {             @unlink($path . $filename);         }     }      It works with:               wp_delete_post($Id, true)      But looks like the event on deleting via admin panel is no the same. What should i use to make it works? Thank you.


Why is WP_Query's meta_query not filtering results?

I am working on a wordpress site that utilizes WP_Query to find songs based on their category, tags, and other things in a tax_query, but it also groups in a meta_query which (should) find songs based on bpm and other metadata. In the Media tab on Wordpress, admin can add songs, and attach them to a Product, listing track information such as composer, BPM, etc. All of the tax_query things (category, tags, moods, etc.) pull back songs properly. However, if I put in a BPM of 90--every track in the database is returned. What's going on with this? Here's the entire search function:               <?php     /* Template Name: Advanced Search Results */     get_header();          if( isset( $_POST['submit-track-search'] ) ) {     // Build our Query     $track_q = array(       's' => $_POST['track-search-term'],       'post_type'   => 'product',       'post_status' => 'publish',     );          $track_q['tax_query'] = array();     $track_q['meta_query'] = array();     $search_tax_fields = array();     $search_meta_fields = array();               if( isset( $_POST['track-catalog'] ) and $_POST['track-catalog'] != "-1" ) {       $track_q['tax_query'][] = array(         'taxonomy'    => 'product_catalog',         'field'       => 'slug',         'terms'       => $_POST['track-catalog']       );       $search_tax_fields[] = $_POST['track-catalog'];     }          if( isset( $_POST['track-tag'] ) and $_POST['track-tag'] != "-1" ) {       $track_q['tax_query'][] =  array(         'taxonomy'    => 'product_tag',         'field'       => 'slug',         'terms'       => $_POST['track-tag']       );       $search_tax_fields[] = $_POST['track-tag'];     }          if( isset( $_POST['track-mood'] ) and $_POST['track-mood'] != "-1" ) {       $track_q['tax_query'][] =  array(         'taxonomy'    => 'product_mood',         'field'       => 'slug',         'terms'       => $_POST['track-mood']       );       $search_tax_fields[] = $_POST['track-mood'];     }          if( isset( $_POST['track-style'] ) and $_POST['track-style'] != "-1" ) {       $track_q['tax_query'][] =  array(         'taxonomy'    => 'product_style',         'field'       => 'slug',         'terms'       => $_POST['track-style']       );       $search_tax_fields[] = $_POST['track-style'];     }          if( isset( $_POST['track-composer'] ) and !empty( $_POST['track-composer'] ) ) {       $search_meta_fields[] = $_POST['track-composer'];            $track_q['meta_query'][] =  array(           'meta_key'    => '_track_composer',           'meta_value'  => $_POST['track-composer'],           'compare'     => 'LIKE'       );     }     if( isset( $_POST['track-publisher'] ) and !empty( $_POST['track-publisher'] ) ) {       $search_meta_fields[] = $_POST['track-publisher'];            $track_q['meta_query'][] =  array(           'meta_key'    => '_track_publisher',           'meta_value'  => $_POST['track-publisher'],           'compare'     => 'LIKE'       );     }     if( isset( $_POST['track-bpm'] ) and !empty( $_POST['track-bpm'] ) ) {       $search_meta_fields[] = $_POST['track-bpm'];            $track_q['meta_query'][] =  array(           'meta_key'    => '_track_bpm',           'meta_value'  => $_POST['track-bpm'],           'compare'     => 'LIKE'       );     }     if( isset( $_POST['track-temp'] ) and !empty( $_POST['track-temp'] ) ) {       $search_meta_fields[] = $_POST['track-temp'];            $track_q['meta_query'][] =  array(           'meta_key'    => '_track_temp',           'meta_value'  => $_POST['track-temp'],           'compare'     => 'LIKE'       );     }          if( count( $search_tax_fields ) >= 2 ) {       $track_q['tax_query']['relation'] = "AND";     }          if( count( $search_meta_fields ) >= 2 ) {       $track_q['meta_query']['relation'] = "AND";     }          $tracks = new WP_Query( $track_q );     }     ?>
     <form id="advance-search" name="advance-search" method="post" action="http://premiumstockmusic.com/search-results">

         Search For</tf>         <input type="text" name="track-search-term" id="track-search-term" value="<?php echo isset( $_POST['track-search-term'] ) ? $_POST['track-search-term'] : ''; ?>" />	          	         Catalog	                  <select name="track-catalog" id="track-catalog">           <option value="-1">Please Select One</option>           <?php           $catalog_terms = get_terms( 'product_catalog' );           if( isset( $_POST['track-catalog'] ) ) {             $selection = ' selected="selected"';             $selected_term = $_POST['track-catalog'];           }           foreach( $catalog_terms as $catalog ) {             if( $catalog->slug != $selected_term ) {               echo '<option name="option'. $catalog->slug .'" value="'. $catalog->slug .'">'. $catalog->name .'</option>';             } else {               echo '<option name="option'. $catalog->slug .'" value="'. $catalog->slug .'"'. $selection .'>'. $catalog->name .'</option>';             }           }           ?>         </select>

         Moods	                  <select name="track-mood" id="track-mood">           <option value="-1">Please Select One</option>           <?php           $mood_terms = get_terms( 'product_mood' );           if( isset( $_POST['track-mood'] ) ) {             $selection = ' selected="selected"';             $selected_term = $_POST['track-mood'];           }           foreach( $mood_terms as $mood ) {             if( $mood->slug != $selected_term ) {               echo '<option name="option'. $mood->slug .'" value="'. $mood->slug .'">'. $mood->name .'</option>';             } else {               echo '<option name="option'. $mood->slug .'" value="'. $mood->slug .'"'. $selection .'>'. $mood->name .'</option>';             }           }           ?>         </select>         	          	         Music Styles	                  <select name="track-style" id="track-style">           <option value="-1">Please Select One</option>           <?php           $style_terms = get_terms( 'product_style' );           if( isset( $_POST['track-style'] ) ) {             $selection = ' selected="selected"';             $selected_term = $_POST['track-style'];           }           foreach( $style_terms as $style ) {             if( $style->slug != $selected_term ) {               echo '<option name="option'. $style->slug .'" value="'. $style->slug .'">'. $style->name .'</option>';             } else {               echo '<option name="option'. $style->slug .'" value="'. $style->slug .'"'. $selection .'>'. $style->name .'</option>';             }           }           ?>         </select>

         Tagged With	                  <select name="track-tag" id="track-tag">           <option value="-1">Please Select One</option>           <?php           $catalog_tags = get_terms( 'product_tag' );                if( isset( $_POST['track-tag'] ) ) {             $selection = ' selected="selected"';             $selected_tag = $_POST['track-tag'];           }           foreach( $catalog_tags as $tag ) {             if( $tag->slug != $selected_tag ) {               echo '<option name="option'. $tag->slug .'" value="'. $tag->slug .'">'. $tag->name .'</option>';             } else {               echo '<option name="option'. $tag->slug .'" value="'. $tag->slug .'"'. $selection .'>'. $tag->name .'</option>';             }           }           ?>         </select>         	          	         Tempo	         <input type="text" name="track-temp" id="track-temp" value="<?php echo isset( $_POST['track-temp'] ) ? $_POST['track-temp'] : ''; ?>" />

         BPM	         <input type="text" name="track-bpm" id="track-bpm" value="<?php echo isset( $_POST['track-bpm'] ) ? $_POST['track-bpm'] : ''; ?>" />	          	         Instruments	                  <select name="track-instrument" id="track-instrument">           <option value="-1">Please Select One</option>           <?php           $instrument_tags = get_terms( 'product_instrument' );                if( isset( $_POST['track-instrument'] ) ) {             $selection = ' selected="selected"';             $selected_tag = $_POST['track-instrument'];           }           foreach( $instrument_tags as $instrument ) {             if( $instrument->slug != $selected_tag ) {               echo '<option name="option'. $instrument->slug .'" value="'. $instrument->slug .'">'. $instrument->name .'</option>';             } else {               echo '<option name="option'. $instrument->slug .'" value="'. $instrument->slug .'"'. $selection .'>'. $instrument->name .'</option>';             }           }           ?>         </select>

         <input type="submit" name="submit-track-search" id="submit-track-search" value="Search Our Tracks" />

     </form>       <?php if ( $tracks->have_posts() ):  ?>         <div id="post-<?php the_ID(); ?>" <?php post_class('product_search_result'); ?>>
Search Results

       <?php while( $tracks->have_posts() ): $tracks->the_post(); ?>

 +<?php the_title(); ?>

                 Buy Now:	                 <a href="<?php global $product; echo $product->add_to_cart_url( get_the_ID() ); ?>" class="add-to-cart-button">Add To Cart
                 Description:	                 <?php the_excerpt(); ?>

                 Catalog:	                 <?php the_terms( get_the_ID(), 'product_catalog', '', ', ', '' ); ?>

                 Moods:	                 <?php the_terms( get_the_ID(), 'product_mood', '', ', ', '' ); ?>

                 Music Style:	                 <?php the_terms( get_the_ID(), 'product_style', '', ', ', '' ); ?>

                 Instruments:	                 <?php the_terms( get_the_ID(), 'product_instrument', '', ', ', '' ); ?>

                 Composer:	                 <?php echo get_post_meta( get_the_ID(), '_track_composer', true ); ?>

                 Publisher:	                 <?php echo get_post_meta( get_the_ID(), '_track_publisher', true ); ?>

                 Keywords:	                 <?php echo $product->get_tags( ', ', '', '' ); ?>

                 Tempo:	                 <?php echo get_post_meta( get_the_ID(), '_track_temp', true ); ?>

                 BPM:	                 <?php echo get_post_meta( get_the_ID(), '_track_bpm', true ); ?>

                 Length:	                 <?php echo get_post_meta( get_the_ID(), '_track_length', true ); ?>

                  <?php echo do_shortcode( '[audio file="'.get_post_meta( get_the_ID(), '_track_preview_file', true ).'"]' ); ?>
       <?php endwhile; else: ?>
No results found that match those settings.
       <?php endif; ?>

     <?php get_footer(); ?>      **EDIT:** The result of var_dump($tracks); (without the results, since all items are being returned for some reason) is:               object(WP_Query)#714 (45) { ["query_vars"]=>        array(61) { ["s"]=> string(0) ""                    ["post_type"]=> string(7) "product"                    ["post_status"]=> string(7) "publish"                    ["tax_query"]=> array(0) { }                    ["meta_query"]=> array(1) {                      [0]=> array(3) {                        ["meta_key"]=> string(10) "_track_bpm"                        ["meta_value"]=> string(2) "90"                        ["compare"]=> string(1) "="                      }                    }                    ["error"]=> string(0) ""                    ["m"]=> int(0) ["p"]=> int(0)                    ["post_parent"]=> string(0) ""                    ["subpost"]=> string(0) ""                    ["subpost_id"]=> string(0) ""                    ["attachment"]=> string(0) ""                    ["attachment_id"]=> int(0)                    ["name"]=> string(0) ""                    ["static"]=> string(0) ""                    ["pagename"]=> string(0) ""                    ["page_id"]=> int(0)                    ["second"]=> string(0) ""                    ["minute"]=> string(0) ""                    ["hour"]=> string(0) ""                    ["day"]=> int(0)                    ["monthnum"]=> int(0)                    ["year"]=> int(0)                    ["w"]=> int(0)                    ["category_name"]=> string(0) ""                    ["tag"]=> string(0) ""                    ["cat"]=> string(0) ""                    ["tag_id"]=> string(0) ""                    ["author_name"]=> string(0) ""                    ["feed"]=> string(0) ""                    ["tb"]=> string(0) ""                    ["paged"]=> int(0)                    ["comments_popup"]=> string(0) ""                    ["meta_key"]=> string(0) ""                    ["meta_value"]=> string(0) ""                    ["preview"]=> string(0) ""                    ["sentence"]=> string(0) ""                    ["fields"]=> string(0) ""                    ["menu_order"]=> string(0) ""                    ["category__in"]=> array(0) { }                    ["category__not_in"]=> array(0) { }                    ["category__and"]=> array(0) { }                    ["post__in"]=> array(0) { }                    ["post__not_in"]=> array(0) { }                    ["tag__in"]=> array(0) { }                    ["tag__not_in"]=> array(0) { }                    ["tag__and"]=> array(0) { }                    ["tag_slug__in"]=> array(0) { }                    ["tag_slug__and"]=> array(0) { }                    ["post_parent__in"]=> array(0) { }                    ["post_parent__not_in"]=> array(0) { }                    ["ignore_sticky_posts"]=> bool(false)                    ["suppress_filters"]=> bool(false)                    ["cache_results"]=> bool(true)                    ["update_post_term_cache"]=> bool(true)                    ["update_post_meta_cache"]=> bool(true)                    ["posts_per_page"]=> int(50)                    ["nopaging"]=> bool(false)                    ["comments_per_page"]=> string(2) "50"                    ["no_found_rows"]=> bool(false)                    ["order"]=> string(4) "DESC" }                    ["tax_query"]=> object(WP_Tax_Query)#727 (2) {                      ["queries"]=> array(0) { }                      ["relation"]=> string(3) "AND"                    }                    ["meta_query"]=> object(WP_Meta_Query)#728 (2) {                      ["queries"]=> array(1) {                        [0]=> array(3) {                          ["meta_key"]=> string(10) "_track_bpm"                          ["meta_value"]=> string(2) "90"                          ["compare"]=> string(1) "="                        }                      }                      ["relation"]=> string(3) "AND"                    }                    ["post_count"]=> int(50)                    ["current_post"]=> int(-1)                    ["in_the_loop"]=> bool(false)                    ["comment_count"]=> int(0)                    ["current_comment"]=> int(-1)                    ["found_posts"]=> string(3) "109"                    ["max_num_pages"]=> float(3)                    ["max_num_comment_pages"]=> int(0)                    ["is_single"]=> bool(false)                    ["is_preview"]=> bool(false)                    ["is_page"]=> bool(false)                    ["is_archive"]=> bool(true)                    ["is_date"]=> bool(false)                    ["is_year"]=> bool(false)                    ["is_month"]=> bool(false)                    ["is_day"]=> bool(false)                    ["is_time"]=> bool(false)                    ["is_author"]=> bool(false)                    ["is_category"]=> bool(false)                    ["is_tag"]=> bool(false)                    ["is_tax"]=> bool(false)                    ["is_search"]=> bool(false)                    ["is_feed"]=> bool(false)                    ["is_comment_feed"]=> bool(false)                    ["is_trackback"]=> bool(false)                    ["is_home"]=> bool(false)                    ["is_404"]=> bool(false)                    ["is_comments_popup"]=> bool(false)                    ["is_paged"]=> bool(false)                    ["is_admin"]=> bool(false)                    ["is_attachment"]=> bool(false)                    ["is_singular"]=> bool(false)                    ["is_robots"]=> bool(false)                    ["is_posts_page"]=> bool(false)                    ["is_post_type_archive"]=> bool(true)                    ["query_vars_hash"]=> string(32) "ac0d4d0d12ae36d5be9a88790932d407" ["query_vars_changed"]=> bool(false) ["thumbnails_cached"]=> bool(false)                    ["query"]=> array(5) {                      ["s"]=> string(0) ""                      ["post_type"]=> string(7) "product"                      ["post_status"]=> string(7) "publish"                      ["tax_query"]=> array(0) { }                      ["meta_query"]=> array(1) {                        [0]=> array(3) {                          ["meta_key"]=> string(10) "_track_bpm"                          ["meta_value"]=> string(2) "90"                          ["compare"]=> string(1) "="                        }                      }                    }                    ["request"]=> string(205) "SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 50"


Using Advanced Custom Fields plugin's file type "File" to upload from front end

here is my current situation:   * I already have a custom add/edit form with unique features, so I won't be able to use "ACF's front end form" that will create a form of it's own.   * For standard text field for input, I display the form like `<input type="text" id="price" value="<?php get_field('price', $post_id); ?>" />` and save it in a function like               if ( isset($_POST['price']) ) {         update_field('price', $_POST['price'], $post_ID);     }      which works great   * But what about the ACF's field type "File"? I want to let the user upload it from my existing front end form, but taking advantage of using ACF's "Library -> Uploaded to post" and "Required -> Yes" features as you can see this snapshot: ![enter image description here](http://i.stack.imgur.com/oEXIY.png) If this is not possible, do you know of any other WP plugin that allows you to do this into an existing form? The uploaded file should only be owned by the user that uploaded it so only he can delete or edit it. So ACF's "Library -> Uploaded to post" is a must.


The excerpt: Display text OR image OR video

Is it possible to adjust the excerpt so it will show text **or** one image **or** one video? The following codes makes it possible to show all of the above, but i'd really like to limit that, dependent of whats included in the post..               <?php      function improved_trim_excerpt($text) {             global $post;             if ( '' == $text ) {                     $text = get_the_content('');                     $text = apply_filters('the_content', $text);                     $text = str_replace('\]\]\>', ']]>', $text);                     $text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);                     $text = strip_tags($text, '<iframe>, <p>, <img>');                     $excerpt_length = 66;                     $words = explode(' ', $text, $excerpt_length + 1);                     if (count($words)> $excerpt_length) {                             array_pop($words);                             array_push($words, '[...]');                             $text = implode(' ', $words);                     }             }             return $text;     }     ?>     <?php     remove_filter('get_the_excerpt', 'wp_trim_excerpt');     add_filter('get_the_excerpt', 'improved_trim_excerpt');     ?>


What's the safest way to switch and restore a post global?

I need to switch WordPress's post context, sort of like `switch_to_blog()` but for posts. What's the safest way to alter WordPress's global state and switch it back?


How can I find the cause of theme crashing Apache in Xampplite?

I'm testing a version of my theme in WordPress 3.0 and it crashes Apache each time I try to preview it. Where can I look to trace the cause of the crash? WP_DEBUG is of no use in this case, since it never gets to that point. Can I trace errors in XAMPPLITE somewhere?


Display posts in three columns by category

I've seen posts which probably answer this, but unfortunately the answers are all a bit technical without telling you where the code should go? At the moment I have my posts directed to a blog page. I separate my posts into three categories. What I would like is to have 3 columns for each category, with the ability to put an image and title above the start of each column, and a styled line between them. I understand that this involves Loops and editing the php files, but in other posts they don't say which php files or which css etc? Sorry for being stupid, but if possible a simple explanation would be great. I'm using the free pagelines theme, but on a localhost as just learning. Thanks very much!!


Is there a theme function for is_password_protected()?

I'm looking at the function and template references and I'm not seeing a way to test for whether a post is protected. Is there a theme function for (something like) `is_password_protected()`? I'm already using `add_filter( 'the_password_form', 'custom_password_form' );` to override the default form that shows up, but I want to customize some other aspects of the look when a post is password protected.


Creating a Search Array From Multiple Tables

I'm working with a client's WordPress site that has user submissions (via TDO Mini Forms) from multiple countries, and they would like to be able to search for posts by region – Europe, Africa, Central America, etc. There is a custom field already in place for the user's country of origin. I also have a separate table that maps countries to regions. What I want to do is make it so that the user can select Europe, for example, from a map, and have WP return any posts from countries that are mapped as EU. What's the best way to accomplish this? Not only do I not want to reinvent the wheel, but WP can be very fussy about it search functions. My first thought was to perform a search of the Regions table, return all of the countries as an array, and then use that array to perform a WP search, but I'm not finding how to do that without creating an AND search, which returns nothing. Thanks for any help. ty


How do I change the upload file size limit in single-site wordpress install?

In the multi-site wordpress install, you get a very nice "upload settings" in the network admin settings. (see attached image). I am trying to change these settings without using php.ini for a single-site wordpress install and I can't find them anywhere... help? Tim Attached: Network Admin Settings Example: ![Network admin example](http://i.stack.imgur.com/45DzX.png)


Why does the HTML editor not wrap my code in paragraph tags when I press enter

Normally when using a rich text editor, when you hit return (i.e. do a full paragraph return) Your text is wrapped i.e. `<p> my text </p>` however this does not happen in wordpress. Is there any way to trigger this functionality?


How to wrap every image in a post with a div?

When I add an image to a post I want it to be in a div e.g. , and I want that to be done automatically, so I don't have to do that in HTML editor. I don't want to use js to accomplish this and by the way I want to know how to automatically add custom classes to a image in a post. Cheers!


Manually delete post from database

For whatever reason, I have a post and a page with the same slug name and it causes the db to hang. I can't alter the slug on either so I need to go manually delete the posts from the database and start over. Now, I am willing to go pull up the post ID from wp_posts and wp_postmeta and manually delete each entry. Will this screw up anything else in the database assuming I have no comments on either post or page? **EDIT** I found this script and I think it's ok but I'm not sure if this takes care of revisions or anything else I would leave behind from manually deleting the post               DELETE a,b,c     FROM wp_posts a     LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )     LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )     WHERE a.ID = xxx;


iframe/embed vid in text widget loads outside container and moves around when scrolling the page?

I've inherited webmaster tasks for a site re-design that involves heavy use of widgets. On the frontpage, two videos are loading in two text widgets, and they play fine once loaded. The problem is that on first load of the page, the video that uses `<embed />` loads randomly up by the top left hand corner of the screen and then jumps down the page to its container - once the page is cached it stays within its container. The second iframe video loads within its container, but then moves around slightly when you scroll up and down the page. This issue just began yesterday which is weird because all development has stopped this week and they've been fine before. It is most noticeable in IE9, although I've been able to recreate it randomly in Firefox on Windows and Mac. Haven't tried IE8/7. There are videos loading in text widgets in the sidebar on the other pages in the site (mostly iframes), and there are no problems on any of those pages. www.redrockla.com/roomag/ Thank you for any suggestions, and please let me know if you need code in a pastebin. (Also, I didn't develop the site myself, so if there are any other fixable errors you see that I may not know about, please feel free to let me know.)


help to decipher wp metadata

I am having problems trying to decipher the metadata information. What does all the a: , s: stuff mean? is there a place where i can reference what all this coding means in wp? not just for attachment metadata, but users, etc. thanks


How to set a conditional statement for $attachment->post_excerpt, to check for value?

I have a custom function which looks if an attachement has a certain caption value, if so the attachement is selected, like so                foreach ($attachments as $attachment) {                 if ($attachment->post_excerpt == 'single-gallery') {      But how can i give a attachement two or more values and select one? So if i give an attachement the caption values of               single-gallery | downloads      it will be selected for single gallery and downloads Any suggestions?


Add Post Url to Manage Edit Screen

I'm trying to add a column to the manage screen that displays the Title and url of the post. I got the Title to work but it's not pulling the url. Basically I just want to show the url that's not been cut of like what sometimes happens in the edit screen. Here's my code:               function change_columns( $cols ) {     $cols = array(     'cb'       => '<input type="checkbox" />',     'title'       => __( 'Title'),     'url'      => __( 'URL',      'trans' ),      );     return $cols;         }     add_filter( "manage_cf-link_posts_columns", "change_columns" );          function custom_columns( $column, $post_id ) {     global $post;     switch ( $column ) {     case "url":       $url = get_post_meta( $post_id, 'url', true);       echo '' . $url. '';       break;     }     }          add_action( "manage_cf-link_posts_custom_column", "custom_columns", 10, 2 );      Any help in the right direction is much appreciated. Thanks, Phil


Conditionally exclude post from specific category on home page sidebar?

I want to exclude posts from one category. These posts should not show in the sidebar on the homepage only when I explicitly don't want that particular posts to show. In all other cases these posts will be displayed. I have tried with plugin "WP Hide Post", but that seems not to work with sidebars, only for regular loops. I've checked on hide this post from homepage, and nothing happens. This is the code I use to display post in homepage sidebar:               <?php query_posts('category_name=events&showposts=3'); ?>     <?php while (have_posts()) : the_post(); ?>     <h2 id="post-<?php the_ID(); ?>">     <a href="<?php the_permalink() ?>" rel="bookmark" accesskey="s"><?php the_title(); ?>

<?php wpe_excerpt('wpe_excerptlength_index', 'wpe_excerptmore'); ?>

     <?php endwhile; ?>


How to handle support for a non-technical client

I am wondering how most WP freelancers handle general maintenance for their non-technical clients. A small to medium sized business may have someone with technical knowledge who can handle upgrades, plugin installs, etc. For a one person shop where they have no experience with WordPress, or any CMS, how do you handle maintenance? I assume that a client may think they can pay for a site and once it's completed, it's all done without understanding that software like WordPress requires security updates and periodic maintenance to ensure everything is running correctly. Basically the things beyond just general use of the system (writing posts, moderating comments). Do you:   * Build in hours for support in the initial proposal?   * Ignore it, and charge an hourly rate when issues arise?   * Teach the client how to handle maintenance tasks? I am curious to learn how other freelancers handle this with their clients.


Help with multiple dropdown tags search

I'm trying to build a search form that allows the user to choose certain post tags and filter through real estate listings. So far I have the form built but when I click the search button it brings me to the home page of the site. The url of the site then changes to the normal url with this added to the end showing what criteria is being used: /?locations=-1&property- type=46&sqft=-1&beds=-1&baths=-1&garage=-1 I'm guessing what I need is to write some sort of post action in PHP that determines what is being searched and creates a page with the search results. I'm just completely lost on how to do this. I have little database experience and know nothing about connecting to WordPress variables with PHP. I'm sure there has to be a simpler way to do this, I just haven't found it yet even after searching around for days. Please help me out here and point me to any helpful resources or whatever you can do. Here's how I built the form, adapted from http://codex.wordpress.org/Function_Reference/wp_dropdown_categories: EDIT: this code is in my searchform.php file and I'm calling it on every page of the site               <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
                          <?php //wp_dropdown_categories( 'taxonomy=post_tag' ); ?>
Search Listings
             <?php              //this one shows the locations             $args = array(                     'taxonomy'           => 'post_tag',                     'show_option_all'    => '',                     'show_option_none'   => 'Any',                     'orderby'            => 'name',                      'order'              => 'ASC',                     'show_count'         => 0,                     'hide_empty'         => 1,                      'child_of'           => 0,                     'exclude'            => '-46,-33,-6,-7,-41,-12,-13,-40,-37,-38,-39,-8,-9,-10,-11,-42,-43,-44,-45',                      'echo'               => 1,                     'selected'           => 0,                     'hierarchical'       => 0,                      'name'               => 'locations',                     'id'                 => '',                     'class'              => 'postform',                     'depth'              => 0,                     'tab_index'          => 0,                     'hide_if_empty'      => false                 );                           //property type                 $args2 = array(                     'taxonomy'           => 'post_tag',                     'show_option_all'    => '',                     'show_option_none'   => 'Any',                     'orderby'            => 'name',                      'order'              => 'ASC',                     'show_count'         => 0,                     'hide_empty'         => 1,                      'child_of'           => 0,                     'exclude'            => '-5,-28,-27,-29,-30,-34,-35,-2,-12,-13,-40,-37,-38,-39,-8,-9,-10,-11,-42,-43,-44,-45',                      'echo'               => 1,                     'selected'           => 0,                     'hierarchical'       => 0,                      'name'               => 'property-type',                     'id'                 => '',                     'class'              => 'postform',                     'depth'              => 0,                     'tab_index'          => 1,                     'hide_if_empty'      => false                 );                      //sq ft                 $args3 = array(                     'taxonomy'           => 'post_tag',                     'show_option_all'    => '',                     'show_option_none'   => 'Any',                     'orderby'            => 'name',                      'order'              => 'ASC',                     'show_count'         => 0,                     'hide_empty'         => 1,                      'child_of'           => 0,                     'exclude'            => '-46,-33,-6,-7,-41,-5,-28,-27,-29,-30,-34,-35,-2,-12,-13,-40,-37,-38,-39,-8,-9,-10,-11',                      'echo'               => 1,                     'selected'           => 0,                     'hierarchical'       => 0,                      'name'               => 'sqft',                     'id'                 => '',                     'class'              => 'postform',                     'depth'              => 0,                     'tab_index'          => 2,                     'hide_if_empty'      => false                 );                      //beds                 $args4 = array(                     'taxonomy'           => 'post_tag',                     'show_option_all'    => '',                     'show_option_none'   => 'Any',                     'orderby'            => 'name',                      'order'              => 'ASC',                     'show_count'         => 0,                     'hide_empty'         => 1,                      'child_of'           => 0,                     'exclude'            => '-46,-33,-6,-7,-41,-5,-28,-27,-29,-30,-34,-35,-2,-12,-13,-40,-37,-38,-39,-42,-43,-44,-45',                      'echo'               => 1,                     'selected'           => 0,                     'hierarchical'       => 0,                      'name'               => 'beds',                     'id'                 => '',                     'class'              => 'postform',                     'depth'              => 0,                     'tab_index'          => 3,                     'hide_if_empty'      => false                 );                       //baths                 $args5 = array(                     'taxonomy'           => 'post_tag',                     'show_option_all'    => '',                     'show_option_none'   => 'Any',                     'orderby'            => 'name',                      'order'              => 'ASC',                     'show_count'         => 0,                     'hide_empty'         => 1,                      'child_of'           => 0,                     'exclude'            => '-46,-33,-6,-7,-41,-5,-28,-27,-29,-30,-34,-35,-2,-37,-38,-39,-8,-9,-10,-11,-42,-43,-44,-45',                      'echo'               => 1,                     'selected'           => 0,                     'hierarchical'       => 0,                      'name'               => 'baths',                     'id'                 => '',                     'class'              => 'postform',                     'depth'              => 0,                     'tab_index'          => 4,                     'hide_if_empty'      => false                 );                      //garage size                 $args6 = array(                     'taxonomy'           => 'post_tag',                     'show_option_all'    => '',                     'show_option_none'   => 'Any',                     'orderby'            => 'name',                      'order'              => 'ASC',                     'show_count'         => 0,                     'hide_empty'         => 1,                      'child_of'           => 0,                     'exclude'            => '-46,-33,-6,-7,-41,-5,-28,-27,-29,-30,-34,-35,-2,-12,-13,-40,-8,-9,-10,-11,-42,-43,-44,-45',                      'echo'               => 1,                     'selected'           => 0,                     'hierarchical'       => 0,                      'name'               => 'garage',                     'id'                 => '',                     'class'              => 'postform',                     'depth'              => 0,                     'tab_index'          => 5,                     'hide_if_empty'      => false                 );                  wp_dropdown_categories($args);             wp_dropdown_categories($args2);             wp_dropdown_categories($args3);             wp_dropdown_categories($args4);             wp_dropdown_categories($args5);             wp_dropdown_categories($args6);                  ?>                  <input type="submit" id="searchsubmit" value="Search" />
         </form>      Code for search.php:               <?php     /*     Template Name: Search Results Page     */          get_header(); ?>

             <?php get_sidebar(); ?>

             <?php if ( have_posts() ) : ?>
<?php printf( __( 'Search Results for: %s', 'custom2' ), '' . get_search_query() . '' ); ?>
                                               <?php //WHAT IS THIS?--> twentyeleven_content_nav( 'nav-above' ); ?>                          <?php /* Start the Loop */ ?>                     <?php while ( have_posts() ) : the_post(); ?>                              <?php                             /* Include the Post-Format-specific template for the content.                              * If you want to overload this in a child theme then include a file                              * called content-___.php (where ___ is the Post Format name) and that will be used instead.                              */                             /* -MY CODE-                              <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) == 0) : $wp_query->next_post(); else : the_post(); ?>
                         <?php the_content(); ?>
                     <?php endif; endwhile; else:endif; ?>                          <?php $i = 0; rewind_posts(); ?>                          <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) !== 0) : $wp_query->next_post(); else : the_post(); ?>
                         <?php the_content(); ?>
                     <?php endif; endwhile; else:endif; ?>
<?php previous_posts_link('« Previous') ?>

<?php next_posts_link('More »') ?>
*/                              //DEFAULT CODE                         get_template_part( 'content', get_post_format() );                         ?>                          <?php endwhile; ?>                          <?php //WHAT IS THIS?--> twentyeleven_content_nav( 'nav-below' ); ?>                      <?php else : ?>

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

<?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'custom2' ); ?>
                             <?php get_search_form(); ?>

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


Hide custom fields when empty

I am trying to create a function to add data from two custom fields after the entry title. I get it to show correctly when these fields are filled in. The fields are a image source url and an url the image has to link to. The problem is that it's taking up space even when the custom fields are empty. My php skills are not good enough to work out how to change this. I have added a check but now the fields are not showing up at all anymore. Hope anybody can help me out with this. What I got so far is:               //Add custom field image after entry title     function headway_title_button()     {         $check = get_post_meta($post->ID, 'titel_knop');         if( !empty( $check[""] ) )         {             return printf(                 '

'                 ,get_post_meta( get_the_ID(), 'titel_knop_url', true )                 ,get_the_title()                 ,get_post_meta( get_the_ID(), 'titel_knop', true )             );           }         else         {             return printf('

');         }     }          add_action( 'headway_after_entry_title', 'headway_title_button' );


Paying to Access Custom Fields Per Post

I need a way to protect access to custom fields within my posts. I've been looking at several plugs ins, but none seem quite right. I do not need to protect the body of my post, just a set of custom fields. I need a "pay to access" button to appear if a user has not purchased the post. Also, I need access to the field purchased only on a per post basis. I.E. Post Title #1 purchase does NOT also give access to fields in Post Title #2 My access to these fields within the posts needs to be set to $x.xx for 30 days or one month. Can anyone please help? I'm about at the end of my rope.


Blank content php code not parsing advanced custom fields gallery add-on

I have blank contents where the content for the act gallery code is. I think there is an issue with the code.               <          ?php     /*     Template Name: Images scroll     */     ?>           <?php get_header(); ?>

                           <?php                                 if (is_page_template( 'index.php' ) ) {                                  if (is_page( 'home' )) {                           $jennifergallery='gallery_home';                           };                                if (is_page( 'people' )) {                           $jennifergallery='gallery_people';                           };                                if (is_page( 'stories' )) {                           $jennifergallery='gallery_stories';                           };                                     };          $images = get_field('$jennifergallery');          if( $images ): ?>               <?php foreach( $images as $image ): ?>
                     <img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" />
                          <?php endforeach; ?>                           <?php endif; ?>

                  <?php get_footer(); ?>      And this is the link to the wp test site. It is supposed to show some horizontally scrolling images. Here's the link to the static test site. Any help would be appreciated :-]


How to create a custom Wordpress front page

I want to create a custom front page for a Wordpress site, which will have an image, some text, an embedded login form, and a metaslider slider, and nothing else (no menu, no sidebar, no footer). Anyone visiting the site should be presented this page, and should be able to login with their credentials. How do I create such a custom front page? I've tried creating the page (with front-page.php) but the **login form doesn't work** , and **slider** , inserted via shortcode, **isn't displayed**. I'm using underscores theme. This is all of the front page content I want to display:
             <img src="<?php echo get_bloginfo('template_directory');?>/img/slogo.jpg" />
Short introduction comes here.
             Contact Us

             Log in:             <?php wp_login_form(); ?>

<?php echo do_shortcode("[metaslider id=1749]") ?>
      Although this code does work when I paste it in header.php, but not in this div: `<div id="content" class="site-content">`


How do I link a button I created in theme customizer to a function?

I created a button in the theme customizer and I want to use it to execute a function? All I can find is using controls to add theme settings such as CSS and text. Although this button is to clear out all of the settings. I need it to execute this code:                  <?php remove_theme_mods() ?>      I basically just need to link them together. Can anyone assist? * _EDIT:_ *Here is the custom control I created for the button I want to access the remove theme mods function:               function newtheme_customize_reset_control($wp_customize) {         /**          * Reset Control          *          */         class newtheme_Customize_reset_Control extends WP_Customize_Control {             public $type = 'button';                  public function render_content() {         ?>                                          <?php echo esc_html( $this->label ); ?>
                                         <?php _e( 'Reset Settings' ); ?>
                                  <?php             }         }      }     add_action( 'customize_register', 'newtheme_customize_reset_control', 1, 1 );      As stated previously I am hoping to reset all theme mods with this button, although there isn't much on how to do it. Here is the code I have added the button and section with:               /**      * Clear theme mod settings      *      * Clears all theme modification options/settings in current theme.      *      *      * @param WP_Customize_Manager $wp_customize Theme Customizer object.      * @return void      */          function newtheme_customize_register_clear_settings( $wp_customize ) {              $theme = wp_get_theme();              $wp_customize->add_section( 'newtheme_clear', array(             'title'      => sprintf( __( '%s Reset settings', 'newtheme' ), $theme->Name ),             'priority'   => 205,         ) );              $wp_customize->add_setting( 'newtheme_clear_settings', array(             'default'    => newtheme_theme_mod( 'clear_settings' )         ) );              $wp_customize->add_control( new newtheme_Customize_reset_Control( $wp_customize, 'newtheme_clear_settings', array(             'label'      => __( 'Reset all settings back to their defaults. Once this is done it cannot be reversed.', 'newtheme' ),             'section'    => 'newtheme_clear',             'settings'   => 'newtheme_clear_settings',             'type'       => 'button',             'priority'   => 10         ) ) );                        do_action( 'newtheme_customize_clear_settings', $wp_customize );              return $wp_customize;          }


Image width tag is less than the image pixel width - why?

I have been reading this morning about images uploaded via the Media Library in WordPress and I thought I had understood most of it. But there's something I'm confused about. My understanding is that there are a range of default image sizes - `thumbnail`, `medium`, `large` - which are generated when you upload an image. The maximum dimensions are set in your Media / Settings page in the admin panel. My "Large" sizes are set to the default 1024px wide and 1024px high. ![Image sizes](http://i.stack.imgur.com/nMx8A.png) I have an image which I uploaded that was well over this size. What I'm confused about is when I insert the image into a post and select the large image size - it gives 640px as the width of the image. ![Image Details](http://i.stack.imgur.com/ABdJI.png) The HTML image tag generated on the post is this:               <img class="alignnone wp-image-1718 size-large" src="http://www.mysiteurl.com/wp-content/uploads/2013/01/DSC_7543-1024x767.jpg" alt="DSC_7543" width="640" height="479" />      You can clearly see the image is actually 1024px by 767px from the filename - `DSC_7543-1024x767.jpg` - so why is it being scaled to 640px by 479px by the tags? Thanks very much for any help!


How to show only a certain part of the entry title?

Working on a project that I'm running into a snag about... I have a page title using the_title() ... that has a location in the title such as this: "Adventure Dental - Colorado Springs, CO" However, further down on the same page, that title needs to be used again, but this time just with the "Colorado Springs, CO" aspect of the title. Does anyone know of the best way that I can do this?


Linking wp_enqueue can't find the javascript file (adds "?ver=x.x.x" to the src)

So I'm trying to link in a javascript file the right way, by using this:               --functions.php--     function custom_scripts() {         wp_register_script('myscript','/backdrop.js',array('jquery'));         wp_enqueue_script('myscript');          console.log("test - inside custom_scripts");      }     add_action( 'wp_print_scripts', 'custom_scripts');      I don't see the console logs in the chrome console window, and I'm not sure if I should see them or not. However I see that one of my files cannot be found: `/backdrop.js?ver=3.5.1`. The directory is correct but the `?ver=3.5.1` obviously doesn't match up. Since I'm manually registering the script in a custom `functions.php`, why does it still do this?


Wordpress installer attack

I'm facing a repeated attack on my wordpress. The bots are attempting to force wordpress into installation mode, despite 503'ing requests for `install` globally and having heavily locked down security with `limited login attempts`, the `OSE firewall` and `Better WP Security` they still appear to be able to force the site into installation mode which then generates a redirect loop. Any ideas and help appreciated.


How to set order for a custom post type

I'm trying to integrate a slider custom post type into WordPress and I can't seem to set the order (orderby:ID, order:ASC) for that custom post type. I've added the `supports => array('title','page-attributes'),` to the post type, but when I change the order attribute for a slide, it doesn't change it's order (neither on the back-end or on the front-end). This is the functions.php (it also give this error: `Notice: Undefined index: post_type in .../functions.php on line 105`)               function set_custom_post_types_admin_order($wp_query) {     $post_type = $wp_query->query['post_type']; // line 105         if ( $post_type == 'bxslider') {           $wp_query->set('orderby', 'ID');           $wp_query->set('order', 'ASC');         }     }     add_filter('pre_get_posts', 'set_custom_post_types_admin_order');      And this is the bxslider.php               <?php           // Create Slider          function hostify_bxslider_template() {              // Query Arguments         $args = array(             'post_type' => 'bxslider',             'orderby' => 'ID',             'order' => 'ASC',             'posts_per_page' => -1         );                // The Query         $the_query = new WP_Query( $args );              // Check if the Query returns any posts         if ( $the_query->have_posts() ) {                  // Start the Slider ?>
                      <?php                 while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

                              <?php // Check if there's a BxSlider h2 given and if so post it                         if ( get_post_meta( get_the_id(), 'bxslide_metabox_h2', true) != '' ) { ?>
<?php echo get_post_meta( get_the_id(), 'bxslide_metabox_h2', true); ?>
                         <?php } ?>                              <?php // Check if there's a BxSlider h1 given and if so post it                         if ( get_post_meta( get_the_id(), 'bxslide_metabox_h1', true) != '' ) { ?>
<?php echo get_post_meta( get_the_id(), 'bxslide_metabox_h1', true); ?>
                         <?php } ?>                              <?php // Check if there's a BxSlider paragraph given and if so post it                         if ( get_post_meta( get_the_id(), 'bxslide_metabox_text', true) != '' ) { ?>
<?php echo get_post_meta( get_the_id(), 'bxslide_metabox_text', true); ?>
                         <?php }                              // Check if there's a BxSlider button link or button name given and if so post it                         if ( get_post_meta( get_the_id(), 'bxslide_metabox_link', true) != '' || get_post_meta( get_the_id(), 'bxslide_metabox_name', true) != '' ) { ?>                             <a href="<?php echo esc_url( get_post_meta( get_the_id(), 'bxslide_metabox_link', true) ); ?>" class="button2"><?php echo get_post_meta( get_the_id(), 'bxslide_metabox_name', true); ?>                         <?php } ?>

                 <?php endwhile; } ?>
                  <?php               // Reset Post Data         wp_reset_postdata();     }          ?>      P.S. The slider works just fine, I just can't change the order of the slides.


Disable widgets on specific posts

I run a horror related blog. Google is upset with me for displaying adsense in a sidebar widget for one specific post number (4603) that contains an article about an 18+ topic. How can I disable the widgets for a specific id?


Add image custom attribute

Im want to use Advance Custom Fields module with Gallery add-on http://www.advancedcustomfields.com/add-ons/gallery-field/ I need to add custom attributes to all images. Like for example paper type, dimensions and so on. All attributes from WordPress core are shown very good. (alt, description, caption) at video from 0:50min (above link) How can i add to this section other attributes? Any help will be appreciated


Images Not Linking To Attachment Page After WordPress Import

I am importing an old WordPress site into a new theme on a new URL. All of the images in the old site link to an attachment page for each particular image. The attachment page doesn't get created upon import, so no attachment pages exist (I have done a search and replace to change the core part of the url). The result is being directed to a 404 page every time an image is clicked. I am wondering how to create the attachment page, or just link directly to the image URL. I want to find a plugin or some way to batch do this though, so I don't have to manually change each image. I have a lot of images for old posts I would have to do that for.