title: LESS CSS enqueue_style with add_filter to change rel attribute

text: What I'm trying to do is use less css with Wordpress. You're supposed to link to your .less files with the rel attribute set to 'stylesheet/less'. But I can't figure out how to alter the code that enqueue_style outputs. Is there a way to apply a filter and affect the output? EDIT: If anyone is curious as to how I ended up getting this to work, here is the code snippet:               function enqueue_less_styles($tag, $handle) {         global $wp_styles;         $match_pattern = '/\.less$/U';         if ( preg_match( $match_pattern, $wp_styles->registered[$handle]->src ) ) {             $handle = $wp_styles->registered[$handle]->handle;             $media = $wp_styles->registered[$handle]->args;             $href = $wp_styles->registered[$handle]->src . '?ver=' . $wp_styles->registered[$handle]->ver;             $rel = isset($wp_styles->registered[$handle]->extra['alt']) && $wp_styles->registered[$handle]->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';             $title = isset($wp_styles->registered[$handle]->extra['title']) ? "title='" . esc_attr( $wp_styles->registered[$handle]->extra['title'] ) . "'" : '';                  $tag = "<link rel='stylesheet' id='$handle' $title href='$href' type='text/less' media='$media' />";         }         return $tag;     }     add_filter( 'style_loader_tag', 'enqueue_less_styles', 5, 2);


title: Too few arguments for printf()

text: I'm having a problem making this printf print the time & date correctly within my theme. I keep getting "Too few arguments."               <abbr class="published" title="<?php the_time('Y-m-d') ?>"><?php unset($previousday); printf( __( '%1$s – %2$s', 'erudite' ), the_date( '', '', '', true ) ) ?>      I have two strings in the printf(). %1$s and %2$s are meant to correspond to the_time and $previousday. Is:               <?php the_time('Y-m-d')?>      not serving here as a printable string? Or did I not form this correctly? Am I missing something obvious/subtle? It's been many years since I coded in PHP, and I'm rusty. TIA.


title: wp_enqueue_script adding conditional statement not working

text: This is the code im using in my functions file:               add_action('init', 'sort_out_jquery_pngfix_frontend');     function sort_out_jquery_pngfix_frontend() {         global $wp_scripts;         if(!is_admin()) {             wp_deregister_script('jquery');             wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', array(), NULL, true);             wp_register_script('dd_belatedpng', get_stylesheet_directory_uri() . '/js/dd_belatedpng.js', array(), NULL, true);             $wp_scripts->add_data('dd_belatedpng', 'conditional', 'lt IE 7');         }     }          add_action('wp_print_scripts', 'register_theme_scripts');     function register_theme_scripts() {         if(!is_admin()) {             wp_enqueue_script('modernizr', get_stylesheet_directory_uri() . '/js/modernizr-1.7.min.js', array(), NULL, false);             wp_enqueue_script('googlemaps', 'http://maps.google.com/maps/api/js?sensor=false', array(), NULL, true);             wp_enqueue_script('jquery');             wp_enqueue_script('dd_belatedpng');             wp_enqueue_script('sc_wc_js', get_stylesheet_directory_uri() . '/js/function.js', array('jquery', 'dd_belatedpng'), '1.0', true);         }     }      I'm using `$wp_scripts->add_data('dd_belatedpng', 'conditional', 'lt IE 7');` to add a conditional statement to this script as per the documentation I can find on-line but its not working. The conditional code is not shown but the js file is. Why is this not working?


title: Best way to arrange custom post types by Attributes -> Order metabox value?

text: I have my front page setup to display a custom post type via:               add_filter( 'pre_get_posts', 'my_get_posts' );          function my_get_posts( $query ) {              if ( is_home() && false == $query->query_vars['suppress_filters'] )         $query->set( 'post_type', array( 'jwf_portfolio', 'attachment' ) );                     $query->set( 'order', 'menu_order' );              return $query; }      What's the most efficient way to have these ordered by the number value in the Order input in the Attributes metabox for each custom post? Currently I'm trying               <?php query_posts( $query_string . '&orderby=menu_order' ); ?>     <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>      on my `index.php` and that's not cutting it.


title: Custom post types images go to a specific folder, not the montly one

text: I have a website which allows "mini sites", meaning custom post types. We noticed that the images that are published along the mini-sites reviews go automatically to the same month, while regular posts attachments keep going to the regular year/month folders. Since most hosts have a 2000 files limitation per folder, we lost 8000 files when migrating. Now we can publish and upload through the wordpress library, but files do not appear anymore in the FTP folders. How can you make a custom post type have the same rules for images than the regular posts/Pages?


title: Get list of terms of current taxonomy archive for another taxonomy

text: I have a Custom Post Type named 'Real estate' which has (amongst others) two different taxonomies:   * 'Purpose' (hierarchical; terms used are 'Living', 'Working' and 'Holidays') and    * 'Location' (non-hierarchical; e.g. 'London', 'Berlin', 'Paris').  For a search form on the 'Living' taxonomy archive I would need a list of all 'Location' terms associated with posts in the 'Living' taxnonomy term archive in order to give it back in the search form through a select. How can I, best as a list of comma separated values for an array, get all the terms for 'Location' used in the 'Living' term archive?


title: Accept a-z and 0-9 (restrict a-z to be lowercase without accents like ñ or ó)

text: Using JQuery: While the user types, Im trying to find a way to restrict a field to only accept a-z and 0-9, restricting a-z be lowercase without accents like ñ or ó.               <input type="text" value="" id="signup_username" name="signup_username">      Thanks in advance.


title: How to echo tag description on loop-page.php using WPeC 3.8

text:
I'm trying to display the 'Tag Description' on my tagged pages. I've added an if statement to loop-page.php already to only show custom text when a tagged page is being displayed...               <?php } elseif ( is_tax ( 'product_tag' ) ){ ?>
<?php the_title(); ?> print out this text on page
      ... but I don't know the code to output the tag description. Does anyone know the code to display the tag description? I want it to go after the H1 in the above code. I'm trying to output the description that is entered when you go into Wordpress Admin>Products>Product Tags>Description using WPeC 3.8. I'm using the Twenty10 theme, WPec 3.8 and WP 3.1 Thanks for your help ChainsawDR


title: How to rename 'Tag Base' with WPeC 3.8?

text: In Wordpress>Settings>Permalinks there is an option at the bottom of the page to change the 'Tag Base'. I've entered 'testtag' in this option and saved, but my tag pages are still displaying as 'tagged' (eg www.example.com/tagged/tagcategory). wpsc-functions.php in the wp-ecommerce>wpsc-core folder... on line 319 'tagged' can be renamed which will change the URL's generated by things like the tag cloud, which in part solves the problem - but when you click on and request those new URL's it generates a 404 error. Does anyone have any ideas please on how I can rename this. I'm using WP 3.1 and Wordpress E-commerce Plugin 3.8. I've got a test site on www.chainsawdr.com. An example of a tag URL can be found by clicking a link in the tag cloud. Any tips or advice would be greatly appreciated. Thanks for reading ChainsawDR.com


title: How can I run shortcode after click with ajax

text: 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 :(


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

text: 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?


title: Theme my login and update user meta

text: 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']);                 ?>


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

text: 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.)


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

text: 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.


title: Shotcode error on functions

text: 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;     }


title: How we redirect to other pages in WordPress?

text: 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


title: How to relate the Category to user?

text: 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.


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

text: 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;     }         }


title: Wrong date returned by get_the_time

text: 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.


title: Want to add more option in "Sexy Login"

text: 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.


title: Plugin update, is a deactivation and activation done?

text: 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?


title: Using Custom Posts with Metaboxes and Drop-downs

text: 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?


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

text: 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?


title: sub posts to parent post

text: 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


title: locate_template with multiple categories?

text: 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


title: custom change in front page

text: 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


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

text: 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?


title: Post image in WordPress not appearing on home page

text: 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


title: Switching Code plugins

text: 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])?


title: Ability to leave comments broken

text: 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.


title: Best Apache Log Analyzer Plugin?

text: 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.


title: Login in Wordpress using external database data

text: 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?


title: How do I get image url only on the_post_thumbnail

text: 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


title: How to call the_time current?

text: 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?


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

text: 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?


title: How to submit readme.txt file in wordpress directory

text: 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 ?


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

text: 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!


title: How to add more fields to bbPress registration form

text: 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.


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

text: 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!


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

text: 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 ?


title: Exclude current post but keep the same posts-per_page amount

text: 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?


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

text: 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.


title: Pass data between pages

text: 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?


title: Wordpress Rotating Background Images

text: 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.


title: How to make only posts show date

text:
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(); ?


title: Identify current wordpress theme

text: 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/


title: Best practice for versioning wp-config.php?

text: 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?


title: show other images from same gallery

text: 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.


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

text: 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")


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

text:
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.


title: How to only publish posts with image in it

text: 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.


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

text: **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....


title: Getting the top level permalink using get_post_ancestors()

text: 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.


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

text: 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.


title: Copy price categories to custom field

text: 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);         }     }          ?>


title: Display latest post of taxonomy

text: 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


title: How do I combine my shortcodes?

text:
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


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

text: 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!!


title: Is there some jQuery conflict here?

text: 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


title: Editor background colour in full screen

text: 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.


title: Settings options not showing up in WordPress plugin

text: 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)


title: dynamically update permalink and title with the values of custom fileds

text: 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?


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

text: 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.


title: 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?

text: 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!


title: How to change the order of elements in comment_form()

text:
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?


title: How to benchmark a WordPress installation?

text: 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).


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

text: 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.


title: Why is WP_Query's meta_query not filtering results?

text:
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"


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

text: 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.


title: The excerpt: Display text OR image OR video

text: 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');     ?>


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

text: 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?


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

text: 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?


title: Display posts in three columns by category

text: 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!!


title: Is there a theme function for is_password_protected()?

text: 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.


title: Creating a Search Array From Multiple Tables

text: 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


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

text: 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)


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

text: 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?


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

text: 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!


title: Manually delete post from database

text: 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;


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

text: 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.)


title: help to decipher wp metadata

text: 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


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

text: 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?


title: Add Post Url to Manage Edit Screen

text: 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


title: Conditionally exclude post from specific category on home page sidebar?

text:
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; ?>


title: How to handle support for a non-technical client

text: 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.


title: Help with multiple dropdown tags search

text:
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(); ?>


title: Hide custom fields when empty

text:
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' );


title: Paying to Access Custom Fields Per Post

text: 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.


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

text:
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 :-]


title: How to create a custom Wordpress front page

text:
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">`