title: One author not showing in Author drop down list while editing page

text: USER01 is not showing in Author drop down list while editing a Page if he's in the my custom ROLE "mycustomrole". If I change his role as an AUTHOR, and add the very same custom and non custom capacities, he's shown in the list. I created this role programatically, as shown below. Is there something particular to add in order to see it in my Authors list?               function cjg_4cast_addroles(){         cjg_add_role('mycustomrole','My Custom Role',array(             array('singular' => 'side-add', 'plural' => 'side-adds'),             array('singular' => 'partner', 'plural' => 'partners')             ),             array(                 'read' => true,                 'upload_files' => true,                 'edit_files' => true,                 'edit_pages' => true,                 'edit_published_pages' => true,                 'publish_pages' => true,                 'delete_pages' => true,                 'delete_private_pages' => true,                 'edit_private_pages' => true,                 'read_private_pages' => true,                 'publish_posts' => true,                 'edit_posts' => true,                 'edit_published_posts' => true,             )         );     }          function cjg_add_role($role_name,$role_name_display,$custom_type_slugs,$capabilities){              foreach($custom_type_slugs as $custom_type_slug){             $capabilities = array_merge($capabilities,                 cjg_capabilitiesarray_fromslug($custom_type_slug['singular'],$custom_type_slug['plural'])                 );         }              add_role( $role_name, $role_name_display, $capabilities);     }          function cjg_capabilitiesarray_fromslug($singular,$plural){              return array(             "edit_$singular" => true,             "read_$singular" => true,             "delete_$singular" => true,             "edit_$plural" => true,             "edit_others_$plural" => true,             "publish_$plural" => true,             "read_private_$plural" => true,         );     }


title: Is there any way to pass messages from a script to a redirect target in a hidden fashion?

text: I'm trying to pass error messages or regular messages from a page that processes a form post request to the page it then redirects to (after processing). Since i want to get rid of the POST request header (you know...browsers trying to repost on page reload), i need to redirect (no include or using same page, possible). Or can i somehow get rid of the POST request header? I'm wondering if there's any non-visible way of passing my messages to the next page, since i can't use $_SESSION and don't want to use GET request parameters. Thanks.


title: getting all values for a custom field key (cross-post)

text: I know how to get a custom field value for a specific post.               get_post_meta($post_id, $key, $single);      What I need is to get all the values associated with a specific custom post key, **across all posts**. Anyone knows of an efficient way to do this? I wouldn't want to loop through all post id's in the DB. Example: 4 posts all with different values for a custom field called 'Mood'. 2 posts have the value 'happy', 1 post have 'angry' and 1 post has 'sad' I want to output : across all posts we have: two happy, one angry and one sad author(s). But for LOTS of posts. What I'm looking for is either:   * a WP function to get this. or   * a custom query to get this as efficiently as possible.


title: Setting featured image with function, 1 part not working

text: I'm trying to set a post's featured image based on custom fields. There are different types of posts and therefore the featured image should be set depending on which custom fields have been filled out. Here is what I currently have (edited):               //Set post thumbnail based on various conditions             if (get_post_meta($post_id, 'featured_image', true)) {                 $attachment_id = get_post_meta($post_id, 'featured_image', true);             } elseif (get_post_meta($post_id, 'upload_single_image', true)) {                 $attachment_id = get_post_meta($post_id, 'upload_single_image', true);             } elseif (get_post_meta($post_id, 'create_gallery', false)) {                 $gallery = get_post_meta($post_id, 'create_gallery', false);//get the full gallery                 $attachment_id = $gallery[0]['upload_image']; //Get image from first row                 }      The first two conditions are working, but the third condition (create gallery) isn't. I thought that getting the first row of the db table and then calling the name of the custom meta data would do it, but it's not working. Anyone see what I might be doing wrong?


title: homepage loading too slow

text: I transferred a website to VPS and when I open that website, the home page takes too long to load, for me its taking 30-35 secs just to display the home page, but when I navigate the internal pages it loads in normal speed, I also tried this when all of my plugins were deactivated, but no change, it was taking time to load.


title: Admin Menu Hack (Left side in Dashboard)

text:
How can I add a Title to my Admin Menu on the left side of the dashboard? Not a link, but just a title? I want do this in my functions and not use a plugin. Also which template file handles this menu? **I found this but I have no idea of how to use it:** **Adding a Word at the Beginning of the Menu** This example will allow you to add the word of your choice to the beginning of your menu as a list item. In this example, the word "Menu:" is added at the beginning. You may want to set an id on the list item ("item-id" in this example) so that you can use CSS to style it.               <?php wp_nav_menu( array( 'theme_location' => 'primary', 'items_wrap' => '

Menu:
%3$s
' ) ); ?>


title: When to use which plugin output method?

text: I'm a Drupal dev, getting into Wordpress. So far as I can tell there are a few different methods by which a plugin can output content on to a Wordpress site:   * Shortcode   * Rewrite API   * Widget API   * "Template tag" (ie instructing themers to call a PHP function from your plugin in their theme)   * Actions API Which do you use and when? Are there any good articles covering such a topic out there?


title: Child Terms not Displaying on the Taxonomy Term Admin Screen

text: I am experiencing an issue where terms with a parent are not being displayed in the category admin screen. The screen gives the total number of terms that should be there (i.e., 32), but only displays parent terms (i.e., 9). Interestingly, if run:               var_dump( get_terms( 'category' ) );      all 32 terms are returned. Does anyone have an idea as to how I might be able to get those terms to display? Thanks!


title: add button to post edit page when post_status=publish

text: # Question   * what hook can be used to add a custom button to the 'Publish' metabox on the 'Edit Post' admin page? # Use case I have a hand-rolled custom post type called `ash_newsletter`. I want to add a button to the `post.php?post={$post->ID}&action=edit` admin page for this post type. The button will only appear after the post has been published. The button will only be clickable once. The button will be located in the "Publish" metabox. My idea is that when the button is clicked, a script will check the current post status and will check that a post_meta, ash_already_ran==false. If both conditions pass, a function will be called that contacts another service. If the function returns true, 'ash_already_ran' will be updated to true.


title: What is the most secure way to set up the MySQL user in WPMU?

text: I am setting up Subdomain based MU on my domain.Everything is hosted by me running on one CentOS/Webmin VPS. Will I be better off setting the MySQL user's domain as localhost, 127.0.0.1 or with a wildcard %.mydomain.com? Which is more secure? Is localhost === 127.0.0.1? If not what is the difference? Also, what is my domain from MySQL's or Wordpress' pov when I am connected by ssh terminal? How about When I connect by Webmin or Usermin? I know that does not appear directly WordPress related, but My Usermin users will be power bloggers who need Superuser privileges, so I need to provide a clean interface. I am thinking about providing a plugin. Any MySQL gurus out there?


title: Remove Author Slug & Replace With Username

text: I reviewed all related questions but none tackle this exactly so I'm posting the question in hopes the pro's know how to handle this. I would like to change the author slug to remove the term /author/ completely like this; currently `example.com/author/username` want `example.com/username` Moreover I'd like all posts related to an author to look like:               example.com/username/post-title      URl strucutres would resemble a.) either wpmu or b.) cpt without actually building either. To add more context. I'm building a multi author blog where users have independent pages (author pages) that they can build, post, and share. All posts created by all authors will be included in the main loop (for now). What's my best case scenario and worse case scenario to achieve this?


title: Redirect ALL subfolders to subdomains automatically

text: I've read several topics about redirecting some single pages to subdomains. There aren't a lot that explains this well and all requires me to manually edit the htacccess or create some folders for every new subdomain I want to use. (My wordpress installation is in the example.com/wordpress folder but I'm able to change its location quickly.) How do I redirect ALL top-level subfolders to subdomains automatically without creating a ton of .htaccess rules or manually create a new folder everytime I create a new page?


title: How can I filter blog name?

text: I want to filter the blog's name for Google's user agents. I have tried `the_title`, `the_content`, `comment_text`, `single_post_title`, `wp_title`, `category_description`, `bloginfo` hooks, but none of them worked! Can anybody help me?


title: Dynamic landing page - am I doing this right?

text: What I want: When a user goes to: > www.mydomain.com/details/?pid=12345 he is taken to a landing page that loads up a user-specified template, fills it with the details from our DB, and then prints it out. I do NOT want a separate page/post for each product; I want it created dynamically from the DB each time. (Yes, I understand the ramifications.) What I've done:   * Created a plugin "PD" that lets a user specify the template (eg: `"{title}<br>{description}"`) and it saves the option as 'pd_template'.   * Created a new 'details.php' called "Details" in the Theme that displays some theme-specific headers, etc, and calls my pd_display(`$_GET['pid']`) to show the main content.   * Created a new Page in WP with the slug "details" and set it's page template to "Details" This seems like a very convoluted way to do all this. Can someone explain a better, cleaner way of doing this? [Bonus Points] If you can show me how to use a URL like > www.mydomain.com/details/12345 instead of ?pid=12345 that would be just peachy.


title: Static page teaser with Genesis framework

text: I am building a site where the front page is static and a separate blog page. I would like to place 2 or 3 teasers from the blog page on the home static page. They would need to be dynamic so as to pull the latest post. I have tried the plugin but that doesn't work. I am ok at understanding hooks and PHP, just not too good at writing it! I would appreciate any help.   James


title: get_the_categories() but exclude children of "Uncategorized"

text: In this function, I need to exclude any categories from $categories which are children of "Uncategorized".               function get_cats(){         $post_cats= array();         $categories = get_the_category();         foreach($categories as $cat){               array_push($post_cats, $cat->cat_ID);         }         return $post_cats;     }      Thanks in advance if you can help.


title: Can I create a NextGen gallery from a WordPress gallery

text: Is it possible to convert a standard WordPress gallery that I have created in a page to a NextGen Gallery? And if so, how do I do this?


title: Query posts in a category and include only one post per author?

text: I'm attempting to list posts from a category (a random selection). However, I only want to display one post per author. Thoughts? Appreciate the help.


title: Post in multiple categories do not include in previous / next post if one category in excluded

text:
I have read the following post which appears to solve my problem but doesn't... excluded_categories parameter in next_post_link() behaving unexpectedly I have posts in say 3 categories but if they are included in category 'update' (which is ID 96) I would like them excluded from the previous / next navigation system. From the above post I have edited the following code (this is all in my functions.php file as the single.php template calls for the navigation from there).               <?php previous_post_link( '
%link
', '' . _x( '←', 'Previous post link', 'reboot' ) . ' %title', FALSE, prev_next_dont_include( array( 96 ) ) ); ?>      and added the following code...               function prev_next_dont_include( $ids ) {     foreach ( get_categories() as $category ) : // loop thru all WP cats         if ( !in_array( $category->cat_ID, $ids ) ) : // check if cat id is in $ids             $categories[] = $category->cat_ID; // build list of real excluded ids         endif;     endforeach;      return implode( ' and ', $categories ); // "1 and 2 and 5 and 7 and 16 and 23"     }      Now when I go to my navigation, instead of excluding category 96 it only includes all posts within category 96 - the posts could also be included in other categories also. It excludes all posts not in category 96? Can anyone assist?


title: Replacing the WP.me URL shortener with Bit.ly

text: I am setting up a big blog for a client and we're looking to replace the wp.me shortlinks in the header and in everything with our custom domain on bit.ly. I have working code to build the Shortlinks, im just wondering if there is any way to replace the functions so pressing "Get Shortlink" and tweeting links, would use our bit.ly Is there a way to add action and replace the existing wp_get_shortlink and a like? To be clear, i want all the same functionality, just with a different short link.


title: Wordpress Custom Menu Widget Style

text:
I am wondering if anyone knows the best method for splitting 1 custom menu widget (located in my sites footer) in to 2 columns. There are a total of 8 links, so I would like it to be split in to 2 columns of 4 links. Not sure if there is a function for this or is there some CSS to achieve this? The HTML markup from the widget looks like:

             Link

      repeat that structure 7 more times for the line items code.


title: Display custom post type and custom fields within a Bootstrap Carousel

text:
I am using the "Types" wordpress plugin for the first time. I created a custom post type, as well as some custom fields. How do I dynamically call all the custom posts into a Bootstrap carousel, and also display the fields within that loop? And how do I limit the amount of posts that will cycle through the carousel? Another requirement is that I need to add that necessary Bootstrap 'active' class to _only_ the first post. Here is my first shot, (also note that I have some custom js for creating pagination for the carousel, but that is not an issue (so far!))

                      <?php $loop = new WP_Query( array( 'post_type' => 'testimonial' ) ); ?>
                     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php the_content(); ?>
                                              <?php endwhile; ?>

      Here is my second attempt. I got this to work beautifully, except for displaying the custom field values. Any suggestions? It looks like the syntax is correct... Am I missing something basic here?               <?php $the_query = new WP_Query(array(     'post_type' => 'testimonial',      'posts_per_page' => 1      ));     while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

             <?php the_content();?>             <?php echo get_post_meta($post->ID, 'authorinfo', true); ?>

     <?php endwhile; wp_reset_postdata(); ?>     <?php $the_query = new WP_Query(array(     'post_type' => 'testimonial',      'posts_per_page' => 5,      'offset' => 1      ));     while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

         <?php the_content();?>         <?php echo get_post_meta($post->ID, 'authorinfo', true); ?>


title: saving custom taxonomy as post title

text: I have two custom taxonomies; "name" and band". The first represents the name of the song, the second represents the band that made the song. I want to automatically save a combination of those two custom taxonomies in the post title upon saving. So in the following example: name = "Little Lion Man" band = "Mumford and sons" .. I want the post title to become "Mumford and sons - Little Lion Man" The code I now have (and works!) is based on this post. However, what this code does is only get one custom taxonomy (in this case the song name, or 'name'). I want to put two custom taxonomy terms in the post title. This is the code I have now, and I don't know where to begin. I'm not an expert on php.               add_action('save_post', 'update_term_title');     function update_term_title($post_id)     {         if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)          return;     if(!current_user_can('edit_post', $post_id))         return;          $term1 = wp_get_post_terms($post_id, 'name', array('fields' => 'names'));     $term2 = wp_get_post_terms($post_id, 'band', array('fields' => 'names'));          $terms = $term1;          if(empty($terms))          return;          $title = false;      foreach($terms as $term)      {         if($term->parent)          {             $parent = get_term($term->parent, 'name');              $title = $term->name.' '.$parent->name;             break;         }     }     /*Default to first selected term name if no children were found*/     $title = $title ? $title : $terms[0]->name;          /*We must disable this hook and reenable from within     if we don't want to get caught in a loop*/     remove_action('save_post', 'update_term_title');     $update = array(         'ID'=>$post_id,         'post_name'=>sanitize_title_with_dashes($title),         'post_title'=>$title     );     wp_update_post($update);     add_action('save_post', 'update_term_title');     }      Does anyone have a suggestion on how to make this work? It should be a minor modification of the code. Maybe make two loops?


title: New Widget are not showing

text:
I added a new sidebar according to WordPress Codex and for some reason it shows only on the admin and nothing shows on my front pages.. I tried to look for it on Google and here on the forums but I couldn't find what I'm doing wrong. I'm using Sahifa theme which has it's own "theme-functions.php". It doesn't work if i add it to the 'functions.php'. Here is my code-               <?php     function arphabet_widgets_init() {         register_sidebar(array(             'name' => 'Header Widget Area',             'id' => 'home-header-1',             'before_widget' => '
',         ));     }     add_action( 'widgets_init', 'arphabet_widgets_init' );     ?>      And on my 'header.php'-
         <?php dynamic_sidebar( 'home-header-1' ); ?>
      I added a banner widget to my sidebar through the admin panel but nothing shows.. Where did I go wrong?


title: Front-end update_post_meta with ajax

text:
as written in title I'm trying to update a post_meta using Ajax. Actually I'm a complete newbie to Ajax and how it works so, if it is possible, I would appreciate if someone could 'take me by hand' and explain how to achieve this. Actually this is my code:               <?php     // in custom page template     if ( isset( $_POST['5e'] ) && wp_verify_nonce($_POST['5e'],'update_5e_postmeta') )         { //if nonce check succeeds.             global $post;             $postid = $post->ID;             $data = $_POST['cinqueuro'];             update_post_meta($postid,'Banconote5',$data);         }     ;?>     <?php          $cinqueuro = get_post_meta($post->ID, 'Banconote5', true);?>     <form method="post" action="">        <?php wp_nonce_field('update_5e_postmeta','5e'); ?>        Banconote da 5        <input type='text' name='cinqueuro' value='<?php echo $cinqueuro ;?>' />        <input type='submit' value='save' />     </form>
Valore banconote da 5 =  <?php $tot5 = ($cinqueuro*=5);echo $tot5 ;?>€
      It works and let me see the result but only after clicking on save button. What I need is that each time a value is inserted inside the form it is Automagically saved in DB and operation is done. My PHP code is basically taken from this answer: Front-end update_post_meta snippet displays white screen?


title: Dynamic body classes based on current page

text: Is there a way to add classes to the `body_class` function based on the current page? For example if you're on the homepage, as well as the usual generated classes, the `<body>` element would also have `front` and `main-page` classes. Then if you were on the "About" page it would have `inner-page` and `sixcol` classes instead. I (unsuccessfully) tried this;               function body_class_variants($variants) {          if (is_home() || is_front_page()) {         $variants = 'front main-page';     } else {         $variants = 'inner-page sixcol';     }     return $variants;          add_filter('body_class','body_class_variants');      which was based off this function that I use to output the page name into the body class               function body_class_names($classes) {     global $post;     $name = $post->post_name;     $classes[] = $name;     return $classes;     }          add_filter('body_class','body_class_names');      But to no avail. Any help would be greatly appreciated.


title: Show media url immediately after upload in media uploader

text: do anyone know a plugin OR override to show the image url immediately after upload - in the media uploader (so not via post/ page-upload) ? Now it's like -> upload -> edit -> right side is the url I would like to skip the -> edit-click. Sometimes I just upload images to use the url in Widgets/ Custom fields... Thanks in advance.


title: Adding comments section to website integrated WordPress instance

text: We've integrated a WP instance into our website, and I was wondering how to render the comments template into the page. I've tried simply adding:                   comments_template( '', true );      But it doesn't seem to work (also there are no errors shown). I guess we are missing some includes and inits. Any help would be appreciated.


title: How to have different content in the loop and single

text: http://css-tricks.com/video-screencasts/ Try to look at this famous site which also powered by wordpress. The content in the loop is different from the single post. It use "dl" element in loop, but not main content in the single post. It something like it has a another brief summary of a post that will only display in loop. So my trouble is how to display something(include image,article,video embedding) in the loop of multiple post but not display in single post itself, and vice versa.


title: Multilingual theme: Changing locale based on URL

text: I'm developing a multilangual theme. I use the __() function for translation, which works just fine. The main language is English, but the second language is German. For that second language, I'd like to add an "/de/"-Slug, so I created a rewrite rule:               function rewrite_rule_de(){         add_rewrite_rule('de/(.+?)/?$', 'index.php?pagename=$matches[1]&language=de', 'top');     }     add_action('init', 'rewrite_rule_de');      As you can see, I also added a get-variable (language=de), which should tell Wordpress, that the page being displayed is German. Because Wordpress doesn't simply process this get-variable, I added it to query_vars:               function language_query_var($public_query_vars){         $public_query_vars[] = 'language';           return $public_query_vars;       }     add_action('query_vars', 'language_query_var');      I want to change the locale, based on the language of the page beeing displayed, so I use the following function:               function set_my_locale( $lang ){       if ('de' == get_query_var('language')){         return 'de_DE';       }else{         return 'en_US';       }     }     add_filter('locale', 'set_my_locale');      My problem here is that get_query_var('language') isn't defined in the function "set_my_locale". But it works when used before the loop, for example... So my question is simply: How can I change the locale (so that the __()-function outputs the proper language) based on a rewrite-rule?


title: How to remove the Tools menu item from the WP-Admin menu

text: Where is function.php is stored and built? I want to remove menu named as tools from mysite from all user like admin and other user's? I Request you please help me out from this problem.Give me the best solution like lay-man to wordpress so that i can understand things quickly.


title: How to reverse engineer the Twenty Eleven background image uploader?

text: I'm searching through the twenty-eleven theme's source files (functions.php and theme-options.php) attempting to get some clues on how to implement the upload utility found on several of the theme options pages. However, I can't find any reference to it. Anyone know which file its contained in?


title: next page with custom post

text:
I want to be able to show the older entries for my custom post but I cant get it to work. The problem is that it won't display the next and previous links. I have also tried with `posts_nav_link();` This is my current code.               <?php             $args = array(                 'post_type'         =>  'category-vote',                 'posts_per_page'    =>  5,                 'paged'             =>  $paged,             );                  $vote = new WP_query($args);             if ( $vote->have_posts() ) :             while($vote->have_posts()) : $vote->the_post();         ?>            <a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
             <?php the_content(); ?>             <a href="<?php the_permalink(); ?>"><?php comments_number('Inga kommentarer', 'En kommentar', '% kommentarer'); ?>             <?php if(function_exists('the_ratings')) { the_ratings(); } ?>
          <?php endwhile; ?>                   <?php previous_posts_link('Newer') ?>             <?php next_posts_link('Older ') ?>              <?php endif; ?>


title: Unable to run wordpress site in WebMatrix after database credential change (db_name, db_user, db_password)

text: Well, I assumed this would be much easier. I set up wordpress using the Web Platform Installer. It ran with the database it automatically created for me (DB_NAME: wordpress960, DB_USER: wordpressuser960, DB_PASSWORD = 'tc?x#t09DRZe'). I attempted to switch the DB_NAME, DB_USER, DB_PASSWORD parameters to the database I had created previously (complete with user tested for full privileges), but now I am unable to run the site. DB_HOST & DB_HOME are both pointing to localhost, even in the database. I noticed under the "Databases" tab in WebMatrix that I am unable to delete the old database connection, even after creating a new connection to the new database under "other connections." WHY on Earth am I unable to run in WebMatrix after these changes?? Thanks in advance!


title: Display Custom Posts

text: I have created custom posts with the name "review". From WP admin i can create these custom posts. But to display them at user side i am facing a problem. As i am developing plugin i don't want create a template in theme. This is code i used to display the custom posts. But it is showing 404 template.               function review_template_function($template_path){     global $post;     if(get_query_var('post_type') == 'review'){         if(is_single()){             if(file_exists(plugin_dir_path(__FILE__).'review-preview.php')){                 $template_path = plugin_dir_path(__FILE__).'review-preview.php';             }else{                 $template_path = plugin_dir_path(__FILE__).'review-preview.php';             }         }     }     return $template_path;     }       add_filter('template_include','review_template_function');


title: Recent Posts Listed by Author, Can I exclude authors?

text:
I'm working on a multi-author blog, and I'm trying to produce an authors list with recent posts like this page (site is drupal): http://www.internationalrivers.org/blogs I'm working on a draft here: http://nape.kevinmgibbons.com/authors I want to exclude admin, ira, and ivan (users 1,3,4). Here is the code I've pieced together:                   <?php         $authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts);         if($authors):         foreach($authors as $author):        ?>

         <?php if(get_the_author_meta('description', $author->post_author)): ?>
                 <?php echo get_avatar(get_the_author_meta('user_email', $author->post_author), 80); ?>
         <?php endif; ?>

         <div class='author' id='author-<?php the_author_meta('user_login', $author->post_author); ?>'>
<?php the_author_meta('display_name', $author->post_author); ?>
                   <?php if(get_the_author_meta('description', $author->post_author)): ?>

<?php the_author_meta('description', $author->post_author); ?>

          <?php endif; ?>          <?php         $recentPost = new WP_Query('author='.$author->post_author.'&showposts=4');         while($recentPost->have_posts()): $recentPost->the_post();     ?>

         <li class="blogbyauthor" id="post-<?php the_ID(); ?>">             <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
              <?php the_time('F jS, Y') ?>

          <?php endwhile; ?>          <?php if(get_the_author_meta('twitter', $author->post_author) || get_the_author_meta('facebook', $author->post_author) || get_the_author_meta('linkedin', $author->post_author) || get_the_author_meta('digg', $author->post_author) || get_the_author_meta('flickr', $author->post_author)): ?>     <?php endif; ?>

          <?php endforeach; endif; ?>      Two questions:   1. How can I exclude users 1,3,4? I've tried a lot of methods from other posts.   2. Is there a better/cleaner way to do what I'm trying to do? I'm a bit of a newb when it comes to Wordpress PHP, so I appreciate any help you can give.


I'm getting this error in a log file created by WooCommerce "The SSL certificate for the host could not be verified." The error is being generated by WordPress' file `/wp-includes/class-http.php` http://hookr.io/3.8.2/classes/wp_http_streams/ I've tried setting the below in my functions file to disable SSL verification, but i'm still getting the error               add_filter( 'https_ssl_verify', '__return_false' );     add_filter( 'https_local_ssl_verify', '__return_false' );      On line 834 of `class-http.php` I tested changing this line `$connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host;` To `$connect_host = $secure_transport ? 'sslv3://' . $connect_host : 'tcp://' . $connect_host;` The change is **sslv3** I need this for connecting to authorize.net. Is there a filter I can use, to override the method in the class, if so which? I know enough to not modify core code, this was only for testing. Thanks


title: Custom post type navigation on static page

text: I'm using the following code on a WP3.9 site to show a bunch of custom post types with pagination on a static page set as the frontpage:               $args = array(         'post_type' => 'movie'     );     $paged = (get_query_var('page')) ? get_query_var('page') : 1;     $wp_query = new WP_Query( array_merge( $args, array('paged' => $paged) ) );      The first page is showing the correct info, but when I go to **domain.com/page/n/** I get redirected to **domain.com**. If I add the following code to the functions.php file:               function disable_redirect_canonical( $redirect_url ) {         $redirect_url = false;         return $redirect_url;     }     add_filter('redirect_canonical','disable_redirect_canonical');      Then I can go to **/page/3/ and greater** , but **/page/2/** still redirects to the main page. I'm really lost about this and I'm not really sure where to look to fix this problem. Any help would be appreciated


title: How do I build a settings panel under the plugin

text: I'm trying to build a settings panel for my plugin that is located under the plugin on the plugin page and slides down when the user clicks the settings link like other plugins (WP Maintenance Mode) do. They look like this: ![Screen top](http://i.stack.imgur.com/U0Zsg.png) ![Screen bot](http://i.stack.imgur.com/bSl8s.png)   I tried to read the plugin code but didn't really understand it because its a bit to complex for me as a beginner. Is this a normal wordpress function or is it extra implemented?


title: Inserting current user ID into Post for Author

text: I am trying to insert the `user id` of the current user when creating a `custom post type`. This is my code:               $my_post = array(                 'post_title' => $orderRequestCode.' - ' . $customerName,                 'post_content' => $orderContent,                 'post_status' => 'draft',                 'post_author' => $user_ID,                 'post_type' => 'orders'             );          wp_insert_post( $my_post);      I get a reference to the user as well: `$user_ID = $user->ID;` However, it is not inserting anything into the Author field when I Check on the `back-end`. Does anyone know where I am going wrong?


title: Allow only new sub-pages to be created

text: Here is an amazing solution to restrict the creation of new parent pages, and I would want to use it, but the newly created sub-pages are saved only as drafts and this was not solved (see last comments at mentioned link). The problem is that this code always saves the page as `Draft` and I have no idea how to solve this:               add_action( 'admin_head-post-new.php', 'wpse_59770_publish_admin_hook' );     add_action( 'admin_head-post.php', 'wpse_59770_publish_admin_hook' );     add_action( 'wp_ajax_wpse_59770_pre_submit_validation', 'wpse_59770_ajax_pre_submit_validation' );          function wpse_59770_publish_admin_hook()     {         global $current_screen;         if( 'page' != $current_screen->post_type )             return;              ?>         <script language="javascript" type="text/javascript">             jQuery(document).ready(function() {                 jQuery('#publish').click(function()                  {                     var form_data = jQuery('#parent_id').val();                     form_data = ( '' != form_data ) ? '1' : '0';                     var data = {                         action: 'wpse_59770_pre_submit_validation',                         security: '<?php echo wp_create_nonce( 'pre_publish_validation' ); ?>',                         form_data: form_data                     };                     jQuery.post(ajaxurl, data, function(response)                      {                         // OK, save page                         if (response=='true') {                             jQuery('#ajax-loading').hide();                             jQuery('#publish').removeClass('button-primary-disabled');                             jQuery('#post').submit();                         }                         // Not OK, display alert message                         else                         {                             alert(response);                             jQuery('#ajax-loading').hide();                             jQuery('#publish').removeClass('button-primary-disabled');                             return false;                         }                     });                     return false;                 });             });         </script>         <?php     }               function wpse_59770_ajax_pre_submit_validation()     {         //simple Security check         check_ajax_referer( 'pre_publish_validation', 'security' );              // Parent is set, no further action         if( '1' == $_POST['form_data'] )         {             echo 'true';              die();         }              $args = array( 'post_type' => 'page', 'post_parent'=> 0, 'numberposts' => -1 );         $parents_total = get_posts( $args );              // Total parents is less than 9, no further action         if( count($parents_total) < 9 )         {             echo 'true';              die();         }         // No more parents allowed         else         {             $error = "No more Parent Pages allowed";                echo $error;              die();         }     }


title: wp_insert_post() inside save_post(): force WP to not update global post object?

text: I wrote a custom plugin which inserts another metabox on the edit post screens. Once the user saves or publishes an article, I want to create another post with a custom post_type, which works great. However, data from other metaboxes are saved with the post_id of my newly created custom-typed-post instead of the original post. I suspect this is due to wp_insert_post() updating the global $post object with the post_id the function just generated. But how can I make sure this does not happen? How to make sure, e.g. all other plugins also using the save_post hook save their data correctly to the right post instead of my custom-type-post created by wp_insert_post()?               add_action('save_post', array(&$this, 'save_post'), 1, 1);          public function save_post($post_id) {                      // verify if this is an auto save routine.                  // If it is our form has not been submitted, so we dont want to do anything                 if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){                     return;                 }                           if($_POST['post_type'] == self::POST_TYPE && current_user_can('edit_post', $post_id))                 {                          $newContestAdded = false;                          $_STBKT_assignedContestHopper = get_post_meta($post_id, '_STBKT_assignedContestHopper', true);                     if (($_STBKT_assignedContestHopper=='' || $_POST['STBKT_quickcontest_contestID']=='')                              && get_post_type($post_id) == 'post') {                          // Create contesthopper post object                         $CH_post = array(                           'post_title'    => '',                           'post_content'  => '',                           'post_status'   => 'publish',                           'post_author'   => 1,                           'post_type'     => 'contesthopper'                         );                              $_STBKT_assignedContestHopper = wp_insert_post( $CH_post, $wp_error );                     }                 }     }


title: How to insert multiple postmeta values with one query?

text: I have a custom script/plugin I am using for myself that creates a post along with some postmeta information. Right now, I have multiple `$wpdb->insert`, but I would like to condense this down into one query. How would I do this? Here is my current code:               $meta_table = $wpdb->prefix . 'postmeta';              $wpdb->insert(          $meta_table,          array(              'post_id' => $post_id, // Already defined             'meta_key' => 'client-pwd',             'meta_value' => $post_pwd // Already defined             )             );            $wpdb->insert(          $meta_table,          array(              'post_id' => $post_id,              'meta_key' => 'gallery-status',             'meta_value' => 'private'             )             );            $wpdb->insert(          $meta_table,          array(              'post_id' => $post_id,              'meta_key' => 'meta-description',             'meta_value' => 'Description...'             )             );            $wpdb->insert(          $meta_table,          array(              'post_id' => $post_id,              'meta_key' => 'can-purchase',             'meta_value' => 'yes'             )             );            $wpdb->insert(          $meta_table,          array(              'post_id' => $post_id,              'meta_key' => 'can-email',             'meta_value' => 'yes'             )             );            $wpdb->insert(          $meta_table,          array(              'post_id' => $post_id,              'meta_key' => 'can-download',             'meta_value' => 'yes'             )             );


title: Checking if an attribute exists in a shortcode

text: I've written a small plugin that spits out html for a button. It works great, except for one thing: If the user doesn't specify an image, the image appears broken. Is there a way for me to check and see if the user has specified an image, and only print the image code if that's the case? Here's my plugin code:               function button_shortcode($args) {         return "" . $args["smalltext"] . "" . $args["bigtext"] . "";     }     add_shortcode("button", "button_shortcode");      Here's the shortcode: `[button url="http://www.example.com/" img="/path/to/image.png" smalltext="Smaller Text" bigtext="Bigger Text"]`


title: Use WordPress' URL rewrite engine

text: I'm developing a web application with user submissions, i'm not too hot on mod-rewrite and was hoping there is a way to utilise WordPress' amazing rewrite engine and incorporate this somehow into my PHP/AJAX web application?


title: Search Using Post ID

text: I'd like to be able to enter a post ID into the search box in order for the exact post to be returned in the search results. I'd also like to retain the ability to search the posts/page titles and content. eg, user enters '#123' in the search box, and the search results return just post 123. However, if I were to enter '123' into the search box, it would return any post/page that contains '123' in the content or title. This article explains how to achieve what i'm after within the Admin - I just need the equivalent for the front-end! Any help is greatly appreciated, thank you.


title: query custom post type and order by most comments within one week

text: Hi I'm having a lot of trouble with my custom query... I had it working just fine, displaying all posts of a custom post type and ordering them by most comments within a single week. But since I installed the plugin "Newsletter", it is no longer working, it doesn't display ANY posts... Here is the code that was working before:               /* QUERY */              $week = date('W');         $year = date('Y');              query_posts('post_type=articles&posts_per_page=$number_posts&orderby=comment_count&ignore_sticky_posts=1&meta_key=_thumbnail_id&order=DESC&year=' . $year . '&w=' . $week);          /* LOOP */ ...      I think one of the variables may be interfering with the Newsletter plugin somehow, because when I change the query back to this it works just fine (though only shows the most commented posts of all time):               /* QUERY */              query_posts(array('post_type' => 'articles', 'posts_per_page' => $number_posts, 'orderby' => 'comment_count', 'ignore_sticky_posts'=>1, 'meta_key'=>'_thumbnail_id'));          /* LOOP */ ...      What should I try next? Is there a better way to do this, a way that won't conflict with anything else? I have seen a few other methods for displaying posts by most comments within a single week, but I don't understand how to implement them. Please help! This is the last thing I need to finish and then I'm done with my site. Thanks in advance...


title: Localize tinymce in WordPress 3.9?

text: Still stucked with this localization of tinymce. Find this resource here : codex. Does not seem to work anymore. How do you do this? Any help would be much appreciated.


title: not empty categories don't show in menu

text: I'm trying to resolve a problem i have showing category posts. I have added a category to my main menu, eventhough it has posts - in the basic theme it doesn't show, in my theme - it shows as a link but when i click on it, shows just a blank page. I tried resetting the permalinks, clearing the cache... nothing. Does anyone have an idea what the problem might be. I'm getting a bit desperate. Any help will be greatly appreciated. Thanks a lot in advance


title: Remove category from query (show all posts in archive.php) pre_get_posts()

text: I am using `pre_get_posts()` to allow all posts to be displayed on any category archive. This is because I will provide a javascript sorting and filtering method using isotope.js. Any category page will output all posts, but any that aren't a part of that category will initially be hidden.               function show_all_cats( $query ) {         if ( !$query->is_main_query() ){             return;         }         if ( is_admin() ){             return;         }         if ( $query->is_archive ) {             $query->set('cat', ''); //here is the problem             var_dump($query);             return;         }         return;     }     add_action( 'pre_get_posts', 'show_all_cats' );      I have tried setting `'cat'` to `0`, `null`, `''` and `'-' . $currentcategoryid`. They all either display only posts that would be displayed otherwise (all in category) or none. I tried using `query_posts()` which also didn't work. I was also told: > manipulating taxonomies might require re-running meta queries processing.


title: Query Posts oder by Date

text: my query does not work as it should. This is my Code:               wp_reset_query();     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args  = array(                     'post_type'     => 'post',                     'paged'         => $paged,                     'orderby'       => 'date',                     'order'         => 'ASC',                     'posts_per_page'    => 5                     );     $the_query = new WP_Query( $args );     if ( $the_query -> have_posts() ):         while ( $the_query -> have_posts()) :              $the_query-> the_post();             the_title();         endwhile;     endif;      The posts are not ordered by date. What could be the issue?


title: Translate wordpress plugin

text: Below is a small tutorial of translation from English To German. (You can change the it as your needs). in any plugin file, it has unique name in its header.               /*     Plugin Name: SampleTut     .......     */      in that plugin folder, make a folder (named "languages"); into your plugin .php file (somewhere in top), insert this initialisation code:               class load_my_language      {         public function __construct()         {         add_action('init', array($this, 'load_translat'));         }               public function load_translal()         {             load_plugin_textdomain('SampleTut', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');         }     }          $ggg = new load_my_language ;      then open new text file and insert this code: (Now, we only make two messages, "helo" and "bye". You can insert as much as you need).               # English translations for PACKAGE package.     # Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER     # This file is distributed under the same license as the PACKAGE package.     # Automatically generated, 2012.     #     msgid ""     msgstr ""     "Project-Id-Version: SampleTut 1.1\n"     "Report-Msgid-Bugs-To: \n"     "POT-Creation-Date: 2012-11-11 21:33-0400\n"     "PO-Revision-Date: 2013-11-21 12:33+0400\n"     "Last-Translator: Automatically generated\n"     "Language-Team: none\n"     "MIME-Version: 1.0\n"     "Content-Type: text/plain; charset=utf-8\n"     "X-Poedit-SourceCharset: iso-8859-1\n"     "Content-Transfer-Encoding: 8bit\n"     "Plural-Forms: nplurals=2; plural=(n != 1);\n"     "X-Generator: Poedit 1.5.4\n"               #: myplugininfile.php:47 (this is a note line)     msgid "mymessage1"     msgstr "Hello"          #: myplugininfile.php:48     msgid "mymessage2"     msgstr "Bye"      save this file and name it "SampleTut-en_US.po" (note, that .po should be an extension of the file, and not .po.txt) download the software: POEDIT, and open that file and Press CTRL+S and thus, the program automatically generates the second functional .mo file ( If it doesnt generate the .mo file automatically, then edit preferences.); Then shutdown the program, and reopen the file again. Make your translations in "translation" fields, and after you finish, click SAVE AS and save the file as "SampleTut-de_DE" Now, the two German files will be generated. then put those two English and two German files into "languages" folder. Then, open wp-config.php and from default(English):               define ('WPLANG, '');      change to               define ('WPLANG, 'de_DE');      (This means, that we changed our wordpress main language. then worpdress will read our language file, with prefix -de_DE) so, now open your plugin's .php file, and where you have any echo-ed word:               echo "Something";      change to :               echo __("mymessage1", 'SampleTut');      or the same as echo:               __e("mymessage1", 'SampleTut');      And thus, the wordpress shows you the appropriate translation for that id (mymessage1). references:   codex.wordpress.org/I18n_for_WordPress_Developers   codex.wordpress.org/Translating_WordPress   codex.wordpress.org/Writing_a_Plugin   codex.wordpress.org/Installing_WordPress_in_Your_Language


title: Why 'Authorization Required' is coming on wordpress login

text: When i try to login to my WordPress blog admin why this pop up error come ..               "Authorization Required"      http://stpatrickscollege.edu.pk/wp-login.php


title: How do you modify Page Template?

text: Do I just go to Appearance->Editor and then pick the template and modify the PHP code directly, or is there a more "non-coding" way of doing it? I'm using a theme with a contact form, and the whole contact form code is in the template, and the edit page window just shows up blank. All the code is in the template.


title: Invalid argument supplied in register_taxonomy $args->taxonomies

text: I have capabilities assigned in my `register_post_type()`. Then, I implemented taxonomies on my plugin. Where the $args in taxonomy are as follows:               $args = array(       'label'=>'Partner Type',       'labels' => array(         'name' => __('Partners'),         'singular_name' => __('Partner Type'),         'menu_name' => __('Partner Types'),         'all_items' => __('All Partner Types'),         'edit_item' => __('Edit Partner Type'),         'view_item' => __('View Partner Type'),         'update_item' => __('Update Partner Type'),         'add_new_item' => __('Add New Partner Type'),         'new_item_name' => __('NEw Item Type'),         'parent_item' => __('Parent Type'),         'parent_item_colon' => __('Parent Partner Colon'),         'search_items' => __('Search Partner'),         'popular_items' => __('Popular Partner Type'),         'separate_items_with_commas' => __('Separate partner types with commas'),         'add_or_remove_items' => __('Add or Remove Partner Types'),         'choose_from_most_used' => __('Choose from Most Used Partner Type'),         'not_found' => __('Partner Type Not Found'),       ),       'hierarchical' => true,     );      register_taxonomy('partner_taxonomies', 'partners',$args); $args in `post_type` contains:               'taxonomies' => 'partner_taxonomies',      Then, I get the error > Invalid argument supplied for foreach() in /var/www/html/stecLive/wp- > includes/post.php on line 1346 Where the code says:               foreach ( $args->taxonomies as $taxonomy ) {       register_taxonomy_for_object_type( $taxonomy, $post_type );     }      I don't see 'taxonomies' as one of the arguments in `register_taxonomy()`. How would you use or supply an array for 'taxonomies'? Or in other words, what am I doing wrong?


title: Show all terms in a custom taxonomy with all child terms wrapped in a ul

text:
Is there a way that I can list all the terms within a custom taxonomy in an unordered list and wrap all child terms in another unordered list? For example;

Parent 1

             Parent 2

Child of Parent 2

Child of Parent 2

Child of Parent 2

Parent 3


title: 3.5.x Theme Customize: Handling Custom Control Requests

text: I am extending the WP_Customize_Image_Control as a means to include an upload- able word mark for a site. The control works just fine, but I need to do some post process handling on the image (i.e. check image dimensions, file type, etc...). In other words I need to validate the upload. Is there an event listener in the javascript of the API, that I can override, in order to do this?


title: How to add 'Insert HTML Table' button to TinyMCE in admin?

text: I am trying to figure out how to change the default buttons on the TinyMCE editor in the Wordpress admin. Specifically, I would like to provide an 'insert table' button. How do I do that?


title: Is there a way of storing posts and pages under the same hierarchy?

text: I'm working on a site which needs to have pages and posts sorted into the same categories. The pages have their own individual hierarchy structure. Is there a way to do this using a custom taxonomy?


title: Logout redirects to /forums/

text: A while back I installed a plugin which, upon logout, re-directed users to `/forums/`. Unfortunately, I have no idea which plugin that was and whether or not it's still active/installed. What code/db settings can I look for to remove the offending code? Thanks in advance,


title: Saving multiple fields as array

text:
I'm adding a settings section to a theme that will allow the user to enter testimonials which will be randomly displayed on the site. Each testimonial has 2 fields, `author` and `testimonial`, I've registered my settings as below:               register_setting( 'settings-website', 'option_testimonials', 'save_testimonials' );      And I want to store an array within that option like this:               array(3) {       [0]=>       array(2) {         ["author"]=>         string(8) "Person A"         ["testimonial"]=>         string(14) "Great website!"       }       [1]=>       array(2) {         ["author"]=>         string(8) "Person B"         ["testimonial"]=>         string(15) "Excellent work!"       }       [2]=>       array(2) {         ["author"]=>         string(8) "Person C"         ["testimonial"]=>         string(10) "Brilliant!"       }     }      My options form looks like this:               <?php     $testimonials = get_option('option_testimonials');     if( !is_array($testimonials) )         $testimonials = array();     ?>

Testimonials
     <form method="post" action="options.php">         <?php settings_fields( 'ddtheme-settings-testimonials' ); ?>
             <?php foreach( $testimonials as $testimonial ) { ?>
             Testimonial
             <?php } ?>
             New testimonial	                              Author:
                 <input type="text" name="author" style="width: 400px;" />
                 Testimonial:
                 <textarea name="testimonial" style="width: 400px;"></textarea>

         <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
     </form>
      So I thought I could grab the input from the `author` and `testimonial` fields inside `save_testimonials`, combine them into an array and append that to the existing array and save but the `$_POST` and `$_REQUEST` are both empty inside that callback. How can I do this?


title: Getting 404 on taxonomy page

text:
i've created a custom taxonomy template for my taxonomy and custom post type, custom post type name is "ecommerce" custom taxonomy is "ecommerce_categories", the problem is with the pagination it shows correctly that there are 2 pages with posts inside it but when i click on page 2 i get 404 page, this happens only when i'm on the taxonomy page, i've also created a custom page template that does the same as the taxonomy file and the pagination works here (on the custom page template) the problem is only when i'm on the taxonomy category page. This is the code of the file taxonomy- ecommerce_categories.php               <?php              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;             $term = $wp_query->queried_object;                  $shop_loop = new WP_Query( array( 'post_type' => 'ecommerce', 'ecommerce_categories' => $term->name, 'posts_per_page' => 2, 'orderby' => 'menu_order', 'paged'=>$paged ) ); ?>                  <?php while ( $shop_loop->have_posts()  ) : $shop_loop->the_post(); ?>                          // here is my loop code with divs links etc.. etc...                  <?php endwhile;?>

             <?php if(function_exists('wp_pagenavi')) { wp_pagenavi( array( 'query' => $shop_loop ) ); } ?>      I see the pagination but when i click on page 2 or page 3 i get 404 error page this happen with any permalink setting and also if i change the pagination from the wp pagenavi plugin to the wordpress default one using this code               <?php wp_link_pages(); ?> or previous_post_link and next_post_link       i can't see it nothing is displayed below posts. How can i fix this ? what i'm doing wrong ?


title: Custom menu styling

text: I'm trying to style a custom menu here so that I can let other people manage this site alongside myself. What I'm trying to do is remove the text for the top level links while leaving the `a` as a block so the links are clickable, however when I try and remove the text using `text-indent: -999em;` (which I know isn't the neatest way of doing it) it recurses down the menu and hides all the the other links. Can anyone suggest any neat ways of hiding the text?


title: Bar separated navigation by extending Walker_Nav_Menu

text: I have the following menu in my header:               <?php     $args = array(         'menu'            => 'Main Menu',         'container'       => false,         'depth'           => 1,         'items_wrap'      => '%3$s',         'walker'          => new Bar_List_Walker_Nav_Menu     );     wp_nav_menu($args);     ?>      and I want to make the output look like this:               link1 | link2 | link3 | link4 | link5      So I set out to make a walker function here is where I got to:               class Bar_List_Walker_Nav_Menu extends Walker_Nav_Menu {         public $count;         function start_lvl(&$output, $depth) {}         function end_lvl(&$output, $depth) {}         function start_el(&$output, $item, $depth, $args) {             $attributes = ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';             $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';                  $item_output .= '<a'. $attributes .'>';             $item_output .= apply_filters( 'the_title', $item->title, $item->ID );             $item_output .= '</a>';                  $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );         }         function end_el(&$output, $item, $depth) {             static $count;             $count++;             if(!$this->count >= $count) {                 $output .= " | ";             }         }         function walk( $elements, $max_depth ) {             $this->count = count($elements);             parent::walk( $elements, $max_depth );         }     }      This outputs the following error:               Warning: Missing argument 4 for Bar_List_Walker_Nav_Menu::start_el() in C:\xampp\DEV\Stace\trunk\wp-content\themes\philosophy\functions.php on line 100      If I remove the function `walk()` from my walker class it works fine except the count is no longer grabbed and as a result one `|` too many is added to the end of my navigation. Can anyone work the code to get to my desired output?


title: Hide active themes on multisite subdomains

text: Is it possible to hide the active themes in a network so that the subdomain users won't see them as being available? The problem is that i have 10 themes installed on the network and the subdomain users see the ones not assigned to them under Appearance -> Themes, and activate other themes. I am trying to remove this capability for the subdomain administrators. Thanks.


title: Need Category RSS Feed that shows all posts

text: How do I go about making this? I've been trying to get add_feed and such but have had no luck.


title: Advanced Custom Fields WYSIWYG More tag

text: Before describing the problem, let me first tell that I have already searched on google, also read the ACF documentation, support, even asked on their support forum but it's hard to get any kind of answer there. So the thing is I have this wysiwyg on a custom post type I made where I have an item description, I really don't want to use the wp default editor because I designed a structure on the post to be more user friendly. The problem comes when I add the tag to the field, it will not work as the_content('Read More') for example, I have tried to find out but failed. I'm using the               <?php     global $more      $more = 0;     ?>      but then if I want to use like for example:               <?php the_field('the_field_name','Read More')?>      it will not show the More tag. What can I do to display it?


title: Lessphp auto-compiling issue in WordPress

text: I'm using Lessphp to auto compile my style. After reading the document ( http://leafo.net/lessphp/docs/#compiling_automatically ) and some research, I got this code:               function autoCompileLess() {          // include lessc.inc     require_once( get_template_directory().'/library/lessc.inc.php' );          // input and output location     $inputFile = get_template_directory().'/library/less/style.less';     $outputFile = get_template_directory().'/library/css/style.css';          // load the cache     $cacheFile = $inputFile.".cache";          if (file_exists($cacheFile)) {         $cache = unserialize(file_get_contents($cacheFile));     } else {         $cache = $inputFile;     }          $less = new lessc;     // create a new cache object, and compile     $newCache = $less->cachedCompile($cache);          // output a LESS file, and cache file only if it has been modified since last compile     if (!is_array($cache) || $newCache["updated"] > $cache["updated"]) {         file_put_contents($cacheFile, serialize($newCache));         file_put_contents($outputFile, $newCache['compiled']);       }     }          if(is_admin()) {         add_action('init', 'autoCompileLess');     }      It works at the beginning. But the next day, when I open my website. the style was gone. The output file(CSS) was empty and the cache file has only one character inside(N;). It seems like even if there is nothing change in the LESS file (input file), the program still saves the cache which is empty and compiles it to CSS. I tried to re-compile the LESS file to CSS, and it worked. But when I re-open my website, this happens again. How can I fix it?


title: Best practice to include custom user styles in widgets

text: What's the best way to include custom user styles in widgets? For example adjust colors for buttons, borders etc. without having the user to develop a complete new stylesheet.


title: Function to list all post slugs for every post in my WP database?

text: Function to list all post slugs for every post in wp_posts table? I assume there's an official function to generate a post slug, but maybe someone here already has the answer.


title: Hook to See if Comment got a Reply?

text: Okay I know the title is pretty vague but I didn't know how to articulate it. Basically, I want a plugin that sends email notifications to users who opted- in **only if** they specifically got replied to. WordPress has its built-in functionality for comment threading/replying, so instead of bombarding the user with emails each time a new comment is posted on a post they've subscribed to, I'd like to give them the option to only be notified when they specifically get replied to. I can develop this myself if need be, in fact, a preliminary search yielding no results seems to point at this. My question is, what hooks would I take a look at? Looking at other notifier plugins, I see they make use of `comment_post` and others which I can come up with myself. More specifically, how would I go about knowing if user x got a direct reply? I understand how the subscription system and all of that would work, my only concern is how to tell if a subscribed user received a direct reply through the built-in commenting system.


title: How do I remove dashboard access from specific user roles?

text: I'd like to prevent certain user roles from accessing the dashboard http://www.openeye.net/wp-admin/ at all. I've moved and restyled user profiles to a new page that's viewable on the site. How would I go about doing this?


title: The Events Calendar - Datepicker not working

text: The dropdown datepicker is throwing a not found error. I am not sure if this is a 3.2 issue or not, because I did not install this plugin until after the 3.2 release, but I know the datepicker is a jQuery function, so it might be. You can view the error here: Sample error for datepicker choice of August, 2011: http://hammondmarina.com/wp/category/events&eventDisplay=month&eventDate=2011-08 (Select the "Events Calendar" from the main menu to get to the grid. New here so I can't post more than 2 links in this post.) The forward and backward links are working fine. I discovered that when you substitute the "&" with a "?" after category/events, the link will work: http://hammondmarina.com/wp/category/events?eventDisplay=month&eventDate=2011-08 How do I fix this in the the-events-calendar/views/datapicker.php file or the template-tags.php file (where references to the datepicker both occur)? Thanks in advance for any help.


title: Advanced custom fields: Customise date picker's start date (need to choose year 1500 onwards)

text: In Advanced custom fields, I would like to customise the date picker so that, ideally, I can only select a year in the 1500s/1600s but at the very least allow the datepicker to go back to the 1500s. At present it only goes to 19 something. Would anyone know how I'd implement this?


title: Adding a cover image to video shortcode

text: I'm looking for a way to allow the user to add a cover image (a.k.a. thumbnail) to an internal video, uploaded to WordPress and embedded with the shortcode [video]. So far everything I came up to is adding or changing thumbnails to external videos. Any ideas of appropriate hooks, plugins doing something similar or just advice on how to approach the problem are welcome!


title: Adding another word in front of post url

text: I have a wordpress website with bunch of posts. My problem is that I need to change the URLs from               website.com/post-name      to               website.com/specialword/post-name      The "specialword" is what I need to add in front of those post names, but ONLY for the post type - posts. Can someone help me? I need this badly, mostly because of the SEO purposes so I can keep the URLs from the previous website that wasn't done in wordpress. Thank you! Slavisa


title: Problem with guids and absolute links

text: Post and page guids include the full absolute URL of my site (e.g. http://www.example.com/wordpress/?p=1). This causes a problem if the domain, or wordpress path changes, or if I'm viewing the site via its IP address rather its domain, etc. Problem 1: there are some internal links on my site that are using the guid. I'm guessing this is _wrong_ and I should rewrite the template code to remove references to the guid - correct? Problem 2: images are inserted into a post using their absolute URL, rather than a relative one. This seems short-sighted, but I'm wondering if there's a reasonable reason for that. Is there a way to change that behaviour?


title: Fast worpress backup/clone

text: i have a problem with 2 websites. I have for example `site1.com` `site2.com` How can i make a perfect clone of site1.com for site2.com? i mean i want a method that i can do this in minutes, not changing the database, delete it, create it once more, copy ... etc The clone must be exacly the same, except the domain,mysql, files including folders, images, comments, everything.


title: Showing the user's username in registration email or activation page with BuddyPress

text: a) I would like the person's username to be included in their activation email once they have registered. e.g. Activation email would look like: Thanks for registering! To complete the activation of your account please click the following link and log in using _USERNAME_ and password you chose: _activation link url_ Or if that is not possible. b) If it is easier to display it on the page once the activation link has been clicked in the email, I would like to show the person's username there. e.g. Activation page: Your account was activated successfully! You can now log in with the username _USERNAME_ and password you provided when you signed up.


title: Adding wp_link_pages to a theme that seems to lack?

text: I'm using wp-bootstrap as basis to build out a custom site. The wp_link_pages function doesn't seem to work and I'm thinking maybe it's just missing from the theme. I've got a code in a page and the template it's using has in it but it's not working. I'm thinking maybe this functionality was stripped out of the theme. Wondering how to put it back if this was the case. I did a search through all the theme files for wp_link_pages thinking I might find where it was declared but don't see it anywhere.


title: Getting WordPress to work inside a rails 3 application

text: I am migrating an existing WordPress blog into a subdirectory of a new rails 3 app (deployed on Apache2 / Ubuntu 10). I have PHP/MySQL installed, and I have a standard rails app folder structure in the production env:               /var/www/railsapp/public/      Inside `/public/`, I want to copy the Wordpress files into `/home/blog/`, so:               ../public/home/blog/-wp stuff-      I've already migrated all the files as well as the database, and updated wp- config.php per the directons given in the Wordpress codex. However, when I try to access the blog: (`www.example.com/home/blog`), I get a 403-forbidden message. I've already ensured my vhost config is setup correctly (I can access the rails app without issue) and the http.d directive is as follows:               <Directory /var/www/railsapp/public/>         Options +FollowSymLinks         AllowOverride all         Order allow,deny         Allow from all     </Directory>      Is there something I'm missing? My `../home/blog/.htaccess` file is also correct (I believe):               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /home/blog/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /home/blog/index.php [L]     </IfModule>          # END WordPress      What could be the problem?


title: How do I remove a rewrite rule?

text: I've added a rewrite rule with the following code, and now I need to remove it.               add_rewrite_rule('^events$', 'index.php?post_type=events', 'top');      My issue is not that the rule is not working. It is that the rule is already added, and I want to get rid of it. Does deleting the add_rewrite_rule() line of code and flushing the rules get rid of it?


title: How to Load Scripts and CSS for Admins Only When Editing or Adding Posts

text: I have a plugin that will allow administrators to perform certain actions when adding or editing a post. I use a stylesheet and a javascript for this plugin that I want to include _only_ when a post is being added or edited. Am I right to use the following action hooks?               add_action('load-post.php', 'call_my_function');     add_action('load-post-new.php', 'call_my_function');      Inside of the function call_my_function I have:               function call_my_function() {       $plugin_directory = "/wp-content/plugins/".dirname(plugin_basename(__FILE__));       $jssrc = $plugin_directory.'/js/my_plugin.js';       wp_enqueue_script("my_plugin_js", $jssrc);       $csssrc = $plugin_directory.'/css/my_plugin.css';       wp_enqueue_style("my_plugin_css", $csssrc);     }      The code above successfully loads the CSS and Javascript files when not called from the add_action hook. It does not work successfully when called from these hooks.


title: How to allow user to perform search by more than one tag

text: I have a few dropdown select option in my wordpress sidebar: ![enter image description here](http://i.stack.imgur.com/GfvIO.png) Whenever a user selects an option from any of the dropdown, they are directed to the search result page:               http://mywebsite/wp/?post_type=post&taxonomy=category&terms=29&search_type=or&order=title      The `29` is the Tag that is searches for which is what the user selected. I am doing that functionality with JQuery:               $('select').on('change', function () {         var url = $(this).val(); // get selected value         if (url) { // require a URL             window.location = "http://mywebsite/wp/?post_type=post&taxonomy=category&terms=" + url + "&search_type=or&order=title"; // redirect         }         return false;     });      I was trying to, instead of the above JQuery to have this:               $("#search").click(function(){         var k = $("#mtsw-form-children-term-ids-10 option:selected").val();         var m = $("#mtsw-form-children-term-ids-13 option:selected").val();         var o = $("#mtsw-form-children-term-ids-11 option:selected").val();         alert("Location: " + k + "\nSpecialty: " + m + "\nPhysician: " + o);                 //window.location = ; //SEARCH BASED ON LOCATION, and/or SPECIALTY, and/or PHYSICIAN tags     });      I am using the Multi-Term-Selection widget for the dropdown. How would I know if I am able to accomplish that search? I am new to Wordpress so I am trying to understand the starting point.


title: Insert images to post without Insert Media Window

text: Is it possible to insert images to a Wordpress site with having to use the Insert Media window. I have a forum type site where I would like people to be able to add images to post they can create but I don't want them to be able to create Galleries of images etc. I would just like the ability to add images from there system to the post like you can do on forums. Is this at all possible.


title: How can I clear memcached WordPress site options by hand?

text: Ater rebooting a memcache node, I am getting an error on root blog only, with a telling error log message from wp-includes/ms-settings.php.               [Thu Jul 07 18:55:27 2011] [error] [client 12.34.56.78] PHP Warning:  Attempt to assign property of non-object in /var/www/domain.php/wp-includes/ms-settings.php on line 114      Dumping the $current_blog var from that file shows there's no site data loaded into the object, just a couple plugin references, which is why lines like these are failing:                   $blog_id = $current_blog->blog_id;         $public  = $current_blog->public;      How can I clear site options in memcache by hand? What are the keys?


title: How do I redirect upon login a specific user based on role?

text: I'd like to force a user to a specific page upon login based on their role using               if ( current_user_can('contributor') )      and the main login function               function wp_loginout($redirect = '', $echo = true) {         if ( ! is_user_logged_in() )             $link = '' . __('Log in') . '';         else             $link = '' . __('Log out of account') . '';              if ( $echo )             echo apply_filters('loginout', $link);         else             return apply_filters('loginout', $link);     }      I've tried a number of combinations and seem to be failing. Any help would be appreciated.


title: Custom form that store input in database

text: I have never used WordPress before, but have done a lot of programming. But what is the normal way of making customs forms? I need to create a form where a user fill some input fields and on submit will the data be stored in the database. No need for any email. I also need to query the data and get the output in a HTML table. Thanks


title: IP address character limit

text: my client in his template is using `<?php comment_author_IP(); ?>` to display IP's of comment authors. Recently he came to me with idea of limiting whole number to several characters. Final result should be something simillar to: > 192.168... How can i achieve it? I've tried with jquery but without success. It looked like it was not responding to the jquery code.. thank you!


title: Limit the number of results from wpsc_start_category_query

text:
Observe the following code:
     <?php wpsc_start_category_query(array('category_group'=>get_option('wpsc_default_category'),'show_thumbnails'=>get_option('show_category_thumbnails'))); ?>

<?php wpsc_print_category_image(); ?>

                 <?php wpsc_print_category_name();?>

                 <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_link"><?php wpsc_print_category_name();?>                 <?php if(get_option('wpsc_category_description')) :?>                 <?php wpsc_print_category_description("
", "
"); ?>                 <?php endif;?>

              <?php wpsc_end_category_query(); ?>
      The above code displays all my product categories in a list. The problem with this approach is that I am not able to limit the number of categories that results. For example if I want to display 4 random categories, but have 6 in my WP database, then I won't get what I want. Is there any alternate way to get the an `x` number of categories from all possiblities? Maybe with `WP_Query`?


title: Is it possible to bold certain words in a post title?

text: I guess I would like to be able to include HTML tags within the title so that when the title is listed certain words are bolded. Is this possible? When I try to put HTML into the title, the tag itself is output (escaped) in the final page list.


title: Call two different function.js depending on page

text: I'm trying to find how I can call 2 different function.js depending of the page. When on "home", I want to load "function_2.js", and on the other pages of my website the original "function.js". I need to change something in my function.php but I can't figure out what. Can anybody make a suggestion to what I'm doing wrong? **EDIT** Here is my code               if(is_front_page()) {          add_action('wp_footer', 'handle_script', 200);         function handle_script(){             $templatedir = get_stylesheet_directory_uri();                 $scripts .= '<script type="text/javascript" src="'.$templatedir.'/_/js/functions_2.js"></script>'."\n";              echo $scripts;         }     }else{          add_action('wp_footer', 'handle_script', 200);         function handle_script(){             $templatedir = get_stylesheet_directory_uri();                 $scripts .= '<script type="text/javascript" src="'.$templatedir.'/_/js/functions.js"></script>'."\n";             echo $scripts;         }     }


title: Setting a default thumbnail url if no thumbnail

text: I have created a code to get an existing post's thumbnail and echo the url, but I would like to be able to have it get a default url is the post doesn't have a set thumbnail. Any help would be appreciated! Here's my code so far                   <?php     $thumb_id = get_post_thumbnail_id();     $thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail', false);     ?>          <div class="content" style="background-image:url(<?php echo $thumb_url[0]; ?>);">          Default Thumbnail url : http://www.website.com/img/default.jpg


title: WP_User_Query with more than two custom meta values

text: I am trying to create a custom user query based on users' metadata. I have the following query created.               $users = new WP_User_Query(        array(           'search' => '*' . $search_name . '*',         'meta_query' => array(           'relation' => 'AND',           array(             'key' => 'Status',             'value' => $search_status,             'compare' => 'LIKE'           ),           array(             'key' => 'Operation',             'value' => $search_operation,             'compare' => 'LIKE'           ),           array(             'key' => 'visible_to_directory',             'value' => '1',             'compare' => '='           )         )       )     );      When I have two custom meta values, it works great. Once I add more than that, it doesn't seem to work. Is this not supported with the WP_User_Query class?


title: Microformats in a single post - layout conflict

text:
WordPress uses microformats, for example, when we use the function `post_class()` in the `DIV` containing the article. It automatically includes the class called `hentry`, which is used in microformats. This is the structure:   1. hentry      1. entry-title     2. updated     3. published     4. author     5. ... So the use of the microformats is really easy, it's only needed to use it as classes in the code. BUT the problem is when we have to use the `entry-title` class out of the `hentry` class, specifically above the content. A lot of WordPress themes use this structure:

<?php the_title(); ?>
         <?php if (function_exists('mybread')) mybread(); ?>

     <div class="<?php content_layout(); ?>">         <?php if (have_posts()) while (have_posts()) : the_post(); ?>         <div id="post-<?php the_ID(); ?>" <?php post_class(); //The HENTRY class is here ?>  >

      With this layout it's impossible to use `entry-title` into `hentry`. So Google Webmaster Tools returns the error of "entry-title missing". I'm planning two solutions: to remove the `hentry` class using a filter, or to remove it and then insert it manually above the title. How can I fix it?


title: Wordpress and Magento: let Wordpress manage user registration and logins?

text: I need to integrate Magento and Wordpress for a corporate website. There will be other functionalities in the website that will require a login (ie forum, helpdesk and maybe others...) which I would like to develop with Wordpress since I'm totally ignorant at the moment on Magento and looks a very complicated system for theming and extending. The problem is user registration and logins: which system should handle those? Wordpress or Magento? What would be the best route to follow? Thank you so much for any help or advice


title: Is there a Wordpress version that is incompatible with PHP 5.3?

text: Is there some decent information available which WordPress versions do _not_ support PHP 5.3? I mean the more recent ones like 2.9 / 3.0 / 3.1? I'm only concerned about the Wordpress core codebase, not plugins. I've run WP for most of the time on PHP 5.3 now. But some servers are still on PHP 5.2 and some hosters are concerned if an upgrade might break something, so I try to gather some feedback from a larger community. The graphical wp.org stats do not differ between WP and PHP versions to each other, this would be some good source as well. Thanks for your help!


title: Wordpress removes spaces in URL on pagination

text: I'm having a problem with wordpress rewriting my URLs, basically I have a regular search form with method set as `GET`, when I submit it the URL looks like this at first: `http://mysite.com/news/?type=My+Variable` Wordpress adds the `+` symbol to separate the string and the results show fine, but when I click on the previous posts link the URL changes to: `http://mysite.com/news/page/2/?type=MyVariable` Since the `type` parameter is now `MyVariable` it shows me no results, it doesn't matter if I type the `+` sign directly in the URL, when I press ENTER it just gets removed. It seems to be related to how wordpress handles canonical URLs but I'm not sure about it, can anyone help me? Thanks in advance.


title: Re-ordering Admin Submenu Sections

text: I was looking at **the method below** to reorder the **Admin Menu Sections** : http://wordpress.stackexchange.com/a/1220/1044 ...and was wondering if it's possible to reorder the **submenu sections** using similar method.


title: Check out Attribute on WooCommerce

text: I am using WooCommerce on one of the site. I need to add one more field at the time of checkout to ask buyer wheteher to issue Invoice on his name or the name of his business? Any advise how to do that? Or something like this is already there in Woo Commerce? Or what could be the simplest way to do that?


title: Comments screen in backend, how to disable email address of commenter for non admins

text: I'm trying to configure the comments screen in the backend to fit my project. I've already been able to take a first step by resolving this question: Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins Now I'd like the post author viewing all the comments received to be unable to see the email account of the commenter. I'm a bit afraid that some of the authors could create some posts just to receive tons of comments and be able to see all the email accounts in his backend to use them for spamming purposes. Is it possible to keep the email account of the commenter only to be viewable by the admin? Thanks! I've been looking for hours online but the only kind of plugin I found is 6 years old and is not working                /*      Plugin Name: Erase Commenter Details      Plugin URI: http://wordpress.org/support/topic/143772      Description: Removes IP, e-mail and URL of comment authors from Comments admin when viewed by 'contributors.'      Version: R1      Author: Kaf Oseo      Author URI: http://szub.net          Copyright (c) 2007 Kaf Oseo (http://szub.net)     Erase Commenter Details is released under the GNU General Public License     http://www.gnu.org/licenses/gpl.txt          This is a WordPress plugin (http://wordpress.org).          */          function szub_erase_commenter_details($text) {     if( !current_user_can('publish_posts') ) {         $patterns = array('/ \| .*<\/a>/', '/ \| ' . __('IP') . ': <a href=.*<\/a>/', '/ \| <a href=\'mailto:.*<\/a>/', '/(' . __('E-mail') . '|' . __('IP') . ')<\/th>/', '/(<a href=(\'mailto|"edit-comments\.php).*<\/a>)?<\/td>/');         $text = preg_replace($patterns, '', $text);     }     return $text;     }          if( strpos($_SERVER['REQUEST_URI'], 'wp-admin/edit-comments.php') ) {     ob_start('szub_erase_commenter_details');     }


title: Change Label for field used in Woo Commerce

text: I'm using WooCommerce, and using a BACS Payment method which is actually Bank Trasnfer. The fields account details are fine, but for Indian context.. i need to change following two fields labels to something else. For example: Change IBAN label to MICR Code, and BIC to IFSC. And also need to disable Sort Code. However, please note that I don't to make chanegs into plugin's code itself. So looking for some function that can help change the label from my theme function file. Any help is appreciated.


title: The conditional logic only works to show or hide?

text: I am using the Advanced Custom Fields for custom fields in the User Profile. I use conditional logic to display one of between four fields, each field will be displayed according to a radio field option previously clicked. In this case only one option would can be sent. But, when the user update your profile all four fields are being sent. The conditional logic in this case is only serving to show or hide. Some tip on how to improve this? I appreciate any help.


title: Same theme name issue with wordpress repository theme

text: I created new theme with name for example XYZ. its good till now but the issue comes before few days. Wordpress repository has a theme with same name as my theme's name. Now the issue is when the updates comes for wordpress theme, the update notification is display for my themes also. So what can i do for this ? Thanks, Aezaz


title: $content_width for responsive UI

text: In our " _mobile first_ " age a theme without responsive UI is treated like from stone age. It means that a theme could have different content width for different devices. But one of requirements for theme development is to provide `$content_width` variable which should contain actual width of content area of a theme. Taking in consideration said above, I have the big question what width should I set for `$content_width` variable? A width for `mobile phones`/`tables`/`laptops`/`desktops`?


title: Allowed memory size of (...) exhausted

text: I'm stuck trying to figure out what seems to be a very common problem, the above mentioned "Allowed memory size of (...) exhausted". After developing my first theme I was moving it (just the theme, not the whole WP installation) from my development computer to my production server. After installing WP everything seemed fine and the site was working great with the default theme. Upon activating my custom theme however WP started throwing the error, > PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to > allocate 523800 bytes) in /srv/www/my.domain.com/public_html/wp- > includes/cache.php on line 113 Worth mentioning is that I've never had any issues like this during development. I've tried to increase both the memory limit in php.ini as well as setting the WP_MEMORY_LIMIT constant in wp-config without luck.               php -i | grep memory     memory_limit => 128M => 128M          cat wp-config.php | grep MEMORY     define('WP_MEMORY_LIMIT', '128M');      As you can see I've worked my way up to 128M. Still hitting the error I'm thinking this is getting ridiculous and not likely the source of my problem. As far as I can recall I never had to go much beyond 32M on much larger WP installations in the past.


title: $wpdb->flush(); breaks the loop

text: I am using `$wpdb->flush();` at the base of my page in an attempt to prevent the query executing multiple times due to caching however it seems that it isn't flushing the most recent query but the entire cache as my page is not loading past generating my content. Possibly Relevant information:   * I am using the `exec-php` plugin and consequently this page is entirely php   * I am also having another possibly related problem as detailed here


title: Adding line to multidimensional array option

text: I'm building a shipping plugin with a settings page where the user can add boxes with the attributes : Name, Length, Width, Height So far, I have managed to greate an option boxdata[l,w,h] and I have :                   function boxes_menu(){           add_options_page('boxes Config', 'boxes Plugin', 'manage_options', 'boxes-menu', 'boxes_options');           add_action( 'admin_init', 'register_mysettings' );     }          add_action('admin_menu','boxes_menu');          function boxes_options(){           include('admin/boxes-admin.php');     }         function register_mysettings() {            register_setting( 'boxes-settings-group', 'boxdata' );         }      and in my option page :               <form method="post" action="options.php">     <?php settings_fields( 'boxes-settings-group' ); ?>     <?php do_settings_sections( 'boxes-settings-group' ); ?>     <input type="text" name="boxdata[name]" value="<?php echo get_option('boxdata[name]'); ?>">       <input type="text" name="boxdata[length]" value="<?php echo get_option('boxdata[length]'); ?>">     <input type="text" name="boxdata[width]" value="<?php echo get_option('boxdata[width]'); ?>">     <input type="text" name="boxdata[height]" value="<?php echo get_option('boxdata[height]'); ?>">     <?php submit_button(); ?>          </form>      The page is visible, with the 4 fields, and it apparently submits without error. Now, I have 2 questions, I have done a lot of reading but it confused me more than anything. 1 - is this syntax correct and my option created properly? 2 - How do I enable the user to add more boxes with their attributes? Like boxdata1[name,length,width,height], boxdata2, etc... I'd like to store them all in a single array, but I can't figure out how. PS: I'm sure this question has been covered somewhere, but, although I'm fluent in PHP, I am quite a WP newbie, so please have some patience!


title: Wordpress Customise

text: I'm looking for a plugin that lets me put a "please wait" message (similar to **notebook-driver.com** where you're redirected to download link after a few seconds) when people click on certain links. For example, when people want to download something off my blog, I redirect them to a page with advertisements that is displayed for 5 seconds before the download is initiated. Does such a plugin exist? or how to do this manually ? Thanks.....


title: Get dimensions of referenced image (Magic Fields fields plugin with phpThumb)

text:
I'm displaying a group of thumbnails on a Wordpress site using the Magic Fields plugin Here's the code in my template:                 <?php       $client_images = get_group ('images');       foreach($client_images as $image){ ?>
           <a href="<?php echo $image['client_image'][2]['original']; ?>">             <?php echo "" ;?>

Resolution

[ORIGINAL RESOLUTION]

Credit

<?php echo $image['client_image_credit'][4]; ?>

Description

<?php echo $image['client_image_description'][5]; ?>

         <?php }       ?>      Where it says [ORIGINAL RESOLUTION], I'd like to print the resolution (e.g. "1200x800") of the source image. Magic Fields uses phpThumb to generate thumbnails. phpThumb seems to have a function for this purpose:               //Getting the original size of the image     if( preg_match('/'.MF_FILES_NAME.'/',$image_name_clean) ){       $image_name_clean = preg_replace('/'.MF_FILES_NAME.'\//','',$image_name_clean);       $file = MF_FILES_DIR.$image_name_clean;     }else{       $file = WP_CONTENT_DIR.DS.$image_name_clean;     }          if(file_exists($file) && (empty($_GET['w']) || empty($_GET['h']))){         $size = @getimagesize($file);         $default['w'] = $size[0];         $default['h'] = $size[1];     }      Would anyone be able to help me connect the dots? Thanks!


title: Trying to do a custom Search results page. Failing when I use the pagination

text: I'm trying to do a page where the user can search for posts with a Keyword (as search.php) and post date filter (between one date and another). I have a form with 3 fields: keyword, date1 and date2 and I use these fields to filter the wp_query. I'm NOT working in search.php file, I have myfile.php with all the code. If I don't use pagination on the loop, all works perfect, the wp_query filters without problems with the fields of the form. The problem comes when I use the pagination, when I begin to go to previous entries, I can see ALL the posts of my site, it is like when I move with previous / next entries, the wp_query looses the 3 filters of the form. I have seen when I go to a previous entries, Wordpress refresh the page adding a parameter called "paged=2", and here it is where I loose the filters of the form, keyword,date1 and date2. I don't want use the search.php. I'm trying to create my own search results page. I newbie in WordPress, so I will appreciate any help or comment. Thanks This is my code:               <?php     // **************** GET THE PARAMETERS FROM THE FORM     function getData($campo) {          return isset($_REQUEST[$campo]) ? $_REQUEST[$campo]:'';      }          $filterKeyword = getData('Keyword');     $filterDate1 = getData('Date1');     $filterDate2 = getData('Date2');          //*** IF THERE IS NOT PARAMETERS, DON'T RUN QUERY AND LOOP     $show = true;     if(($filterKeyword == '') && ($filterDate1 == '') && ($filterDate2 == ''))         $show = false;          get_header();            ?>     // ********** FORM ****************     <form id="form_datos" action="<?php the_permalink(); ?>" method="post">             <input type="text" name="Keyword"  />             <input type="text" name="Date1"  />             <input type="text" name="Date2"   />                  <input type="submit" id="enviar" value="Send">     </form>          <?php     if ($show) :                              // ********** Query filters *************         $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;         $args = array(             's'=> $filterKeyword,             'post_type'=> 'post',             'posts_per_page' => 10,             'paged'=> $paged,             'orderby' => 'date',             'order' => 'DESC',             'date_query' => array(                 array(                 'after'     => $filterDate1,                 'before'    => $filterDate2,                 'inclusive' => true,                 ),             ),             );              // ************ Query  & Loop ********************         $query = new WP_Query( $args );              if ($query->have_posts() ):             while( $query->have_posts() ): $query->the_post();                      the_time('G:i');               endwhile;           // ********* Navigation *************     next_posts_link( 'Entradas anteriores', $query->max_num_pages );     previous_posts_link( 'Entradas posteriores' );          endif;            wp_reset_postdata();              endif;     ?>


title: How to add more upload directories?

text: I have two types of files in my WordPress Media Library, one is for pictures and attachments from posts, the other is for attachments from a custom post type. I want to organize them separately, **use my plugin's dir as basedir** for the custom post type, while **keep other files in Wordpress' default upload directory.** Is it possible to add one more basedir?