title: Custom Background Image per Page

text: Is it possible to send an image url via custom fields to the get_background_image function?


title: WPMU If MU site has no administrator, deactivate site

text: So I been tinkering with this thought. Working w/ WooCommerce Subscriptions - if the user is a recurring paid member, they can create and manage their own subsite. However, say the recurring payments are over, than there user role from 'Administrator' will automatically be changed into 'Subscriber'. Since there will only be one Administrator per subsite, and that person's role changes into a Subscriber, is there a way I can link: if Subscriber, deactivate their site(s). else if Adminstrator, activate their site(s). I would love to get some feedback on this! Thanks! Roc.


title: gform_after_submission add list of form titles after the post content

text: Can you help me with the code where all I only want is to add the list of all submitters who submitted GF form on every post page right after the post content? Every post has its small CPT form on the bottom of the page and submitted forms goes to the custom post type portfolio page. I want to also display the list of clickable titles (the name of submitters with some fields already merged together by GF form) of the form with URL of that created page. image 1 before submition: ![enter image description here](http://i.stack.imgur.com/xnGRb.png) The post after 5 succesfull submitions, it should also be after the post content /div image 2 after: ![enter image description here](http://i.stack.imgur.com/VISF5.png) The code I would like to use is here:               <?php         add_action("gform_after_submission_7", "set_post_content", 10, 2);         function set_post_content($entry, $form){                  //getting post             $post = get_post($entry["post_id"]);                  //adding after the post content - how can I get something like this ?:                 ul               li                    a submitted portfolio URL                         div class"some class"                         submitted form title                        /div                      /a                    /li                  /ul                        //updating post             wp_update_post($post);         }         ?>


title: Display author box on just certain category posts?

text:
I'm using this code to display a author box after my blog posts. The issue that I'm having is that it is showing up on all custom post types as well which I don't want. What I need is for it to show up on posts that are in the category of 'blog'. Anyone have any suggestions on what I need to do to accomplish this? Thanks in advance!               // creates the author bio after posts     function get_author_bio ($content=''){     global $post;          $post_author_name=get_the_author_meta("display_name");     $post_author_description=get_the_author_meta("description");           $html="
\n";     $html.="\n";     $html.="
\n";     $html.="
Author: ".$post_author_name."
\n";     $html.= $post_author_description."\n";     $html.="
\n";     $html.="

\n";     $content .= $html;          return $content;     }          add_filter('the_content', 'get_author_bio');


title: How to show metabox key to custom post?

text: is it possible to show all custom metabox key name and show it as dropdown list on my custom post with my custom metabox dropwdown list ? > this is custom metabox from another plugin/theme and how to get all metakey > from all input form ![test](http://i.stack.imgur.com/25Uo5.jpg) > and show all of them to my custom fields name, my custom fields is come from > my plugin that have custom post type function. ![enter image description here](http://i.stack.imgur.com/koXzm.jpg)


title: Trying to achieve row posts below category with multiple loops in custom tax

text:
hoping someone here can help a noob. Ideally I'd like to get a featured post from a category 'Featured Club' to display above three posts from the same custom post type. I've got the following working but for one I'm using two loops where I'm sure one would work, and two, the results under the full width featured post, display in a column and I need them in a row. Additionally, I have another custom post type that I'd like to display on the same page under this block, with another 'Featured Category', and the way I'm going, I'll end up with four loops. Look forward to getting some help. Here's the code:
Jazz Clubs
                 <?php                     $args = array (                         'post_type'  => 'jazz clubs',                         'meta_query'             => array(                         array(                         'key'       => '_jazz_club_feature_club',                             ),                         ),                     );                     // The Query                     $jazzclubs = new WP_Query( $args );                     // The Loop                     if ( $jazzclubs->have_posts() ) {                         while ( $jazzclubs->have_posts() ) {                             $jazzclubs->the_post();                 ?>
<?php the_title() ?>
                     <?php the_post_thumbnail() ?>
<?php the_excerpt() ?>
                  <?php                         }                     } else {                         // no posts found                     }                            wp_reset_postdata();                 ?>

             <?php                        // WP_Query arguments                 $args = array (                     'post_type'  => 'jazz clubs',                     'orderby'    => 'date',                 );                 // The Query                     $jazzclubs = new WP_Query( $args );                     // The Loop                     if ( $jazzclubs->have_posts() ) {                         while ( $jazzclubs->have_posts() ) {                             $jazzclubs->the_post();             ?>

                     <?php the_post_thumbnail() ?>
<?php $terms = get_the_terms( $post->ID , 'city' );                                                             if ( $terms != null ){                                                             foreach( $terms as $term ) {                                                             print $term->name ;                                                             unset($term);                                                             } }                                                          ?>

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

<?php the_date('F j Y'); ?>

<?php the_excerpt() ?>

                      <?php                         }                     } else {                         // no posts found                     }                     // Restore original Post Data                     wp_reset_postdata();                 ?>


title: Code needed to only show users own posts in a multi-user account

text: I am using WP3 and want to starting adding users (many users to a single blog) but when I give a new user an account, they can see all the posts in the admin including scheduled, drafts, pending review etc. I either need the users to ONLY view their own posts or only view their own published posts (but not scheduled, drafts, etc). The admin should be able to see everything. Here is a link I found on this issue with a code but the code is not working in my functions.php http://wordpress.org/support/topic/show-only-authors-posts-in-admin-panel- instead-of-all-posts


title: How to get the wpnonce value?

text: On using inspect element to check the 'href' attribute of 'Deactivate' links for the plugins listed on plugins.php page, I found that the url contains a wpnonce field with a certain value. I need to get this value. For eg,               Deactivate      How do I get this value '08a2b0d940' as in the above link ?


title: How to make a function occurs for one time?

text: I have the following code in the functions.php file in my theme                 function my_func(){         echo "foo";       }                add_action('admin_menu','my_func');      I assume this function "my_func" will be called once in the admin_menu action; however I have found that the function is being called many times -it will print the word "foo" in the top of every widget of the dashboard-!! for me this is a strange behavior!,how can I make the function runs for one time? I want it to run when creating the admin menu? Best Regards Thanks


title: Wordpress Hook for user account activation in normal Wp (not MU)

text: what is the action hook, if a user activates his profile? For the profile update, it is:               profile_update      for example. My goal is, to execute a function, if a user activates his profile. Something like this:               add_action( 'user_activate','my_function');


title: Trouble getting the Blog page to show up correctly

text:
I'm having a completely new problem and can't figure it out so I'm hoping someone can help me. The website is http://www.talkingdogtemplates.com. It's a big site that uses WordPress as a CMS primarily, and I have the blog page set to http://www.talkingdogtemplates.com/blog.html. I'm using the .html on PAGES plugin to get the extension and I've never had this problem in the past with over 50 WordPress CMS/blogs. (not even sure that's the cause, probably not) So the problem is that the post DOES show up on the blog page but the link in the header does not link and none of the author and date info shows up. It's like each time I edit the index.php document and reload it it's just being ignored. So weird. Here's the main piece of the index.php doc:
              <?php if (have_posts()) : ?>                  <?php while (have_posts()) : the_post(); ?>                      <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', ''), the_title_attribute('echo=0')); ?>"><?php the_title(); ?>
                     <?php the_time(__('F jS, Y', '')) ?> by <?php the_author() ?>
                         <?php the_content(__('Read the rest of this entry »', '')); ?>

<?php the_tags(__('Tags:', '') . ' ', ', ', '
'); ?> <?php printf(__('Posted in %s', ''), get_the_category_list(', ')); ?> | <?php edit_post_link(__('Edit', ''), '', ' | '); ?>  <?php comments_popup_link(__('No Comments »', ''), __('1 Comment »', ''), __('% Comments »', ''), '', __('Comments Closed', '') ); ?>

                  <?php endwhile; ?>      I'm really hoping someone can help me. I've tried everything I can think of so I'm hoping a fresh set of eyes can solve this easily. Let me know if you need any more info. Thanks so much in advance!


title: Unclickable Menu Item Label in Custom Menu with Clickable Children

text: I need some help with a custom menu. I'm using WP 3.1.1. I need to create an unclickable placeholder in the nav menu. So, the children will be clickable, but the "title" in the nav bar is not. For example, let's say I have a Shovel Page, Trowel Page, and a Spade Page and I want them all to be accessible under the Tools section in the Custom Menu. In the menu, "Tools" isn't clickable, only the children are. I tried the solution outlined here: non-clickable placeholder in the menul . But, if I click the placeholder I get an Alert. Also, his opened Custom Link box looks different than mine. I only have options for URL, Navigation Label, and Title Attribute. I don't know if that has anything to do with why it doesn't work. Any suggestions? Thank you. -Laxmidi


title: Custom Post order for homepage

text: I would like to display a dropdown on the homepage which contains [most popular, most recent, trending] and when a user selects on of them the posts are page reloads and the posts are sorted in that order. Right now I am using query string to detect the sort order. For eg: `http://example.com/?sort=popular` or `http://example.com/?sort=trending`. Then in the `home.php` I check query string and edit the `wp_query` object's `orderby` clause. I want to ask if this is a correct approach or is there a better way to handle this case? Because I also want to handle pagination and other stuff. In home.php               /**      * check query for most popular.      */     function check_for_popular() {         return get_query_var('sort') == "popular";     }     function mp_home_loop() {     global $wp_query;         if( check_for_popular() ) {             $query = $wp_query->query_vars;             $wp_query = new WP_Query( wp_parse_args( array(                 'meta_key' => 'popularity_score',                 'orderby'  => 'meta_value_num',                 'order'    => 'DESC',                 ), $query ) );         }         include( CHILD_DIR . '/mp_home_loop.php' );     }       In functions.php               add_filter('query_vars', 'add_query_vars' );     function add_query_vars( $qvars ) {        $qvars[] = 'sort';        return $qvars;     }


title: How to Test a Blog Post for Update vs. Publish Status -- Unique

text:
I want to perform an action when a blog post gets published for the first time only. I do not want to take action on any subsequent update. I wrote a plug-in to do this. However, it runs the function each time the post is updated, regardless of publish or update status. Here's is a snippet of my plugin:               function emailSubscribers( $new_status, $old_status, $post ) { // 2014-04-21 http://wordpress.stackexchange.com/questions/69772/execute-function-when-post-is-published            //error_reporting(E_ALL); ini_set('display_errors', 'On'); // don't use this -- it messes up page            //$post = get_post($post_ID);       //echo '
'; print_r($post); echo '
'; exit; // for testing purposes       //echo '
'; echo 'Published: ' . $post->post_date . '
' . 'Updated: ' . $post->post_modified; echo '
'; exit; // for testing purposes       $thisCategory = get_the_category($post/*->ID*/);       $blogTitle = get_the_title($post/*->ID*/); // must be done this way so the html entities get decoded properly            if ( 'publish' !== $new_status or 'publish' === $old_status ) return; // 2014-04-21 http://wordpress.stackexchange.com/questions/69772/execute-function-when-post-is-published       if ( 'post' !== $post->post_type ) return; // restrict the filter to a specific post type // 2014-04-21 http://wordpress.stackexchange.com/questions/69772/execute-function-when-post-is-published                /* the rest of my code which actually gets processed regardless of post status */              } // end emailSubscribers()         add_action( 'transition_post_status', 'emailSubscribers', 10, 3 );      Other answer(s) elsewhere in Stackoverflow do not solve this specific problem.


title: Include both default and Custom Post Type in query modified inside pre_get_posts

text: I want to include custom post type in the author arhive page. I tried the method discussed in this post: > Including post_type = 'wiki' in author archives               add_action( 'pre_get_posts', 'custom_post_author_archive' );     function custom_post_author_archive( &$query )     {         if ( $query->is_author )         {             $query->set( 'post_type', 'custom_name' );             remove_action( 'pre_get_posts', 'custom_post_author_archive' ); // run once!         }     }      But by this method, only the custom_name posts are queried. I want to query both the custom_name posts and the normal posts. What changes will I have to make?


title: Redirect users to a front end wp login page

text: My theme allows me to create a front-end login form in a normal blog page. Now, I wish to redirect all the users to that page and not to **wp- login.php**. I have used the below code snippet.               function redirect_login_page(){        $page_viewed = basename($_SERVER['REQUEST_URI']);        // Where we want them to go        $login_page  = 'http://localhost.com/login/';        if( $page_viewed == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {          wp_redirect($login_page);          exit();        }     }     add_action('init','redirect_login_page');      But the problem is, it only redirects **wp-login.php** page. What if we place **wp-admin** , (e.g. http://localhost.com/wp-admin/) it does not redirect. Instead it takes to that **wp-login.php** page (which I do not want) Any suggestions?


title: Save something to global var in add_filter

text: I am here again with a strange question. First, I'm using ACF plugin for adding cistom fields. My code looks somethink like that:               global $testMe;     $testMe = 0;     function my_acf_update_value( $value, $post_id, $field ) {         global $testMe;         $testMe = $value;         return $value;     }     add_filter('acf/update_value/key=field_5308e5e79784b', 'my_acf_update_value', 10, 3);     echo $testMe; // -> print 0, not the $value!?      The problem is that I want, after the filter apply, $testMe to contain the value of $value. Any ideas where I'm wrong?


title: Enforcing password complexity

text: We need to enforce password complexity in a wordpress site, we used this article: http://www.webtipblog.com/force-password-complexity-requirements-wordpress/ We created the following in functions.php:               add_action('user_profile_update_errors', 'validateProfileUpdate', 10, 3 );     add_filter('registration_errors', 'validateRegistration', 10, 3 );     add_action('validate_password_reset', 'validatePasswordReset', 10, 2 );          function validateProfileUpdate( WP_Error &$errors, $update, &$user ) {         return validateComplexPassword( $errors );     }          function validateRegistration( WP_Error &$errors, $sanitized_user_login, $user_email ) {         return validateComplexPassword( $errors );     }          function validatePasswordReset( WP_Error &$errors, $userData ) {         return validateComplexPassword( $errors );     }          function validateComplexPassword( $errors ) {              $password = ( isset( $_POST[ 'pass1' ] ) && trim( $_POST[ 'pass1' ] ) ) ? $_POST[ 'pass1' ] : null;              if ( empty( $password ) || ( $errors->get_error_data( 'pass' ) ) )             return $errors;              $passwordValidation = validatePassword($password);              if ( $passwordValidation !== true ) {             $errors->add( "pass", "ERROR: " . $passwordValidation . "." );         }              return $errors;     }          function validatePassword($Password) {         //#### Check it's greater than 6 Characters         if (strlen($Password) < 6) {             return "Password is too short (" . strlen($Password) . "), please use 6 characters or more.";         }              //#### Test password has uppercase and lowercase letters         if (preg_match("/^(?=.*[a-z])(?=.*[A-Z]).+$/", $Password) !== 1) {             return "Password does not contain a mix of uppercase & lowercase characters.";         }              //#### Test password has mix of letters and numbers         if (preg_match("/^((?=.*[a-z])|(?=.*[A-Z]))(?=.*\d).+$/", $Password) !== 1) {             return "Password does not contain a mix of letters and numbers.";         }              //#### Password looks good         return true;     }      As you can see, we've made use of the `validate_password_reset` hook & used it to call our bespoke `validatePassword()` function that tests the password with a couple of simple regular expressions. However, this code just doesn't seem to be called at all when a user resets their password via `wp-login.php` - we know this because its still allowing us to enter the password "woof" (which is clearly invalid) and to double check we put some code in the `validateComplexPassword()` function to send us an email, again, no email was fired. Is there something wrong with our code? is the `validate_password_reset` action no longer called? Help :) **Edit:** we have noticed the following in the php error log - could this be the problem?               [12-Jun-2014 14:38:12 UTC] PHP Warning:  Parameter 1 to mycohens_validatePasswordReset() expected to be a reference, value given in C:\inetpub\wwwroot\www.cohenschemist.co.uk\wp-includes\plugin.php on line 470      **Edit 2:** Attempting to change our password via wp-admin/profile.php is working perfectly, the errors from our custom code are being returned by wordpress, its just the forgotten password reset that does not seem to be working.


title: pdf (25MB) - how to display and enable download?

text: I have tried to upload it simply through the media library ,but it didnt display correctly (very low resolution) and some users couldnt even see it (just an empty space) ,so I used an iframe tag in a page and uploaded the pdf directly to the server.               <iframe frameborder="1" height="200" name="frame1" scrolling="yes" src="/wp-content/themes/abc/images/catalog.pdf" width="550"></iframe>      now it displays correctly but takes a lot of time to load the pdf to the page. now for to users to dowmload the pdf I put a text "right-click for print or save as". I wish I could switch it with some kind of a button --download--. perhaps I shouldnt upoload the pdf as is (25MB) and just upload images of the catalog.pdf pages ?,it will sure weigh less.but what will I do with the download,it will really slow down the website if all the users will download 25MB file. I dont know if it is the right way to display and enable download for large pdf files,and try to minimize the use of plugins. what is the best way to do it ? thank you


title: Can't drag and expand meta boxes when adding post

text: When I try to add a post, I can't expand and drag meta boxes, however, when I try to edit posts, I can. I already have re-uploaded the original files of post-new.php and post.php Why is this happening?


title: How can I control what / how much text is in my RSS feeds?

text: Currently, my RSS feeds show the entire text from main text field. I only want to show parts of my text, preferrably my intro text, so that users have to visit my page to read the rest. I've customized my WP to act more as an CMS. Among the things I've done, is to remove the Excerpt field with `remove_meta_box('postexcerpt', 'post', 'normal')`. Then I've added my own meta boxes for intro text (excerpt) and short intro text. Because of this, my intro text is not shown and I'm not using `the_excerpt_rss()`. This is the code I use to show my intro text:               function the_intro($attr = null) {       $intro = get_intro($attr);       echo $intro;     }      Where the function `get_intro($attr);` is a bigger function to actually retrieve and return intro text. Looking at `wp-include/feed.php`, I see they use this:               echo apply_filters('bloginfo_rss', get_bloginfo_rss($show), $show);      Should I add this filter to my custom functions? I have not tested yet, just in case I break something :)


title: Checking for two categories in query_posts

text:
How can I check two category_name values in the following query_post?                <?php query_posts('category_name=recent-work&posts_per_page=1');        if (have_posts()) : while (have_posts()) : the_post(); ?>      So that it reads something like this:                <?php query_posts('category_name=recent-work&&category_name=plumbing&posts_per_page=1');        if (have_posts()) : while (have_posts()) : the_post(); ?>      Many thanks. **EDIT:**               <?php             $querySimilarWork = new WP_Query( array(                 'tax_query' => array(                     array(                         'taxonomy' => 'categories',                         'field' => 'slug',                         'terms' => array( 'recent-work', 'plumbing' )                     )                 ),                 'posts_per_page' => 4             );         ?>      **EDIT:** If I now query this WP_query, it doesn't return anything?               <?php while ($querySimilarWork->have_posts()) : $querySimilarWork->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>
      <?php endwhile; ?>


title: Passing error/warning messages from a meta box to "admin_notices"

text: I have a simple meta box that updates the post custom fields (using `update_post_meta()`). How can I send a error or warning message to the next page after the user publishes/updates the post and doesn't fill one of the meta box fields (or fills them with invalid data) ?


title: Black and White thumbnails

text: There are ways to convert color image to `black and white` on the client side with javascript. However, it won't work in all browsers and it's slow. Is there a way to convert Wordpress post-thumbnails to `black and white` on the `server side` automatically? This is what I would like to achieve:   1. Upload a color image   2. Have it displayed in black and white   3. On hover change to its original color


title: Contents are missing but shown when switching to another theme in wordpress

text: I was surprised this morning to hear that the contents on my WP site are erased, said my client. I tried disable all plugins one by one, but the problem still exists. I also changed the memory limit via the wp-config and that could not solve the problem either. Then I switched to another theme, twenty-eleven and twenty-twelve, they all show those missing contents. This is my first time building a WP site, and I've no idea why it occurs. http://www.dcaredental.com/news-event/tv-interviews/ Any help would be very much appreciated.


title: Custom Nav Menu items default to 'menu-item-type' => 'custom'. How to make a "page" menu item?

text: I'm using the code below to create custom menu items on the fly. Its working great, except all menus are created as "Custom". In the code below, setting the menu-item-type to 'page' appears to have no effect.                       foreach($thePages as $page){                 wp_update_nav_menu_item($menu->term_id, 0, array(                     'menu-item-title' => $page->post_title,                     'menu-item-type' => 'page',                      'menu-item-status' => 'publish')                 );                       }      wp-includes/nav-menu.php shows that the value is hard coded to "Custom". However, if I manually add a page to the menu, using the WP Menus manager, it lists it as "Page", not "Custom". What can I do to set the menu type to "Page"?


title: Confirmation box when submitting post for review

text: A very common issue that I experience with new authors is that they forget to complete a few essential tasks prior to submitting their post for review (even though I have a guide available for them). Is it possible to add a confirmation box that appear only when a contributor clicks on the "Submit for Review" button? Potentially a jQuery box like this: ![enter image description here](http://i.stack.imgur.com/JcjV0.png) I have come across a few confirm publish codes on the web and plugin archives but all of which trigger on _Publish_ (not _Submit for Review_ ) and prompts a Javascript alert window.


title: Check when the post type changes, and display content

text: The following code was provided in another question but doesn't seem to be working. Basically I have 4 post types (deals, accommodation, articles, attractions) and I would like to show a list of post types relating to a common taxonomy (destination) and use a header to seperate each taxonomy. Destination: London   London Attractions   xx   xx   xx      London Articles   xx   xx   xx      London Deals   xx   xx   xx Etc Any ideas on this? I have added this to taxonomy-destination.php but it seems to just hang.               <?php     $post_type = '';     while (has_posts()): the_post;          if (get_post_type() !== $post_type) {         // print the header for the post type         // maybe something like this...         echo '<h2>', esc_html(get_post_type_object(get_post_type())->label)), '</h2>';     }          // do stuff with the current post          $post_type = get_post_type();          endwhile;


title: Navigation list not correctly styled on pages with custom template (missing .current-menu-item)

text: My Wordpress site uses a custom front page (`home.php`). The blog page uses a template (`blog.php`). However when I visit the blog page the navigation bar does not highligt the current page. This is because the class `.current-menu-item` (and the class `.current_page_item`) are missing from the navigation `li`. This class is correctly included when I visit all other pages that use the default page template. Here is the template for the blog page:               <?php     /*     Template Name: Blog     */          // Which page of the blog are we on?     $paged = get_query_var('paged');     query_posts('cat=-0&paged='.$paged);          // make posts print only the first part with a link to rest of the post.     global $more;     $more = 0;          //load index to show blog     load_template(TEMPLATEPATH . '/index.php');          ?>      I've noticed that if I remove the call to `query_posts` then the nav bar styling works correctly, but the page is left blank. Any ideas?


title: Ajax contact form

text:
I have a custom contact form that I am trying to process via Ajax. I am a bit newbie in Ajax and more using it on WordPress. I have built it but it doesn`t send the email and retrieve "0". Php function:               add_action('wp_ajax_ajaxContacForm', 'ajaxContacForm');     add_action('wp_ajax_nopriv_ajaxContacForm', 'ajaxContacForm');          //Ajax contact form filter function     function ajaxContacForm() {              if(!$_POST) exit;              global $t_one_opt;              $name     = $_POST['name'];         $email    = $_POST['email'];         $phone   = $_POST['phone'];         $comments = $_POST['comments'];                   if(trim($name) == '') {             echo '
Please enter your name.
';             exit();         } else if(trim($email) == '') {             echo '
Please enter a valid email address.
';             exit();         } else if(trim($phone) == '') {             echo '
Please enter a valid phone number.
';             exit();         } else if(!is_numeric($phone)) {             echo '
Phone number can only contain digits.
';             exit();         } else if(!isEmail($email)) {             echo '
You have enter an invalid e-mail address,please try again.
';             exit();         }              if(trim($comments) == '') {             echo '
Please enter your message.
';             exit();         }               if(get_magic_quotes_gpc()) {             $comments = stripslashes($comments);         }                   // Configuration option.         // Enter the email address that you want to emails to be sent to.         // Example $address = "joe.doe@yourdomain.com";              //$address = "example@themeforest.net";         //global $t_one_opt;         $address = $t_one_opt['contact_email'];                   // Configuration option.         // i.e. The standard subject will appear as, "You've been contacted by John Doe."              // Example, $e_subject = '$name . ' has contacted you via Your Website.';              $e_subject = 'You\'ve been contacted by ' . $name . '.';                   // Configuration option.         // You can change this if you feel that you need to.         // Developers, you may wish to add more fields to the form, in which case you must be sure to add them here.              $e_body = "You have been contacted by $name with regards to $subject, their additional message is as follows." . PHP_EOL . PHP_EOL;         $e_content = "\"$comments\"" . PHP_EOL . PHP_EOL;         $e_reply = "You can contact $name via email, $email or via phone $phone";              $msg = wordwrap( $e_body . $e_content . $e_reply, 70 );              $headers = "From: $email" . PHP_EOL;         $headers .= "Reply-To: $email" . PHP_EOL;         $headers .= "MIME-Version: 1.0" . PHP_EOL;         $headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL;         $headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL;              if(mail($address, $e_subject, $msg, $headers)) {                  // Email has sent successfully, echo a success page.                  echo "<fieldset>";             echo "
";             echo "
Wohoooo ! Well done
";             echo "
Thank you $name, your message has been submitted to us.
";             echo "
";             echo "</fieldset>";              } else {                  echo 'ERROR!';         }          }      jQuery function:               jQuery(document).ready(function ($) {         // Send email          jQuery('#contactform').submit(function () {                       $("#message").slideUp(750, function () {                 $('#message').hide();                      $('#submit')                     .after('')                     .attr('disabled', 'disabled');                      jQuery.ajax({                 type:"POST",                 url: "http://www.codetocode-developments.com/t-one/wp-admin/admin-ajax.php",                 data: {                          action: ajaxContacForm,                         name: $('#name').val(),                         email: $('#email').val(),                         phone: $('#phone').val(),                         comments: $('#comments').val(),                     },                 success:function (data) {                         document.getElementById('message').innerHTML = data;                         $('#message').slideDown('slow');                         $('#contactform img.loader').fadeOut('slow', function () {                             $(this).remove()                         });                         $('#submit').removeAttr('disabled');                         if (data.match('success') != null) $('#contactform').slideUp('slow');                          }             });                  });                  return false;              });               });      What I am doing bad?


title: WordPress and template tags for Simple Fields plugin

text: I'm building a website using the Simple Fields plugin to mark a post as featured and to add a simple slide show. I've read the documentation page and they only explain how to do things on the backend. So I have some fields attached to a post, and now I want to get those values on the front-end. How do I get those values?


What function changes a post's timestamp? I created a post from frontend script, but I need to add a date picker to set the date of the visit.


title: Contact Form 7 - Send attachment to submitter?

text: I have installed the Contact Form 7 plugin on my WP 3.2.1 instance. I have setup a contact form for users to request evaluations. This is all working fine, but I was hoping that when they submitted a request, I could ping them an email with an attached product brochure. I have it currently setup like this: ![enter image description here](http://i.stack.imgur.com/i8Uus.png) I have tried using [file-691] where 691 is the id of the uploaded media in the media gallery. Both do not seem to work.   **What is the correct way to achieve this?**


title: how to identify a multisite installation

text: I am creating a plugin. I want to add a different options page, based on multisite or single site. I need a code which can identify installation is Multisite or single site.


title: Plugin to hide image in excerpt

text: I was looking for a plugin that will enable me to hide an image on the excerpt, but show it on the single post view. Anyone knows if there is any?


title: How to register child taxonomies?

text: 1. Should I register both parent and child as `'hierarchical' => true`, if there's no grandchild?   2. If "Movie" is the top level taxonomy, when I register a child, is it as simply as: `'parent_item' => __( 'Parent Movie' )`?   3. How to automatically asign a child taxonomy to a post? So far, I figured out how to asign a taxonomy to a post, but, does this work fine with child taxonomy? `wp_set_object_terms($post_ID, $cat, 'category');`   4. If I query a parent taxonomy, will the child be included in the results or not?   5. If the taxonomies are not listed in the `args` of `register_post_type`, will they still work?


title: How to add equivalent of php include to one page (as plugin?)

text: I'm new to Wordpress. I have a website that I coded myself. One of the pages has PHP functions that take a google calendar feed (with hard-coded login info) and displays it as needed. I am now building a new site on wordpress where I want to use the same code. My reading says I should handle this as creating a new plugin so that I don't overwrite it with any theme updates. My question: how can I simply copy my PHP code into a file in it's own plugin folder and then use a shortcode to access it like an include? Specifically, I don't understand if I am able to use shortcode as an equivalent of `<php? include="myscript.php"?>`.


title: Link to all posts page?

text:
So I have my admin bar hidden by default, because it's ugly, instead of writing a bunch of if statements so certain elements to the WP-admin panel only appear for logged in users, so far so good. The one I'm having trouble with is the 'all posts' screen, the url is wp- admin/edit.php, yet that gives me a 404 error. This works, takes the user to the new post screen.               <?php                  global $user_login;                 get_currentuserinfo();                  if ($user_login) :                 ?>

                              Write

                  <?php endif; ?>      This does not work. This only fails to work when on the single.php, since it's an looking for the url sitename.com/single-post-name/wp-admin/edit.php, the other links work fine on single pages.                             <?php              global $user_login;             get_currentuserinfo();              if ($user_login) :         ?>

                          My Posts

          <?php endif; ?>      Is there some php code or something I can use to link to the all posts part of the dashboard?


title: How to Add a Website Background Image to One Page?

text: What is the easiest way to add a background image to a single page like tryghost.org? I am currently running under WordPress and was wondering what code I need to add and where. The image is only to be placed on the homepage, and when scrolling down the image should be scrolled down as well. It should also be full width (without destroying image ratio) no matter what the device. Thanks for the input! EDIT: Please give a walkthrough on **exactly** what to do for those new to WordPress. I appreciate everyone's help! _Still Unanswered, will give best answer to Answerer._


title: Displaying caption with featured image

text: I'd like to display captions with my featured images. This is another feature that should be available by default but for some reason is not. There are a few routines out there that claim to accomplish the task, but they come up blank for me. Is there any reliable way to display a caption with a featured image?


title: How to store post meta in an array?

text: What is the best way to store post meta in an array (using a custom write box, know how to do that) so that all post meta is in a single custom field?


title: How does WordPress handle permalinks?

text: WordPress auto corrects the permalinks(URLs) even if it is entered incorrectly. For e.g. WordPress will land you in `example.com/some-post` even if you enter `example.com/idontexist/some-post` or even `example.com/some` It could be that, WordPress uses RegEx like or some matching algorithm that compares from right to left and if it finds a match, it will take you to the page even if there are `/.*/` left on the left. Just a guess! How does WordPress do this? Edit: I also noticed that the .htaccess file checks for virtual file/directories using `!f` and `!d` and redirects the request to index.php on the blog folder.


When generating PDF with dompdf I am having this problem in pdf file when viewing file in notepad > Warning : tempnam() [function.tempnam]: SAFE MODE Restriction in effect. The > script whose uid is 10210 is not allowed to access /tmp owned by uid 0 in > **/var/www/vhosts/www.mysite.com/httpdocs/wp- > content/themes/mysite/dompdf/include/image_cache.cls.php** on line **105 > > Warning**: file_put_contents() [function.file-put-contents]: Filename cannot > be empty in **/var/www/vhosts/www.mysite.com/httpdocs/wp- > content/themes/mysite/dompdf/include/image_cache.cls.php** on line **117** > > Warning: unlink() [function.unlink]: Unable to access in > **/var/www/vhosts/www.mysite.com/httpdocs/wp- > content/themes/mysite/dompdf/include/image_cache.cls.php** on line **153** > Blockquote I have included image in pdf file. Without image this message is not displayed. I have tried with absolute and relative path of the image also but did not work. I have set the folder permission to 777 to dompdf folder. Need help on this matter. Thanks in advance


title: Custom Post Type's Capabilities map_meta_cap issues

text: I've created a CPT, added capabilities to it and them to the Subscriber role successfully. However the mapping is clearly not working because I get errors on publish and a Subscriber cannot edit their own posts (which the function below allows if they are the author). Why won't my map_meta_cap function work? I've spent all weekend on this so I have to turn to the community. Thanks in advance.               function lst_map_meta_cap( $caps, $cap, $user_id, $args ) {          /* If editing, deleting, or reading an event, get the post and post type object. */     if ( 'edit_lstpost' == $cap || 'delete_lstpost' == $cap || 'read_lstpost' == $cap ) {     $post = get_post( $args[0] );     $post_type = get_post_type_object( $post->post_type );     $caps = array();          switch( $cap ) {     case 'edit_lstpost':     $caps[] = ( $user_id == $post->post_author ) ? $post_type->cap->edit_posts : $post_type->cap->edit_others_posts;     break;     case 'delete_lstpost':     $caps[] = ( $user_id == $post->post_author ) ? $post_type->cap->delete_posts : $post_type->cap->delete_others_posts;     break;     case 'read_lstpost':     $caps[] = ( 'private' != $post->post_status || $user_id == $post->post_author ) ? $caps[] = 'read' : $post_type->cap->read_private_posts;     break;      }     }          return $caps;     }          add_filter( 'map_meta_cap', 'lst_map_meta_cap', 10, 4 );      EDIT: Also adding all caps to the administrator refuses to work the way I understand it to after reading for 2 days about it. I have played with applying/removing each of the caps to the admin/subscriber role with only the ability to view or create (with an error but still works) Here are the CPT caps:               [edit_post] => edit_lstpost     [read_post] => read_lst     [delete_post] => delete_lstpost     [edit_posts] => edit_lstposts     [edit_others_posts] => edit_lstothers     [publish_posts] => publish_lst     [read_private_posts] => read_privatelst     [delete_posts] => delete_lstposts     [delete_private_posts] => delete_private_lstcapss     [delete_published_posts] => delete_published_lstcapss     [delete_others_posts] => delete_lstothers     [edit_private_posts] => edit_private_lstcapss     [edit_published_posts] => edit_published_lstcapss     [edit_page] => edit_lstpage     [create_posts] => edit_lstposts


title: Using Underscore Templates in WordPress

text: I've noticed that since WP 3.5 that we now have the Backbone.js and Underscore.js libraries included. The new Media Modal uses Underscore templates and I was wondering how would I be able to insert them, especially in the admin side of things.Is there a correct way to insert these?


title: WooCommerce get query string problem with permalink

text: i using WooeCommerce for my site. This is my custom loop product in woocommerce.php located in my theme folder:               if(isset($_GET['product_cat'])){       // list products by category     }      When permalink set is default it working. When i change the permalink common setting to http://thsvt.esy.es/sample-post/ and Product permalink base to http://thsvt.esy.es/shop/sample-product/ then it not working. Anyone can help me? Thanks.


title: Building WP Web App: Creating a Feed for post revisions

text: I'm building a project management web app using WordPress. I want to create a kind of "news feed" on the home page so that everyone can see what the latest posts added/edited were. I need this to work with custom fields too (specifically, I'm using advancedcustomfields). An example of what I'm trying to do:   1. Rick created a new `get_post_type()` called `get_the_title()` on `get_the_time()`   2. Jim changed the Due Date of Client Print Ad from 3/5/13 to 3/2/13 For additions (#1 above), this is really easy. `new WP_Query(array('post_type' => 'any', 'numberposts' => '-1', 'posts_per_page' => '-1', 'orderby' => 'date'))` and then loop through. For edits (#2 above), I'm finding this to be more challenging. Obviously I can see if this is an edit, but I'm having trouble getting the exact edits. I'm thinking of doing `add_action('save_post', 'insert_activity')` and inserting some kind of string to post_meta, but I don't know if that's the best solution or if its redundant with capabilities already built in. Has anyone tried to do this before? I know WordPress has the built in revision manager where you can compare revisions, but what is the best way to compare this on the front end? How does this work with custom fields?


title: How to display my categories in a list (to a post, not the sidebar)?

text:
i want to display my categories to a post like a list. i have this (parent- and child-) categories:               - Sports         - Football         - Basketball     - Toys         - Dolls         - Lego     - Books      for example one post is archived to the categories "Sports", "Football", and "Books" i want to output the categories like this:

Sports

Football

Books

      …as you can see, the hierarchical order by parent->child is important! thanks, Jochen


title: Wrap this custom field with hyperlink link

text:
Just created a custom field from scratch by following a tutorial. I have a field for a website link. Currently it outputs only raw text, no linking. So how do I make this code hyperlink:
Website: '.$_imd_portfolio_website_output.'
      Full code:               function imd_portfolio_meta_box() {         global $post;         // get the custom field values as an array         $values = get_post_custom( $post->ID );         // extract the members of the $values array to their own variables (which you can see below, in the HTML code)         extract( $values, EXTR_SKIP );              // escape the output, just in case         $allowed_html = array(             'a' => array(                 'href' => array(),                 'title' => array()             ),             'em' => array(),             'strong' => array()         );         $_imd_portfolio_details_output = wp_kses($_imd_portfolio_details[0], $allowed_html);         $_imd_portfolio_client_output = wp_kses($_imd_portfolio_client[0], $allowed_html);         $_imd_portfolio_website_output = wp_kses($_imd_portfolio_website[0], $allowed_html);         $_imd_portfolio_quote_output = wp_kses($_imd_portfolio_quote[0], $allowed_html);         $output = '

Details: '.$_imd_portfolio_details_output.'

Client: '.$_imd_portfolio_client_output.'

Website: '.$_imd_portfolio_website_output.'

Quote:'.$_imd_portfolio_quote_output.'>

';         return $output;     }      Update: the problem is solved I've edit my code & change this line -
Website: '.$_imd_portfolio_website_output.'
      to this line-
Website:'.$_imd_portfolio_website_output.'
      thanks everybody for help


title: Adding and removing columns from the admin pages panel

text: I would like to remove "Comments" and "Author" columns from the list of pages, and add a couple of my own "Permalink" etc. Is this possible? Is there an appropriate hook I could use?


title: Display email address field next to author in wp_dropdown_users

text: the post_author_meta_box uses wp_dropdown_users showing the user name of authors. How do I display the email address in brackets next the author's name? Can one filter the wp_dropdown users do to this?


title: Remove dashboard, use Pages tab as default

text: Is there a way to have "Pages" set as the default tab when the user logs in to the admin area? I am using a heavily customised set up, where none of the dashboard widgets are useful so they are hidden anyway.


title: Publish/Update post is changing image links from file url to post url

text: I've written a filter to wrap images included in posts with figure tags and their captions with figcaption tags. I turned off the visual editor so that it doesn't strip out all the html from the images. That all seems to work fine until I publish or update the post. At this point the link to the full size image gets changed to `/sitename/post-type/post- title/attachment/attachment-title/` where before it was `/sitename/assets/filename.jpg` Can anyone help suggest why this is happening? Here is a link to the filter code on pastebin


title: Looking for a filter to modify the months

text: Hi making a simple plugin that replaces the wrong russian month with the right ones. But I can't find any filters that works. I have tried these filters without success: > add_filter('get_the_modified_date', 'russian-month');   >  add_filter('the_modified_date', 'russian-month');   >  add_filter('date_rewrite_rules', 'russian-month');


title: W3 total cache - white screen of death when trying to show certain taxonomies

text: I'm using plugin W3 Total cache and it worked excellent -until I added a custom "detail page" of a custom taxonomy (with a file called taxonomy- categorycourses.php) where the categorycourses is the taxonomy. I get the white screen of death-experience. I have turned errors on, but nothing shows up. I just get a blank page. I've google around and cannot find some satisfying answers. (The taxonomies shows up correctly when not cached , for example - when logged in). **UPDATE** I loved w3 total cache until know. This is a bug that shouldn't exist in the plugin, but it apprently does so I deleted it, and installed WP Super Cache and activated and then everything worked as it should.


title: Which directory should be writable to update wordpress?

text: I configured file permissions according to here like this. `apache` user runs server and `wordpress` user owns directory, this user is only used for this site.               drwxr-xr-x  5 wordpress wordpress  4096 Apr 12 01:12 .     drwxr-xr-x 10 root      root       4096 Apr 10 16:19 ..     -rw-r--r--  1 wordpress wordpress   418 Sep 25  2013 index.php     -rw-r--r--  1 wordpress wordpress 19929 Jan 18  2013 license.txt     -rw-r--r--  1 wordpress wordpress  3193 Jan 27 20:18 readme-ja.html     -rw-r--r--  1 wordpress wordpress 10156 Jan 27 20:18 readme.html     -rw-r--r--  1 wordpress wordpress  4892 Oct  4  2013 wp-activate.php     drwxr-xr-x  9 wordpress wordpress  4096 Jan 27 20:18 wp-admin     -rw-r--r--  1 wordpress wordpress   271 Jan  9  2012 wp-blog-header.php     -rw-r--r--  1 wordpress wordpress  4795 Sep  6  2013 wp-comments-post.php     -rw-r--r--  1 wordpress wordpress  4255 Jan 27 20:18 wp-config-sample.php     -r--r-----  1 wordpress wordpress  4471 Apr 12 01:12 wp-config.php     drwxrws---  5 wordpress wordpress  4096 Apr 12 11:41 wp-content     -rw-r--r--  1 wordpress wordpress  2932 Sep 25  2013 wp-cron.php     drwxr-xr-x 12 wordpress wordpress  4096 Jan 27 20:18 wp-includes     -rw-r--r--  1 wordpress wordpress  2380 Oct 25 07:58 wp-links-opml.php     -rw-r--r--  1 wordpress wordpress  2359 Oct 25 07:58 wp-load.php     -rw-r--r--  1 wordpress wordpress 31909 Dec  4 05:12 wp-login.php     -rw-r--r--  1 wordpress wordpress  8235 Nov 13 20:58 wp-mail.php     -rw-r--r--  1 wordpress wordpress 10880 Nov  5 09:24 wp-settings.php     -rw-r--r--  1 wordpress wordpress 25665 Nov 13 12:23 wp-signup.php     -rw-r--r--  1 wordpress wordpress  4026 Oct 25 07:58 wp-trackback.php     -rw-r--r--  1 wordpress wordpress  3015 Oct 25 11:29 xmlrpc.php               $ ls -la wp-content/     total 24     drwxrws--- 5 wordpress wordpress 4096 Apr 12 11:41 .     drwxr-xr-x 5 wordpress wordpress 4096 Apr 12 01:12 ..     -rw-rw---- 1 wordpress wordpress   28 Jan  9  2012 index.php     drwxr-xr-x 3 wordpress wordpress 4096 Jan 27 20:18 languages     drwxr-x--- 4 wordpress wordpress 4096 Jan 27 20:18 plugins     drwxrws--- 5 wordpress wordpress 4096 Jan 27 20:18 themes      And add `apache` user to `wordpress` group               $ id apache     uid=48(apache) gid=48(apache) groups=48(apache),503(wordpress)      But with these permissions, I can't update wordpress itself or plugins. Which directory should be writable to update correctly and keep as possible as secure?


title: Wordpress custom url menu items being overwritten

text: I am fairly new to Wordpress development. Using a site that runs 3.91 with a custom theme that I have inherited from someone else. My question is fairly simple: I want to add custom menu items that do nothing but point to a specific URL. On the page linked below - you can see that there is a People menu that contains 3 drop downs. I set these up all to be custom URL items in the menu, pointing to: http://instituteforpublicarchitecture.org/people/#board (and #staff and #fellows -- thanks StackExchange for not allowing me to post more links - what a brilliant idea ?!?!) This is all fine - but now after clearing my cache it seems that they are all being overwritten to point (each one) to the same URL: http://instituteforpublicarchitecture.org/?section=people Which obviously is not what I need. Any ideas where I might look to see what is overwriting the menu items? Help is much appreciated! Thank you - J


title: Redirect url in plugin to somewhere else?

text: I am using **WP-SNAP Extended! v1.0.0** and I want to use this alphabetical menu as a sub-menu beneath my header. I managed to get the alphabetical menu in place, but now, if I click on a letter, it will show the posts on the page I am looking at and that is not good, because it overlaps the things that are already there. So you get a very chaotic website with many different content.. What I want to do is this: if I click on a letter, I want it to redirect it to a page where I output the posts that are with that letter. Now, it shows: **http://somesite.com/test/?snap=C** if I click on a letter. I want it to show **http://somesite.com/test/?page_id=68&snap=C** How do I pull this off? I am using this function to get it: `<?php if (function_exists('wp_snap')) { echo wp_snap(); } ?>`


title: How to extract specific image meta for all images?

text:
Been hitting my head against a wall for a couple weeks... I'm working on modifying a geotagging Wordpress plugin called Thesography. I have notified the developer of my past enhancements, and they are OK with it because this plugin is licensed under the terms of the GNU General Public License. Currently the plugin will return a mini popup Google map for a single post, with a single image. I am looking to expand upon it to have another function which will display 1 large Google Map. This larger map will have all my geotagged images as pinpoints Then, using the Google Maps API, also display a thumbnail and post title for the specific image and pinpoint. Onto the code: Here is a snippet of the current code from the plugin. This snippet which retrieves the image data from the database for the specific image. As you can see, this code works for the current post. How can it be modified to include all images from all posts?                   if (is_null($imgID)) {         $images = get_children(array(             'post_parent' => $post->ID,             'post_type' => 'attachment',             'numberposts' => 1,             'post_mime_type' => 'image',             'orderby' => 'ID',             'order' => 'ASC'             ));         if ($images) {             foreach ($images as $image) {                 $imgID = $image->ID;             }         }     }          $imgmeta = wp_get_attachment_metadata($imgID);          if ($imgmeta)     {     if ($imgmeta['image_meta']['latitude'])         $latitude = $imgmeta['image_meta']['latitude'];     if ($imgmeta['image_meta']['longitude'])             $longitude = $imgmeta['image_meta']['longitude'];     if ($imgmeta['image_meta']['latitude_ref'])          $lat_ref = $imgmeta['image_meta']['latitude_ref'];     if ($imgmeta['image_meta']['longitude_ref'])             $lng_ref = $imgmeta['image_meta']['longitude_ref'];          $lat = geo_single_fracs2dec($latitude);     $lng = geo_single_fracs2dec($longitude);     if ($lat_ref == 'S') { $neg_lat = '-'; } else { $neg_lat = ''; }     if ($lng_ref == 'W') { $neg_lng = '-'; } else { $neg_lng = ''; }          $latlng = $neg_lat . number_format($lat,6) . ',' . $neg_lng . number_format($lng, 6);      And here's a sample snippet of the Google Maps API that I need to fit this latitude, longitude into. It will contain the latitude, longitude, the image source URL and the title of the post it displays in. That way someone can hover over a pinpoint, see the image, then click it to read more.                 var point = new GLatLng(43.91892,-78.89231);       var marker = createMarker(point,'The Title of the Page
')       map.addOverlay(marker);      It's a fun one! I have been hitting my head against the wall and have come up blank each time I try.


title: Best way to programmatically remove a category/term from a post

text: I am working on a script to convert all posts in a given category to use a postmeta flag instead (testing of MySQL has shown me that on a site as large as mine this will lead to a meaningful decrease in query time). When converting posts I want to just fetch all posts in the category, add the postmeta then remove the category, which will let me just reload that function until there are no more posts in the category. I can't find a good function for removing a term from a post though. I want to give it the post id and the term taxonomy+ID and have it handled for me. I am also interested in plugins that can do the conversion for me if anyone knows of one. I couldn't find any that did cat->postmeta, unlike the opposite which can be handled by Scribu's plugin.


title: Image caption with apostrophe breaks the text with qTranslate

text: I created my own theme and I use on two different websites, along with a very few plugins (among them, qTranslate!). I noticed that recently (I don't think it was happening before) that all my image captions containing apostrophes are broken. The text is simply cut starting from the apostrophe when I update the post. Can you confirm that it is a bug with Wordpress 3.3.1? I'm trying to find the culprit here :) If it's indeed a bug (or the normal behavior), is there a way so that I can fix it ? Using a filter would be nice, I really don't like hacking the core code. Thanks a lot :) PS: I noticed that by disabling qTranslate the problem disappears. The problem happens exactly when we EDIT the post, it's at that time that the content is screwed up.


title: Conditional PNG Overlay in Custom Post Type Loop Depending on Post Type

text:
I have a loop pulling in two different custom post types. I have that loop showing the thumbnails of posts. Each post type used to have its own seperate loop and I had set up some png overlays to sit on top of the thumbnails. I had a play button icon over the thumbnails of the posts in the Video post type, and a stack of pictures icon over the slideshows post type thumbs. Now that I have combined the two loops I need a conditional statement to determine the post type and apply the appropriate overlay. Here is the code I have that puts the play button over every thumb. How do I change this to a conditional that would apply the btn-play.png over video thumbs and `<img src="<?php bloginfo('template_directory'); ?>/images/btn- ss.png" class="play" />` over slideshow thumbs?               <?php $new = new WP_Query(array ('post_type' => array('video', 'slideshow'), 'posts_per_page' => '5')); ?>        <?php while ($new->have_posts()) : $new->the_post(); ?>

 <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>">              <?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { /* if post has post thumbnail */ ?>              <?php the_post_thumbnail('thumbnail-ws'); ?>              <?php }                  else { ?>              <?php get_the_image( array( 'custom_key' => array( 'Thumbnail' ), 'width' => 100 ) ); ?>              <?php }                      ?>              <img src="<?php bloginfo('template_directory'); ?>/images/btn-play.png" class="play" />              <?php the_title('
', '
'); ?>              <?php the_excerpt(); ?>

        <?php endwhile; ?>      Any help incorporating this conditional statement would be greatly appreciated. _Just in case anyone is wondering about my code, which probably isn't optimal: I have two tiers of thumbnails so all the old posts where I hadn't specified a Thumbnail will use Justin Tadlock's "get the image script". Also, the weird setup with the span tags is because I have the title and excerpt show on mouseover (with css, no js)._


title: Settings API - easiest way of validating checkboxes?

text: I'm using Settings API and I can't get checkboxes to work, if they're set to "false" they're not even being $_POST and that's the point. Stephen Harris & Chip Bennett explained it, but I believe their way is not simple enough (especially for me, not PHP-guy at all). Do I REALLY need a few custom PHP functions and custom-named submit buttons for every form just to get this simple thing working? My settings look much like:               register_setting('XX_theme_settings', 'XX_theme_settings', 'setting_validate' );          add_settings_section('theme_options', 'Theme Options', 'theme_options_generate', 'page1' );      add_settings_field( 'XX_Option1', 'Option 1', 'checkbox', 'page1', 'theme_options', 'XX_Option1', $args = array('id' => 'checkbox1', 'type' => 'checkbox') );     add_settings_field( 'XX_Option2', 'Option 2', 'checkbox', 'page1', 'theme_options', 'XX_Option2', $args = array('id' => 'checkbox2', 'type' => 'checkbox') );       Then I generate checkboxes with this callback function:               function checkbox($args) {         $options = get_option('XX_theme_settings');         echo '<input type="checkbox" name="'. $args['id'] .'" value="true"'; if($options[$args['id']]==true) { echo 'checked="checked'; }; echo '/>';         echo $args['type'];       }      Now, everything I need is a good validate callback:               function setting_validate($input) {        // Firstly it should find all fields of type == "checkbox"         // (I'm not sure why should I check which field was just being sent,         // is updating all the checkboxes from different sections a big no-no?        // it is much easier indeed.        // Now set the ones missing to false/0 and the rest to true/1.        // Then merge everything like below:             $options = get_option('XX_theme_settings');        $merged = array_merge($options, $input);          return $merged;       }      So the question is: **how to list all Settings Api checkboxes and then set the right ones to true?** I guess it'd look something like that:               $options = array(             array(                 'id' => 'checkbox1',                 'type' => 'checkbox',                 'page' => 'page1',              ),             array(                 'id' => 'checkbox2',                 'type' => 'checkbox',                 'page' => 'page1',              ),     );          function setting_validate($input) {        foreach($options as $option) {          if($option['type'] == "checkbox") {              //set it to 1 if sent          }        }             $options = get_option('XX_theme_settings');        $merged = array_merge($options, $input);          return $merged;       }      Thanks :) Here's how Chip Bennett does it exactly, but even with all these great comments I can't get how it exactly works.


title: How to do paging in the loop?

text:
I used `single.php` for this code:               <?php $categories = get_the_category($post->ID);     if ($categories) {         $category_ids = array();         foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;         $args=array(             'category__in' => $category_ids,             'post__not_in' => array($post->ID),             'showposts'=>6, //Gösterilecek yazı adeti             'caller_get_posts'=>1         );         $benzer = new wp_query($args);         if( $benzer->have_posts() ) {             while ($benzer->have_posts()) {                 $benzer->the_post();         ?>
             <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
           <?php } } wp_reset_query(); }?>      This code working, but I want to use pagination in the loop.


title: WXR xml files are being imported as a TXT files and showing up under 'Media'

text: I need to import a whole bunch of non-WordPress posts in to Wordpress. I would hope it would be pretty straight forward as there are no pictures or anything; it's basically just a bunch of text. I'm testing out the WordPress Importer plugin but I'm not having much luck, even just using dummy data. To remove all the variables, here's what I did... I exported all of my WordPress posts to the xml wxr file, removed all but one post with only text, replaced the post data with dummy text, resaved it and imported it. After I click 'Upload Files and Import', the body of the import WordPress turns white and nothing happens. I find that the file has been imported as a txt file with the body of the xml document and is located under Media. Can anyone offer any suggestions as to why this is happening. Update - Debug info: `Class 'DOMDocument' not found in /var/www/html/wp- content/plugins/wordpress-importer/parsers.php on line 61`


title: Twitter Bootstrap Use Collapse in Custom Post Type

text:
I am using Bootstrap with Wordpress and I want to implement the collapse functionality in the content for single pages of a specific custom post type. I know I could create a shortcode, however, with hundereds of posts shortcodes are not going to be ideal. Is it possible to include collapse in the_content of the custom post type (custom-single.php). So when a user enters an .H2 with text below it .p it uses this for a collapse group. So in the custom-single.php I wrap the_content in a custom div id
<?php the_content(); ?>
      How I can associate the H2 and p with appropriate div classes for bootstrap. Is this possible?

                                        Collapsible Group Item #1

                   Anim pariatur cliche...

                                Collapsible Group Item #2

              Anim pariatur cliche...


title: Modify users.php query with multiple taxonomies

text: I've successfully created 3 taxonomies attached to the user object, using the registered_taxonomy and update_count functions of this code - https://gist.github.com/portfola/10750784#file-user-taxonomies-php (I don't need the rest as they're only relevant for taxonomies displaying an admin UI or taxonomy archive which I'm not). These taxonomies store which company, office and teams, each user is assigned to. I know the custom taxonomies are storing the data as I get multiple results back via the `wp_get_object_terms($user->ID,'company')` function. What I need is to be able to filter the users.php results by either one of or multiple of these custom taxonomies. I've created the additional form inputs found at the WP_List_Table and have also added the columns for each taxonomy. The only thing left to do is modify the pre_user_query. I don't think this is the right way to do as it's not having any effect on the results returned at all and I'm only beginner of MySQL. Here's my current code for modifying the query:               function preUserQuery($query) {         global $pagenow, $wpdb;         if(is_admin() && $pagenow == 'users.php') {             $query->query_vars['tax_query'] = array();             foreach(array('userCompany','userOffice','userTeam') as $queryVar) {                 if(isset($_GET[$queryVar]) && is_numeric($_GET[$queryVar])) {                     $query->query_vars['tax_query'][] = array(                         'taxonomy' => get_post_type($_GET[$queryVar]),                         'field' => 'name',                         'terms' => $_GET[$queryVar]                     );                 }             }         }         return $query;     }     add_filter('pre_user_query','preUserQuery',9999);


title: Host Images from Link

text: Recently, I imported all my post from Blogger, so all the images showing in the post currently reside on Blogger's server. I want to import/put all those images to my server and automatically change each link for each image. Since there are so many images and so many post I can not go one by one individually. Please guide me on how to do that or redirect me to a plugin that does this job.


title: Shows site under construction but comes up after I login to admin

text: I have a strange issue happening with a new site. It keeps going down and shows under construction, but after I login to WP admin, the site comes back up! Any suggestions as to what might be going on here? Thanks!


title: Last Update time in widget

text: I have a widget which can be updated every time with few values and admin update it on daily basis now how to get its last update time.


title: Wrong datatype for second argument error

text:
I am getting a strange error on my Wordpress site. Does anybody know what is going on here? and how to fix this? The Error:               Warning: in_array() [function.in-array]: Wrong datatype for second argument in /biz/sportmedia.fi/html/wp-content/themes/sportmedia/template-artikkelilista.php on line 34          Warning: in_array() [function.in-array]: Wrong datatype for second argument in /biz/sportmedia.fi/html/wp-content/themes/sportmedia/template-artikkelilista.php on line 35          Warning: in_array() [function.in-array]: Wrong datatype for second argument in /biz/sportmedia.fi/html/wp-content/themes/sportmedia/template-artikkelilista.php on line 36          Warning: in_array() [function.in-array]: Wrong datatype for second argument in /biz/sportmedia.fi/html/wp-content/themes/sportmedia/template-artikkelilista.php on line 37      Template Code:               <?php     /*     Template name: Artikkelilista     */     get_header();     ?>

<?php the_title(); ?>
                      <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>                      <?php $kategoria = get_field('kategoria'); ?>                      <?php $args=array(                     'post_type'=>'post',                     'cat' => $kategoria,                     'posts_per_page' => 7,                     'paged'=>$paged                     );                  ?>                      <?php                  $temp = $wp_query;                 $wp_query= null;                 $wp_query = new WP_Query($args);                  ?>                      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                     <?php $pfx_date = get_the_date( $d ); ?>                             <?php                                  $get_field = get_field( 'artikkeli-sisältaa-naita-medioita' );                                  $image = in_array( 'image', $get_field) ? 'active' : '';                                 $video = in_array( 'video', $get_field) ? 'active' : '';                                 $sound = in_array( 'sound', $get_field) ? 'active' : '';                                 $text = in_array( 'text', $get_field) ? 'active' : '';                             ?>                             <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_title(); ?>

                                         <?php if(!empty($sound)): ?>

                                         <?php endif; ?>                                         <?php if(!empty($video)): ?>

                                         <?php endif; ?>                                         <?php if(!empty($text)): ?>

                                         <?php endif; ?>                                         <?php if(!empty($image)): ?>

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

<?php echo get_the_date('d.m.Y'); ?>
                                     <?php edit_post_link(' Muokkaa artikkelia'); ?>

                         <?php endwhile; ?>

                         <?php                              if (($IE6 == 1) || ($IE7 == 1) || ($IE8 == 1)) {                             // Do fallback stuff that old browsers can do here                             posts_nav_link('  ', 'previous page', 'next page');                             } else {                             // do stuff that real browsers can handle here                             if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif;                             }                          ?>

                         <?php else : ?>
Yhtään artikkelia ei ole vielä julkaistu.
                         <?php endif; ?>                         <?php $wp_query = null;                         $wp_query = $temp; ?>                         <?php wp_reset_query(); ?>                         <?php wp_reset_postdata(); ?>

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


title: How to keep the /blog slug even in single post slug

text: I have a simple website on wordpress (latest version), assume example.org. I wanna have the user posts at something like example.org/blog/username/posttitle. So I need some levels: 1) example.org/blog (main blog page) 2) example.org/blog/username (username archive page) 3) example.org/blog/username/posttitle (single post page) I've seen a lot of old solutions that are mainly the same, but even if i set the permalink structure as /blog/%author%/%postname% or simply /blog/%postname% it doesn't work. I mean, it works, but when you visit a right generated url I get a 404. Solutions? Cheers,


title: Static HTML to WordPress migration

text: I have a static HTML site (about ten years old) which I am going to migrate to a Wordpress site. I have used Wordpress before but never as a migration target. From some initial background reading I have come up with the following process to perform the migration:   1. Check hosting provider/package for Wordpress suitability   2. Generate complete current site map   3. Make a complete backup of current site   4. Install Wordpress in subdirectory   5. Install Maintenance mode plugin and activate   6. Migrate content to Wordpress instance (looks like this could be painstaking..)   7. Install suitable theme   8. Customise selected theme with Logo/fonts/colours etc.   9. Deactivate maintenance mode   10. Make Wordpress site available from domain root   11. Delete old static html site files (The migration may take place over several weeks/months so I need the static HTML site to be available until step 10 is completed) In my naivety are there any pitfalls in the above process, or additional issues I have failed to consider? Are there any other accepted 'best practices' when performing this kind of migration? (I originally asked this question on Stack Overflow but I guess this is a more appropriate place for such a question)


title: How can I remove unwanted word on my WP site?

text: As this post will likely show, I am new at working with WordPress. My church website is built in WP. Recently I noticed that there is the word, "Array" that appears in the left upper portion of each web page just below the main banner. This seems to be a recent occurrence. I believe that this is the area where at one time there was an automatically updated date and time display. Here is the url for the site: http://lccut.org How do I remove this? Thank you in advance for your assistance. John


title: How to create custom WooCommerce 2.0 templates

text: I'm working on a site for a client who is using version 2.0.1 of WooCommerce plugin and I'm lost as to how I can create new page templates for it. With previous versions of the plugin is was simple, you just copied files from the "templates" folder into your theme folder and boom! But now, that folder is gone. The WooThemes documentation is still being updated to reflect the upgrade to 2.0 so that's no help. Any assistance would be more appreciated.


title: How to limit displayed posts on wordpress

text: How would I edit the following code, so that only 2 of the posts are echoed instead of 3                  <?php                                      global $more; $more = false; # some wordpress wtf logic                                      $num_of_posts = $wp_query->post_count;                                      $current = -1;                                          $cat_id = get_cat_ID(single_cat_title('', false));                                     if(!empty($cat_id))                                     {                                         $query_string.= '&cat='.$cat_id;                                     }                                      query_posts($query_string);                                      if (have_posts()) : while (have_posts()) : the_post(); $current++                                       ?>                                       <?php if($current == 0) { ?>


title: Set up Network Locally on a Flash Drive

text: I've previously used WAMP for developing WordPress themes locally using a WordPress Network using sub domains. Having to set it all up again every time I want to develop on a new computer is a pain, so I decided i wanted to do a portable installation, this way the only file I have to change when using a different computer is the local HOSTS file. I have Xampp portable running off a flash drive just fine. I also have WordPress 3.5.1 running on said installation just fine. However, when I run through WordPress's install to convert a clean WordPress installation to a WordPress Network (Add WP_Allow_multisite to the config, then run through WP's network set up, copying the required settings to the required files), it just won't take. The dashboard never adds the "My Sites" button to the dashboard, so I never get the ability to add new sites. (Yes, I tried clearing the Cache.) However when I go to Network setup again it does recognize that a network exists. I'm somewhat familiar with WordPress's MySQL tables, having poked through them before and manually edited values when moving installations between local and remote. When I checked the databases on one of these failed installations, it seems to me like some of the necessary tables for a WordPress network aren't being created during the Network installation. I spend around 3 hours double checking my hosts and VHosts, deleting the database, and reinstalling WP form scratch multiple times. As much as I love solving my own problems, it's time to ask others to look over what I have. Here's the files I am working with: ### httpd-vhosts.conf               NameVirtualHost *:80            <VirtualHost *:80>         DocumentRoot "/xampp-portable/htdocs"         ServerName localhost       </VirtualHost>            <VirtualHost *:80>         DocumentRoot "/xampp-portable/htdocs/mysite"         ServerName mysite.loc         ServerAlias *.mysite.loc         <Directory "/xampp-portable/htdocs/mysite">          Options Indexes FollowSymLinks Includes          AllowOverride All          Order allow,deny          Allow from all         </Directory>       </VirtualHost>      ### Windows HOSTS files               127.0.0.1       localhost          127.0.0.1       mysite.loc     127.0.0.1       www.mysite.loc     127.0.0.1       site1.mysite.loc     127.0.0.1       *.mysite.loc      ### wp-config.php               <?php     // ** MySQL settings - You can get this info from your web host ** //     /** The name of the database for WordPress */     define('DB_NAME', 'gmi_main_wp');          /** MySQL database username */     define('DB_USER', 'mysite_admin');          /** MySQL database password */     define('DB_PASSWORD', 'censored');          /** MySQL hostname */     define('DB_HOST', 'localhost');          /** Database Charset to use in creating database tables. */     define('DB_CHARSET', 'utf8');          /** The Database Collate type. Don't change this if in doubt. */     define('DB_COLLATE', '');          /**#@+      * Authentication Unique Keys and Salts.      *      * Change these to different unique phrases!      * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}      * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.      *      * @since 2.6.0      */     define('AUTH_KEY',         'jo`QznTiAC3?a/V($j9]3e){#*-IAK=ifHIOLk$bryzLCMtp@&`&EI@)r-i>$@vW');     define('SECURE_AUTH_KEY',  'HCm0;@[bv0 }tKMR~dtl6fZMQC-T6} k^tyP& nP7%s.ut ]R<:fO5+8jG$BX$6T');     define('LOGGED_IN_KEY',    'hkg@N&?;$}mq>qL`o&0*Ni<:Oc=K#)d:a`.pdareq`n0&;X6/o|6g2aCd#%jee%D');     define('NONCE_KEY',        'BZN6oCg7(.|$,Wsf!+4%KT,Xc=G&yLRE&283[<_;8 ~L9+HQ6?>AD~1O$6@AN1;;');     define('AUTH_SALT',        'y7Xx}F+U8hoMke-y|s!Mqum2GjSGoSi)As$]0%vqpZj/Gmg+-u_K+x6z(@^X@sTB');     define('SECURE_AUTH_SALT', '1(e`{l$EzdRjkQ}s9Z<g:fa|6X$RHz7d?L5r5q#O(EiVi&]03lgl{D~:~lM)jYF-');     define('LOGGED_IN_SALT',   'GhJ)gh7q3Vfl~zL,Ct1AoWt?gj5EhTcxI;:}?V^G#]354SIGg/;8+S=,qC_F%f2V');     define('NONCE_SALT',       'd2ee=WxWsm`^+KO}6$#fQ[S3fTGWy n$5`/0.fpK|nU1dq>e8j(.[7X!wS)[e>e}');          /**#@-*/          /**      * WordPress Database Table prefix.      *      * You can have multiple installations in one database if you give each a unique      * prefix. Only numbers, letters, and underscores please!      */     $table_prefix  = 'main_wp_';          /**      * WordPress Localized Language, defaults to English.      *      * Change this to localize WordPress. A corresponding MO file for the chosen      * language must be installed to wp-content/languages. For example, install      * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German      * language support.      */     define('WPLANG', '');          /**      * For developers: WordPress debugging mode.      *      * Change this to true to enable the display of notices during development.      * It is strongly recommended that plugin and theme developers use WP_DEBUG      * in their development environments.      */     define('WP_DEBUG', false);          /* That's all, stop editing! Happy blogging. */          /** Absolute path to the WordPress directory. */     if ( !defined('ABSPATH') )         define('ABSPATH', dirname(__FILE__) . '/');          /** Sets up WordPress vars and included files. */     require_once(ABSPATH . 'wp-settings.php');          /* Multisite */     //define('WP_SITEURL','http://mysite.loc');     //define('WP_ALLOW_MULTISITE', true);     define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', true);     define('DOMAIN_CURRENT_SITE', 'mysite.loc');     define('PATH_CURRENT_SITE', '/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);      ### .htaccess               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^(wp-(content|admin|includes).*) $1 [L]     RewriteRule ^(.*\.php)$ $1 [L]     RewriteRule . index.php [L]      And finally a picture of the db Tables. I feel like some tables that should have been created are missing: ![](http://i.minus.com/i48qe2OEU9A3d.png) ## Edit: I enabled debug and now get the error "Constant MULTISITE already defined" on line 95. Line 95 is the line where I have define('MULTISITE', true). I'm wondering if somehow `is_multisite()` is returning false, causing the wp_settings file to echo define('MULTISITE', false), which causes the error. And THAT leads me to suspect that files like `load.php` and `functions.php` are not working properly… which points to my permissions set in the vhosts file. I'm using relative paths due to this being a flash drive install. And that is something that is different from previous installs.


title: How to register custom menu widget

text: I'm trying to register a custom menu widget programmatically with `wp_register_sidebar_widget`, but it doesn't appear in wordpress. I'm using remote call of that method (xml-rpc). Referring to codex I'm passing parametres like that to that method:               wp_register_sidebar_widget(         'custom_menu_widget-1',         'My name',         'WP_Nav_Menu_Widget',         array( 'description' => 'blogroll' )     );      It should create custom menu widget named 'My name', but it registers nothing. I think that third parameter `$output_callback` may be wrong, but I can't find nowhere, what callback should be for custom menus. I've got no output or error from that call, so I can't see what is wrong. Maybe I miss something or there is another way to register custom menu widget? I don`t want to edit function.php, I just want to register standard custom menu widget using wp methods.


title: Hide prices and checkout functionality in woocommerce

text: I know this question might be too broad, but I'm looking for a bit of direction. My client has a woocommerce store with 30-40 products. For whatever reason they do not want to sell online anymore, but they want to retain the product pages, information, etc. on their website. Is there a way, using hooks or otherwise, to hide things like prices, add to cart button, etc. in woocommerce? Or should I just edit the php template files?


title: Add segment to URL in htaccess

text: I want to edit .WordPress .htaccess file, add a segment to URL in the following fashion: Instead of:               http://www.example.com/mypost/      make it               http://www.example.com/coolstuff/mypost      How can I do that?


title: how to remove sidebar from particular one page

text: I am writing this code in page.php for removing the sidebar in one page               <?php if (is_page('x')) : ?>     <?php else : ?>     <?php get_sidebar(); ?>     <?php endif; ?>      ... where `"x"` is the ID of that page. but I am having a bit of trouble though the forum which is the page in question does not stretch across the whole page. how can I solve this problem?


title: Why are two functions over-riding each other?

text:
I have function in my plugin that is:               add_filter('comment_text', 'commentimage_comment_text');     function commentimage_comment_text($comment = '') {        $options = get_option('commentimage');       $id = get_comment_ID();            $images = $options['images'];       if (!isset($images) || !is_numeric($images)) $images = 1;         $url = get_option('siteurl');         for ($i=0; $i<$images; $i++) {           if (file_exists(ABSPATH . 'wp-content/comment-image/' . $id . ($i==0?'':('-'.$i)) . '-tn.jpg')) {              $comment .= '

';           }         }       return $comment;     }      Now it is showing a successful image uploaded by my viewers. I want my viewers to have the option of rating them, so for that I write in my plugin just below the above line the following code:                add_filter('comment_text', 'commentimage_comment_text2');      function commentimage_comment_text2()      {        $rtt= "
Rating";        return $rtt;      }      Then my pictures are gone and it shows text rating - I will change the text rating to my desired needs once I get the answer on how to overcome over writing.


title: How to display a link in the footer section

text: i'm using the BAAP Mobile version plugin and the footer link that switches between desktop and mobile version is being displayed outside of the wrapper>footer divs. Is there a hook or a method to have the switcher link display in the footer section? This is the function that creates and displays the links in the wpmp_switcher.php file.               function wpmp_switcher_wp_footer($force=false) {       if(!$force && (get_option('wpmp_switcher_mode')=='none' || get_option('wpmp_switcher_footer_links')!='true')) {         return;       }       switch (wpmp_switcher_outcome()) {         case WPMP_SWITCHER_MOBILE_PAGE:           print wpmp_switcher_link('desktop', __('Switch 2 our desktop site', 'wpmp'));           break;         case WPMP_SWITCHER_DESKTOP_PAGE:           print "<p>" . wpmp_switcher_link('mobile', __('Switch to our mobile site', 'wpmp')) . "</p>";           break;       }     }


title: Does codex.wordpress.org use a plugin of some sort? If so what plugin?

text: I'm attempting to set up a wiki within a Wordpress install and love the way codex.wordpress.org is set up. Are they using a specific plugin to accomplish that or just well structured pages? Is there a similar plugin available to users?


title: Add/overwrite a parameter on an existing post type/taxonomy

text: I have several sites with Custom Post Types and Taxonomies registered by different plugins. Is there a way to add or change a parameter like this               "'rewrite' => array( 'hierarchical' => true )"      by adding something to functions.php—without completely re-registering the type/taxonomy? I want to continue to use certain plugins to manage types and taxonomies, but not all parameters are provided.


title: Set a background color per image added to a post

text: When using a modal window such as lightbox or shadowbox to display a post's images, client would like to be able to choose the background color that would be used for the modal window according to the image to be shown: color would be either black, white or grey. I'm thinking such hack should be done via a plugin but i didn't find any, so i guess i should do it myself. It scarces me a bit: where should i store the chosen value? What hooks ? Any help would be welcome.


title: Disabling plugin but wpenqueue is not available

text: I'm trying to disable a few plugins when my mobile theme is loaded. I read somewhere about using this particular function in my mobile theme functions.php file to remove scripts and css.               //Disable plugins     add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );          function my_deregister_javascript() {         wp_deregister_script( 'smp_common','smp_cookie','smp_colorbox','smp_meerkat','jquery','query-ui-sortable' );     }     //Deregister styles     add_action( 'wp_print_styles', 'my_deregister_styles', 100 );      Going by the above, i've been able to remove a few scripts, but unable to remove the 'share post' plugin as wp_enqueue is not mentioned in the script. Is there an alternative to disable this plugin?


title: How do I add pricing fields to a Gravity Form?

text: I need help. I am trying to create an album order form with my gravity form plug in and am looking to add a pricing field. I have googled the heck out of this topic and can't seem to figure out how...even on Gravity Form's blog! Thanks in advance, Jaime


title: How WordPress converts URL to $query_string

text: My home.php shows a list of (N) posts and << Previous & Next >> links. When clicked, I want to fetch previous/next list of (N) posts using Ajax. This is: I do NOT want to load the entire page. I just want to get the posts' list and append it to current. For this I make an ajax request and send href (URL) as parameter. The problem is I do not know how WordPress converts a URL to global $query_string. I want to reuse WordPress' tested code instead of writing my own. Please help For example: I want to fill $query_string for this URL: http://example.com/page/2/?location=boston


title: List categories of a post hierarchically?

text: Let's say I got the following categories:               Style       |       + Shoes       + Pants      If I make a post and put it in the Style and Shoes category, it will list them alphabetically instead of hierarchically. So it would list it as Shoes, Style instead of Styles, Shoes. How can I do this? I tried using "the_category('> ', 'multiple')" but that outputs "Style, Shoes, Style" Thanks!


title: Wordpress Ecommerce Chase Paymentech Integration

text: Just wondering, If any body have integrated Chase Paymentech Payment Gateway with WordPress for Shopping Cart purpose?


title: Change the author posts link using custom user metadata

text: I am trying to use a custom value to be used in the author posts URL instead of the `user_nicename` which defaults to `user_login` in the pretty permalink structure. So far I managed to do that but now the new URL `/author/custom_user_nicename` generate a 404 error while the old one `/author/user_login` still works. The code I used in theme `functions.php` file:               add_filter('author_link', 'update_author_link',10,2);     function update_author_link($link,$author_id) {         if (FALSE === strpos($link, '?author=')) { // only if pretty permalinks used             $position = strrpos($link, '/');             if (strlen($link) == $position + 1) { // check and remove trailing slash                 $link = untrailingslashit($link);                 $position = strrpos($link, '/');             }             $link = substr($link, 0, $position+1);             $link = $link . get_the_author_meta('custom_author_nicename', $author_id);             return user_trailingslashit($link);         }         return $link;     }      I tried to flush the rewrite rules by going to settings -> permalinks and save but that did work as well. do I need to update or modify anything else for the new author URL to work? Thanks.


title: Help with Wp Query

text: I have a custom post type, and using wp query I am wanting to display posts only by authors with a specific role. How can I go about doing this?


title: How can I redirect mobile users to diff url, but also allow them to come back to full site

text: this is pretty straight forward: How do I redirect mobile users to /mobile, but still allow them to click a "Full site" button and see the full site without being redirected again back to the mobile site? I have played with a bunch of the plugins that say they do this, but none seem to handle the second step. They redirect to the /mobile . but if a user wants to go to the full site, it tries then redirects back to mobile. I am running WP3.0.1


title: How to order images in a post in Wordpress 3.3?

text: In wordpress 3.2 when uploading images to a post, I would get a Gallery that is linked to the post. That is, I could see in the media uploader of the post a tab that contains only the images of this post, and there would be a place to mark the order of the images I wanted for the post. In wordpress 3.3 I can only see the media library of all the images I have ever uploaded, and I cannot order them in any way. Is there a way to order the images related to a post? Have I somehow managed to upload the images incorrectly so that they are not attached to a post? Any help would be appreciated.


title: Dropdown primary navigation menu not working

text:
I have installed a theme on WordPress added pages, created a custom menu called Primary Nav. I have then assigned this as my Primary Menu. I have child pages and the menu looks like this. I have looked at the WordPress resources to find a solution but it seems as though I have followed the instructions on creating drop-down menus. ![enter image description here](http://i.stack.imgur.com/xuIM6.png) However when I go to the previewDNS site the drop down doesn't work. The code is below, if another area is required please let me know where on the source page I will find it and I will add here.

About

Portfolio

Packages

Photography Prices

Wedding Albums

Signature Frames

Wedding Stationery

Blog

FAQ’s

Contact


title: Making the Content Editor Box Bigger in 2013

text: I know that question have been answer, but answer is no more current with wp 3.5.2 (or 3.6) and many plugin, qtranslate first... i dont have the "size of the post box" in Settings > Writing. Yes i can manually extent the box with the lower right triagle, but when saved, it's back to super small 2-3 line in height So the question, how do i change it PERMANANTLY to 30 line in height ?


title: a plugin to share a post to social networks via admin?

text: I'm not looking for a share this post button for the front end. I've seen a couple of similar topics here but not exactly what I'm after. What I would like is a plugin which offers the options in the admin panel to post a link my post to a facebook page, tweets it, perhaps takes the images and sends to flickr and so on. Something which would offer me some controls and configuration to make the oauth connections and then gives me extended sharing features when I make a new post. Has anyone seen anything like this? I'm a bit overwhelmed when I look through the plugin directory searching for social plugins... Thanks for any help whatsoever..


title: How can I create a smarter .htaccess file that will add a directory?

text: This is my current .htaccess file:               Options +FollowSymLinks     RewriteEngine on     RewriteRule (.*) /directory/ [R=301,L]      And "directory" is where my wordpress install is. So this simply redirects people from the root domain to the directory. What I would like to do is create it so any information added to the url is passed through when the directory is added. SO `http://yoursite.tld/page` becomes `http://yoursite.tld/directory/page/` I know this is probably a snap for someone with more experience with regular expressions. Unfortunately I haven't been able to track down the info with standard web searches. Appreciate the help...


title: Change page title from plugin

text: Is possible to change page title on the fly from plugin? I've try global $post, but seem like plugin runs after. Any Ideas? Edit: Im writting some pages on the fly, based on same page / post, so every page show the same title. Looking a way to do via shortcode or writting my own plugin/function


title: Exclude custom taxonomy tag from loop

text: I have the following code at the beginning of a loop:               <?php query_posts('showposts=3&cat=84'); ?>     <?php $posts = get_posts('category=84&numberposts=3&offset=0'); foreach ($posts as $post) : start_wp(); ?>      I have a custom taxonomy called "display," with a tag called "featured- slider." In this loop, I want to include everything from category 84, but I want to exclude everything with a "featured-slider" value in the "display" taxonomy. How would I rewrite the two lines above (query_posts and get_posts) to correctly exclude the custom taxonomy? thank you