title: Resize post thumbnail produces horrible image quality..Any help?

text:
im having a problem figuring this out. I am displaying a random post on the header of my site but the post-thumbnail looses quality when I add a custom size. How can i make it not loose quality? This is the code in header.php
     <?php     $args = array( 'numberposts' => 1, 'orderby' => 'rand', 'post_status' => 'publish', 'offset' => 1);      $rand_posts = get_posts( $args );      foreach( $rand_posts as $post ) : ?>
<?php the_post_thumbnail(array(730,250)); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ? >"><?php the_title(); ?>      <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
      <?php endforeach; ?>

          And this is the css               div.post-thumb-title {     width: 730px;     margin: 1em auto;     }          div.post-thumb-title img {     display: block;     min-width: 100%;               div.post-thumb-title p.thumb-title {     margin: 0;     height: 2em;     line-height: 2;     position: relative;     top: -2em;     max-width: 100%;     text-align: center;      color: #fff;     background: rgba(0, 0, 0, 0.7);     }      Image quality is horrible. Am i doing something wrong or is there a fix for this? Thanks for your help


title: How do I get the slug of a custom taxonomy category of a post?

text: In my template file, I loop through posts that are categorized either _web_ , _print_ , or _marketing_ in a custom taxonomy _portfolio_. How do I echo the slug of each posts category?


title: Option doesn't save

text: I am studying wordpress settings api and tried some tutorials. I want to save the option as an array. I put some defaults for the option and it works fine, but after I save the settings, it becomes blank - string(0). How come? My callback for the form element is this:               function render_checkbox($html_args){     extract($html_args);     $option_name = 'di_theme_options';     $option = get_option('di_theme_options');     printf(         '<input type="checkbox" name="%1$s[%2$s]" id ="%2$s" value = "1" %3$s />',         $option_name,         $id,         checked(1, $option[$id],false)     );     }


title: "Use as featured image" not working , "Set Featured Image" hangs. GoDaddy Issue

text: **What my site runs on:**   * Wordpress version: 3.4.2   * Host Gator Shared Server   * PHP 5.3 **What happens when i click use as featured image ?**   * The text "Saving..." appears and the image never gets saved as the featured image **What I tried**   * The problem was on 3.4.1 so i updated it to 3.4.2 ( Issue not resolved )   * Changed the theme to the basic twenty ten ( Issue not resolved )   * Wordpress support forums seem to sway towards the fact that its a wordpress core code issue and not an issue with the themes.


title: $GLOBALS array for wordpress

text: is there a file where wordpress defines it's $GLOBALS? i'm just curious as to what wordpress uses it for and for what purpose. That's all!


title: Are there any action like 'init_frontend'

text: I've found init and init_admin. Are there any action that executes just in the frontend? Thanks.


title: wp_logout logging everyone out instead of just the user that clicked the logout link!

text:
I want to display a different menu depending whether a user is logged into the CMS or not. I'm using this for my menu:               <?php if ( is_user_logged_in() ) {     $args = array(         'depth'        => 1,         'show_date'    => '',         'date_format'  => get_option('date_format'),         'child_of'     => 0,         'exclude'      => '5, 80, 83, 138',          'include'      => '',         'title_li'     => __(''),         'echo'         => 1,         'authors'      => '',         'sort_column'  => 'menu_order, post_title',         'link_before'  => '',         'link_after'   => '',         'walker' => '' );     ?>

             <?php wp_list_pages( $args, 'sort_column=menu_order' ); ?>
                 <a href="<?php $redirect = bloginfo('url'); wp_logout_url( $redirect ); ?>">                     Logout

Viewing content for:
Aneurin Bevan Health Board

     <?php } else {     $args1 = array(         'depth'        => 1,         'show_date'    => '',         'date_format'  => get_option('date_format'),         'child_of'     => 0,         'exclude'      => '25, 31, 33, 43, 93, 96, 99, 138',             'include'      => '',         'title_li'     => __(''),         'echo'         => 1,         'authors'      => '',         'sort_column'  => 'menu_order, post_title',         'link_before'  => '',         'link_after'   => '',         'walker' => '' );     ?>

             <?php wp_list_pages( $args1, 'sort_column=menu_order' ); ?>

     <?php } ?>      I'm using the following for a user to logout of the CMS:               <a href="<?php $redirect = bloginfo('url'); wp_logout_url( $redirect ); ?>">Logout      Even though the page reloads after clicking the logout link, the menu doesn't seem to change. Does anyone know what's going wrong? * * * **UPDATE** I've tried using `<?php $redirect = bloginfo('url'); wp_logout( $redirect, $echo ); ?>` which I thought was working perfectly until a colleague shouted across the room that they had been logged out too! Turns out it's logging everyone out instead of just logging out the user that clicked the logout link!


title: How to display non-hierarchical taxonomy as terms with checkboxes?

text: I'd like to have a non-hierarchical custom taxonomy displayed in the add/edit posts admin screen for a custom post type. Obviously, when the custom taxonomy is non-hierarchical, the meta box that's displayed is similar to the tags - it's a text field with the auto-suggest. However, I'm more interested in having a flat, non-hierarchical taxonomy display as a list of checkbox terms. In essence, I'd like it's functionality to be the same as categories, with the exception that child terms could not be added. Surely this is something that other developers have done, but the normal Google searches haven't returned much for me. Apparently this was the default behavior when custom taxonomies were originally introduced in v2.8. ![Example of non-hierarchical taxonomy with checkboxes](http://i.stack.imgur.com/Xt0XB.png) I'm really not looking for a plugin solution, however code examples from plugins would be fine. When developing sites for client's it is often beneficial to allow them to see the list of pre-established terms for a certain post type. The customer should be allowed to add additional terms, just not additional child terms.


title: In What WordPress Version Was the Import/Export Tool Introduced?

text: I was just looking under my "Tools" menu in my WordPress site and noticed the "Export/Import" functions. I was not aware that this was even available and I've been needing it for some time. What version of WordPress did it originate with?


title: Sidebar on single.php not showing up

text:
So, my sidebar is working just fine on my blog page: beta.cleantelligent.com/blog However, when you click a single post, I'd like that same sidebar to show up. I am assuming this would be under single.php, right? That code is listed below. Let me know if you need any other code and I'll post it here. I have the 'blog' sidebar in my page attributes on the Edit Page in Wordpress, but it's just not being recognized by the template, I guess? Any help would be great. Thanks!               <?php      get_header(); ?>

     Blog

     <?php     $post_obj = $wp_query->get_queried_object();     $post_name = $post_obj->post_name;     if($post_name == 'blog'){     echo 'Blog';     }else{     $parent_title = get_the_title($post->post_parent);     echo $parent_title;     }     ?>
              <?php while ( have_posts() ) : the_post(); ?>                  <?php get_template_part( 'content', 'archive' ); ?>              <?php endwhile; // end of the loop. ?>

     <?php get_sidebar(); ?>
      The blog page is using index.php               <?php     get_header(); ?>

     <?php     $post_obj = $wp_query->get_queried_object();     $post_name = $post_obj->post_name;     if($post_name == 'blog'){     echo 'Blog';     }else{     $parent_title = get_the_title($post->post_parent);     echo $parent_title;     }     ?>

                  <?php while ( have_posts() ) : the_post(); ?>                           <?php get_template_part( 'content', 'blog' ); ?>                                <?php comments_template( '', false ); ?>                  <?php endwhile; // end of the loop. ?>

          <?php get_sidebar(); ?>

      Here is my sidebar.php:               <?php          $options = twentyeleven_get_theme_options();     $current_layout = $options['theme_layout'];     $nav = sb_get_page_nav($post);     if ( 'content' != $current_layout ) :     ?>     <img class="sidebar-top" src='<?php bloginfo('stylesheet_directory'); ?>/images/sidebar-top.png' />
     <?php         $post_obj = $wp_query->get_queried_object();         $post_name = $post_obj->post_name;         $title = 'cs-' . $post_name;          ?>     <?php         if($post_name == 'news-events'){             if ( ! dynamic_sidebar( 'sidebar-web' ) ) :             endif;         }     ?>          <?php if(!$nav['no_nav']) { ?>
             <?php wp_nav_menu(array('container_id' => 'left-navigation','menu' => $nav['title'])); ?>
     <?php } ?>               <?php if ( ! dynamic_sidebar( 'sidebar-all' ) ) : ?>     <?php endif; // end sidebar widget area ?>     <?php /*
             <?php if(!$nav['no_nav']) {                 wp_nav_menu(array('container_id' => 'left-navigation','menu' =>     $nav['title']));             } ?>
              */ ?>              <?php if ( ! dynamic_sidebar( $title ) ) : ?>         <?php endif; // end sidebar widget area ?>         <img class="sidebar-bot" src='<?php     bloginfo('stylesheet_directory'); ?>/images/sidebar-bot.png' />
          <?php endif;      $parent_title = get_the_title($post->post_parent);     if($parent_title == 'Tour'){     echo"          ";     }     ?>


title: Woocommerce product image

text: when I upload in woocommerce image it uploads different sizes:   1. For category   2. Single   3. Thumb and keeps original file which is big... how can I auto delete this original file ?


title: Custom GD Star Ratings Stars

text: I have some custom stars that I would like to use for GD Star Ratings.. how do I load my custom star image?


title: local Wordpress installation with Xampp permalinks issue

text: I know this question might be asked before but it seems that nothing helped. I have a local Wordpress installation and try to use `permalinks`. What I did in my XAMPP was to open the `conf` file and find `LoadModule rewrite_module modules/mod_rewrite.so` so it was activated and no `#` before. Then I searched for `AllowOverride All` which was fine too. But none of the permalinks work, I always get an `not found` error. Can anyone help?


title: How to create short urls for sharing and downloadable content?

text: I want to create something similar to " **youtube.com/long => youtu.be/short** " for my wordpress blog/portfolio/freebie site: " **magicshrooms.com/%cat-etc => mgcsr.mz/link-name** ". Generally, I want to create a short link for each link and also for downloads, since my url is quite long. Of course I will buy short domain and what to do further i am lost... Tried googling it and apparently its more complex than I thought. There are services like bitly, but ridiculously expensive. Also something called YOURLS, but no clue how it works. Is there anyone who has this function implemented and could point me to tutorial or simply explain how to do this. Also, guys what do you think about this url shortening? Good/bad idea? Thanks in advance:)


title: Query posts and custom post types within the same category

text: i have a filter on my template which returns posts from a given category and displays them in a slider gallery. This is the code:               <?php      if (is_page()) {          $cat=get_cat_ID($post->post_title); //use page title to get a category ID          $posts = get_posts( array('category' => 16) );          if ($posts) {              foreach ($posts as $post):                  setup_postdata($post); ?>      This works fine with "normal" posts. But I have created 3 custom post types (some of the entries tagged with the same category). And they don't show up. Could anyone please help how to customize this code in order to be able to use it also with CPT's? Thank you, Ralf


title: How do I display the posts from a custom post type on a category.php page?

text:
I have set up a `category.php` according to this wordpress hierarchy diagram. When I am on the page http://example.com/category/my-category I want to display all posts that are under `my-category` using the loop:               <?php if (have_posts()): while (have_posts()): the_post(); ?>
<?php the_title(); ?>
     <?php endwhile; endif; ?>      Wordpress is not showing the posts. I will also add that this is a custom post type, but that shouldn't matter or should it? I can use `get_posts()` but then what is the point of having a `category.php`? How do I show the posts in the current category using `the_loop`?


title: Can I leave off plugin textdomain for terms used in core?

text: I've got a plugin that puts post statuses into post type admin menus. I'm in the middle of internationalizing it, and I'm wondering how to handle this situation. The plugin uses some unique strings that will get a textdomain like this:               __( 'Select the post statuses to exclude from post type admin menus', 'csmpmsi' )      But then there are also cases where I'm using a core-related word for their core-related meaning like this: `__( 'Pages' )`. In this situation, it seems to make perfect sense for me to exclude the textdomain and take advantage of terms that are already localized in core. However, the codex seems very explicit: > If you're trying to translate a plugin, the same advice as above applies, > except that > >   * you must use a domain, which is loaded in a hook of your plugin > >   * every translation call must become __('text', 'domain-name') > > So is this WP-kosher?


title: Display ONE taxonomy and its assigned pages

text: Quite a straight-forward question but I haven't been able to find a solution. I have created a page which lists categories within a taxonomy called **'Themes'**. I now want each link in the list to point towards an index page which displays all of the pages for that particular category. The way I see it, it's a bit like a search results page, because I only want to create one template page for the results, but the results will vary depending on what Taxonomy category is clicked. E.g. This is what I want to happen: The post-type is called **Events**. Within **Events** there is a taxonomy called **Themes**. **Themes** has a number of categories such as **Boat** , **Fishing** , **Walking** , **Eating** etc. On one of the pages, user clicks on the **Boat** category listed. User is then taken to a page which displays all of my post-type pages within the **Boat** category under the **Themes** taxonomy. Hope this is clear, if you need any clarification just let me know. Thank you


title: blocking the admin section (but still using admin-ajax.php)

text: I am building a community based WP site at the mo and have blocked anyone bar admins from using the admin section on the site with:               add_action( 'init', 'sw_block_users' );          function sw_block_users() {         if ( is_admin() && ! current_user_can( 'administrator' ) ) {             wp_redirect( home_url() );             exit;         }     }      However, I'm also using the awesome power of admin-ajax.php to do a few ajaxy things (as outlined here : http://reallywebdesign.com/2011/09/send-dynamic- data-to-javascript-in-wordpress/), which get blocked by the above function. Is there a different way I can prevent non-admins from getting to wp-admin directory, while maintaining the use of the admin-ajax file? Thanks!


title: category.php not showing custom post types

text: in my custom post type i've set `'taxonomies' => array('category')`. However, within my category.php page, none of the custom post types are being displayed, only posts. How do i make ALL post types appear, not just the post?


title: Apply html elements in php statement

text: I know this is probably going to sound like a beginner question ... to which it is in some sort. I have this statement in my one plugin that i am working on:               add_post_meta($newpostid, 'name', $formdata['your-first-name'].$formdata['your-last-name']);      Which in turn will add FirstnameLastname in a custom field. What i would like to do is add a space between the first and last name like this: Firstname Lastname I have tried using statements such as:               add_post_meta($newpostid, 'name', $formdata['your-first-name']. echo '&nbsp' . $formdata['your-last-name']);      But obviously that is not going to parse correctly. Is there any Idea on how I can achieve this? Any help would be welcome. :)


title: Possible jquery / library conflict in plugin usage

text: I am using the free version of the plugin: WP Feedback & Survey Manager but for some reasons the tab style is not rendered, and I guess it's for a javascript/jquery problem, eventhough I don't get any console errors. This is the plugin public url I installed: http://www.riccardo.it/newtech/questionnaire/ And here it is how it should look like (See tabs in screenshot #4): http://www.intechgrity.com/wp-plugins/wp-feedback-survey-manager/ Any suggestion? Thanks.


title: how to "not" display new posts with a specific category on the main page?

text: I've read this and this but I'm just a basic user. I have a "technical" blog that more and more people visit. I'm a freelance, and now, when someone hears about me, he/she wants to search for me, and my blog is #1 (before anything else). The problem is that it was a personal blog, and now it becomes professionnal. So I would still like to post some articles, but when there are some specific tags (like "games", "family" and so on), I'd like them **not** to appear on the main page but only under the category filter (`http://myblog/?s=game`, `http://myblog/?s=family` would be ok, but _not_ `http://myblog/`). How to do this?


title: Page is defaulting to archive page and not designated template

text: 1. I created a page called "Projects" through the wordpress admin   2. I created a template called "Projects"   3. Set the "Projects" page to use the Projects template. How come when I navigate to the Projects page it shows the archive page and not the Projects template. Also, if I set the "posts page" in settings->reading to "Projects" in the admin then the above happens. But, if I don't set a post page then I can go to the /Projects and this works fine. However, if I go to /projects (lowercase) then this doesn't work and it defaults to the archive page. I'm confused as to what is going on, can anyone help?


title: Specifying a template for custom post type pages

text: My main projects page is bringing in some data that I have entered in for custom post types. There are basically a few categories like "photo", "video", etc. When you click on one of these it will go to a subpage like /projects/photo/1. How to I go about specifying a template to use for those subpages? I am using the Ultimate Post-Type Plugin, but that shouldn't really matter since it should work the same way.


title: Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts

text: I'm using get_the_term_list and manage_posts_custom_column to display the terms of a custom taxonomy in the list of custom posts, in the WordPress Admin.               add_action( 'manage_mycustompost_posts_custom_column' , 'custom_mycustompost_column', 10, 2 );          function custom_mycustompost_column( $column, $post_id ) {       switch ( $column ) {         case 'category_names':             echo get_the_term_list( $post_id , 'mycustomcategory' , '' , ',' , '' );             break;       }     }      However, for each taxonomy term, I get a link to the public page that shows posts for that term: http://www.myblog.com/mycustomcategory/test/ I would like to get a link that filters the list in the WordPress Admin. I would like a link like: http://www.myblog.com/wp- admin/edit.php?post_type=post&category_name=news The type of link I get in the Posts list, for tags or categories of the default WordPress posts. Is there a WordPress function that does that?


title: RSS feed not Refreshes

text: I use RSS widget I put the address of the RSS on RSS widget: http://mysite.tumblr.com/rss I add the code to functions.php                   add_filter( 'wp_feed_cache_transient_lifetime',         create_function('$a', 'return 100;') );      It does not refresh All 100 seconds.


title: How to find the origin of a file upload from within wp_handle_upload?

text: I have a plugin that hooks into "wp_handle_upload" filter. Within that scope I'd like to be able to identify where the upload came from, meaning I want to treat it differently if it was uploaded from within a post vs. the media library vs. a plugin/theme settings page (for example the header image for a template). The only thing passed into my function is an array with file,url,type. Is there a way to identify where it came from? I could probably create an exception and examine the stack trace, is that a decent solution? If so, what might I be looking for in the stack? Thanks!


title: How to check if a user (not current user) is logged in?

text:
I need to display the online status (online/offline) for each author page (custom author page template). is_user_logged_in() only applies to the current user and I can't find a relevant approach targeting the current author e.g. is_author_logged_in() Any ideas? # Answer One Trick Pony was kind enough to prepare the coding for two to three functions using transients, something I hadn't use before. http://codex.wordpress.org/Transients_API Add this to functions.php:               add_action('wp', 'update_online_users_status');     function update_online_users_status(){            if(is_user_logged_in()){              // get the online users list         if(($logged_in_users = get_transient('users_online')) === false) $logged_in_users = array();              $current_user = wp_get_current_user();         $current_user = $current_user->ID;           $current_time = current_time('timestamp');              if(!isset($logged_in_users[$current_user]) || ($logged_in_users[$current_user] < ($current_time - (15 * 60)))){           $logged_in_users[$current_user] = $current_time;           set_transient('users_online', $logged_in_users, 30 * 60);         }            }     }      Add this to author.php (or another page template):               function is_user_online($user_id) {            // get the online users list       $logged_in_users = get_transient('users_online');            // online, if (s)he is in the list and last activity was less than 15 minutes ago       return isset($logged_in_users[$user_id]) && ($logged_in_users[$user_id] > (current_time('timestamp') - (15 * 60)));     }          $passthis_id = $curauth->ID;     if(is_user_online($passthis_id)){     echo 'User is online.';}     else {     echo'User is not online.';}      # Second Answer (do not use) This answer is included for reference. As pointed out by One Trick Pony, this is undesireable approach because the database is updated on each page load. After further scrutiny the code only seemed to be detecting the current user's log-in status rather than additionally matching it to the current author. 1) Install this plugin: http://wordpress.org/extend/plugins/who-is-online/ 2) Add the following to your page template:               //Set the $curauth variable     if(isset($_GET['author_name'])) :     $curauth = get_userdatabylogin($author_name);     else :     $curauth = get_userdata(intval($author));     endif;          // Define the ID of whatever authors page is being viewed.     $authortemplate_id = $curauth->ID;          // Connect to database.     global $wpdb;     // Define table as variable.     $who_is_online_table = $wpdb->prefix . 'who_is_online';     // Query: Count the number of user_id's (plugin) that match the author id (author template page).     $onlinestatus_check = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$who_is_online_table." WHERE user_id = '".$authortemplate_id."';" ) );          // If a match is found...     if ($onlinestatus_check == "1"){     echo "
User is online now!
";     }     else{     echo "
User is currently offline.
";     }


title: Change next_post and previous_link to navigate throught parent categories only

text:
I have this unchanged code from template-tags.php which links through all of the posts on the site. However I would like to restrict it so that it only links through the articles which are in the same parent category.               <nav role="navigation" id="<?php echo $nav_id; ?>" class="<?php echo $nav_class; ?>">
<?php _e( 'Post navigation', 'IQ' ); ?>
              <?php if ( is_single() ) : // navigation links for single posts ?>                  <?php previous_post_link( '
%link
', '' . _x( '←', 'Previous post link', 'IQ' ) . ' %title' ); ?>             <?php next_post_link( '
%link
', '%title ' . _x( '→', 'Next post link', 'IQ' ) . '' ); ?>              <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>                  <?php if ( get_next_posts_link() ) : ?>
<?php next_posts_link( __( '← Older posts', 'IQ' ) ); ?>
             <?php endif; ?>                  <?php if ( get_previous_posts_link() ) : ?>
<?php previous_posts_link( __( 'Newer posts →', 'IQ' ) ); ?>
             <?php endif; ?>              <?php endif; ?>                    The site works like a magazine site, so we have a new issue every few months. The new issue is a new parent category, with new child categories to hold the respective articles. If someone is in Issue 0 -> News i would like them to be able to scroll through all of the articles in Issue 0 from that article. Does anyone know how this could be achieved?


title: How to redirect user after login to the page called by his first name?

text: I wonder how to redirect a user after login to the page called by his first name (name used for registration). Example: Username or first name is John, after login he should be redirected to website.com/john page. I tried to combine these 2 examples but without luck.               add_filter( 'login_redirect', 'ckc_login_redirect' );      function ckc_login_redirect() {         // Change this to the url to Updates page.         return home_url( '/Updates' );      }      &               global $current_user;     get_currentuserinfo();     echo 'Username: ' . $current_user->user_login . "\n";     echo 'User email: ' . $current_user->user_email . "\n";     echo 'User first name: ' . $current_user->user_firstname . "\n";     echo 'User last name: ' . $current_user->user_lastname . "\n";     echo 'User display name: ' . $current_user->display_name . "\n";     echo 'User ID: ' . $current_user->ID . "\n";      Please help PHP newbie :)


title: How to hide a plugin metabox for non admins when a user adds a new post

text:
I've been able to disable all the meta boxes for non admin in their backend but I'm having problems with **Facebook AWD All in one** which creates a widget seen by all the users when they create new posts. How can I disable it? Is there some sort of command that is good for any widget created by plugins that I can add in my functions.php if I know the shortcode of the plugin? I need your help! Thanks... http://wordpress.org/extend/plugins/facebook-awd/ I use the following code to remove meta boxes               ######################################################################     # remove evreything from add a new post     ######################################################################     if (is_admin()) :     function remove_post_meta_boxes() {      if(!current_user_can('administrator')) {       remove_meta_box('tagsdiv-post_tag', 'post', 'normal');     //remove_meta_box('categorydiv', 'post', 'normal');       remove_meta_box('postimagediv', 'post', 'normal');       remove_meta_box('authordiv', 'post', 'normal');       remove_meta_box('postexcerpt', 'post', 'normal');       remove_meta_box('trackbacksdiv', 'post', 'normal');       remove_meta_box('commentstatusdiv', 'post', 'normal');       remove_meta_box('postcustom', 'post', 'normal');       remove_meta_box('commentstatusdiv', 'post', 'normal');       remove_meta_box('commentsdiv', 'post', 'normal');       remove_meta_box('revisionsdiv', 'post', 'normal');       remove_meta_box('authordiv', 'post', 'normal');       remove_meta_box('slugdiv', 'post', 'normal');      }     }          add_action( 'admin_menu', 'remove_post_meta_boxes' );     endif;      This is the code of the metabox   Facebook AWD Manager

Like Button

             Redefine globals settings ?             <select id="awd_fcbk_option_like_button_redefine" name="awd_fcbk_option_like_button[redefine]" class="span3" >             <option value="0" selected="selected" >No</option><option value="1"  >Yes</option>             </select>

             Activate ?             <select id="awd_fcbk_option_like_button_enabled" name="awd_fcbk_option_like_button[enabled]" class="span3" >             <option value="0"  >No</option><option value="1" selected="selected" >Yes</option>             </select>

             Where ?             <select id="awd_fcbk_option_like_button_place" name="awd_fcbk_option_like_button[place]" class="span3" >             <option value="top" selected="selected" >Top</option><option value="bottom"  >Bottom</option><option value="both"  >Both</option>             </select>


title: Cannot see dropdown shortcut to site dashboard in WordPress network why?

text: As per title and following screenshot   ![enter image description here](http://i.stack.imgur.com/2NLIQ.png)


title: Ajax loading duplicate post

text:
I wanna start by apologize for this post being so long, but I feel it may help others since I am having this problem and figured I might as well be as detailed as possible. I am having a problem with this is the loop.php file loading the same post multiple times and I have tried the prevent duplicate post method and nothing working. As you can see below I am loading the function to post into the ajax function and I get a success call but at this point I am not sure if the loop file is the problem. When the site 1st loads it loads the 1st set of post and then when it gets the 2nd set of post its fine but everything after that is all the same post, its like the loop file loads but the query is stuck or something. Any suggestions? Any help is greatly appreciated. loop.php file
     <?php query_posts(array('post__not_in' => $id_merge,'posts_per_page'=>'2'));           $do_not_duplicate = $post->ID;           if (have_posts()) : while (have_posts()) : the_post();      if( $post->ID == $do_not_duplicate ) continue;      $ids[] = get_the_ID(); ?>
     <?php the_title(); ?>
     <?php endwhile; endif; // End the loop. Whew. ?>

     <?php query_posts(array('post__not_in' => $id_merge,'posts_per_page'=>'3'));           $do_not_duplicate = $post->ID;           if (have_posts()) : while (have_posts()) : the_post();      if( $post->ID == $do_not_duplicate ) continue;           $ids[] = get_the_ID(); ?>
     <?php the_title(); ?>
     <?php endwhile; endif; // End the loop. Whew. ?>
      functions.php               add_action('wp_ajax_infinite_scroll', 'wp_infinitepaginate');           // for logged in user     add_action('wp_ajax_nopriv_infinite_scroll', 'wp_infinitepaginate');    // if user not logged in          function wp_infinitepaginate(){         $loopFile        = $_POST['loop_file'];         get_template_part( $loopFile );         exit;     }      ajax               jQuery(document).ready(function($) {         var count = 1;         var total = <?php echo $wp_query->max_num_pages; ?>;         $(window).scroll(function(){                 if  ($(window).scrollTop() == $(document).height() - $(window).height()){                    if (count > total){                         return false;                    }else{                         loadArticle(count);                    }                    count++;                 }         });               function loadArticle(){                     $('a#inifiniteLoader').show('fast');                 $.ajax({                     url: "<?php bloginfo('wpurl') ?>/wp-admin/admin-ajax.php",                     type:'POST',                     data: "action=infinite_scroll&loop_file=loop",                      success: function(html){                         $('a#inifiniteLoader').hide('1000');                         $("#content").append(html);    // This will be the div where our content will be loaded                     }                 });             return false;         }     });


title: Having issue with WordPress wp_enqueue_style

text: I am building a full design into `WordPress` for the first time and I am trying to load in stylesheets and script files but all I seem to be getting is the text output of the location. What I have is below..               wp_enqueue_style('reset', bloginfo('template_url') . '/reset.css');     wp_enqueue_style('style', bloginfo('stylesheet_url'), array('reset'));     wp_enqueue_style('rhino', bloginfo('template_url') . '/rhinoslider-1.05.css', array('reset','style'));      Do I need to put this inside the `link` tags or something? I thought it would do it all itself; as what's the point loading it that way if it doesn't do it itself? I know it makes sure the same file isn't included twice or something, but if you have to include the link tags yourself and then WP decides not to include the file then you are left with blank link tags!? I also tried putting the below in my themes `functions.php` file but got the same results.               add_action( 'after_setup_theme', 'mmw_new_theme_setup' );          function mmw_new_theme_setup() {              /* Add theme support for post formats. */            add_theme_support( 'post-formats' );              /* Add theme support for post thumbnails. */             add_theme_support( 'post-thumbnails' );              /* Add theme support for automatic feed links. */            add_theme_support( 'automatic-feed-links' );              /* Add theme support for menus. */           add_theme_support( 'menus' );              /* Load style files on the 'wp_enqueue_scripts' action hook. */         add_action( 'wp_enqueue_scripts', 'mmw_new_load_styles' );          }          function mmw_new_load_styles() {              $foo = bloginfo('template_url') . '/reset.css';         $bar = bloginfo('template_url') . '/rhinoslider-1.05.css';              wp_enqueue_style('reset', $foo);         wp_enqueue_style('style', bloginfo('stylesheet_url'), array('reset'));         wp_enqueue_style('rhino', $bar, array('reset','style'));          }      Thanks!


title: Change Image Sizes for Mobile Theme

text: I've got a small challenge, right now I have an existing blog with images that formatted for desktop. I have a mobile child theme that shows the content for mobile. Is there a method to filter a different version of an image when the post displays? More succintly, could I force all images to show their 'medium' versions on the mobile child theme and the full version on the desktop version?


title: Display all submenus

text:
For a custom jquery menu I'd like to show **all submenus** and hide / show each on demand. However my problem is to show all submenus in the first place. As of now I am managing the **first level** through the **admin menu** section: adding menu items to primary menu. Display works like so:               wp_nav_menu(        array (             'sort_column' => 'menu_order'             , 'container' => 'ul'             , 'menu_id' => 'main-nav'             , 'theme_location' => 'primary-menu'             , 'depth' => 1        )     );      The **second level** is (unfortunately) managed through the **pages section** with post_parent and menu_order. Therefore displaying it works like so:               global $post;     $has_post_parent = $post && $post->post_parent;     $post_id = $post ? $post->ID : -1;     $top = $has_post_parent ? array_pop( get_post_ancestors($post_id) ) : $post_id;     echo '

';     wp_list_pages(         array(             'child_of' => $top             , 'depth' => 1             , 'title_li' => ''         )     );     echo '

';      I already tried to loop through the main menu items (first-level) like the following, but that left me with empty submenus, even though the main items seemed correct at first glance:               $locations = get_nav_menu_locations();     $menu = wp_get_nav_menu_object($locations['primary-menu']);     $menu_items = wp_get_nav_menu_items($menu->term_id);     foreach($menu_items as $menu_item) {         $current_id = $menu_item->ID;         $is_current_class = ($current_id == $top) ? 'current-submenu' : '';              echo "
";         wp_list_pages(             array(                 'child_of' => $current_id                 , 'depth' => 1                 , 'echo' => 1                 , 'title_li' => ''             )         );         echo '
';     }      **EDIT** Even though I have fixed my initial solution, I am still very interested in a solution, where the menu can be **completely managed through the wp-admin menus section**.


title: Hide upload image fields for the different media upload popups

text: I am trying to change a few of the options in the `Set Featured Image` popup in the Wordpress admin. I can't seem to find anything that determines if the popup window is a `Featured Image` or an `Add Media` popup. I want to hide **Align** and **Sizes** fields for the `Set Featured Image` popup but have them visible for the `Add Media` panel. I am able to use the `attachment_fields_to_edit` filter to remove certain fields but not for the two different pop up box types. Is it possible to do this?


title: Posts 2 posts plugin loop echo the_title not working

text:
I have a basic loop (a rough example of what I'm doing) of work, and want to show the client(s) the work was done for. Some work has clients connected and some doesn't. The work that doas have one or more client associated with it echos the clients paragraph, and echos it once for each connect client, so it is recognizing the connections. But it doesn't echo the title, and I cant't seem to figure out why. This is taken straight from the Posts 2 Posts github: https://github.com/scribu/wp-posts-to-posts/wiki/each_connected               <?php     $my_query = new WP_Query( array(         'post_type' => 'work'     ) );          p2p_type( 'work_for_client' )->each_connected( $my_query, array(), 'clients' );               while ( $my_query->have_posts() ) : $my_query->the_post(); ?>              <?php the_title(); ?>              <?php         // Display connected clients                   foreach ( $post->clients as $post ) : setup_postdata( $post );             echo '
clients:
';             echo the_title();              endforeach;              wp_reset_postdata();              ?>


title: Change The Meta-Description Of Home-Page?

text: I would like to use this script (found here), but it generates a blank page when I add it to my header.php                    if ( is_home() ) { ?>         <meta name="description" content="Your home page meta description" />     <?php } else {  ?>  <meta name="description" content="Your none homepage meta description" />      <?php } ?>       Thank's!


title: Display wordpress admin bar outside wordpress in Magento?

text: I have been trying to get the admin bar to show up under a magento install. I have tried eveything to get it. I can get the user, get the footer but nothing happens to get the admin bar up. from with in a 1column.phtml I called a                   <?php              echo $this->getLayout()->createBlock('core/template')->setTemplate('custom/userpanel.phtml')->toHtml();          ?>       and in that 'custom/userpanel.phtml' I added :                           require_once('/var/www/html/blog/wp-load.php');                 require_once('/var/www/html/blog/wp-blog-header.php');                 require_once('/var/www/html/blog/wp-includes/admin-bar.php');                 require_once('/var/www/html/blog/wp-config.php');                      show_admin_bar(true);                 wp_admin_bar_render();      with out anyluck. I'v tried using                           wp_footer();      but that doesn't get the bar, and even calling the head function doesn't work                           wp_head();                 wp_footer();      But althou i get all the head elements like the and what not which i don't want since it's in the , but still nothing. What is the way to set it up correctly? ## ------------------------------------------------------------------------ **EDIT** ## ------------------------------------------------------------------------ So I thought I'd get tricky and just grab the admin bar from WP and pull it over almost like jquery .load() but at php runtime. This is what i did, but here is the odd part, it fails cause it thinks I'm not loged in? Again in 'custom/userpanel.phtml' of magento which is pull over to WP so when in WP it's all fine but well as of yet nothing here.               <div id="wpfoot">         <?php                        //wp_head();              if ($userUsername ) {                      if ( strpos($_SERVER['REQUEST_URI'], '/blog/') === FALSE ){                               $dom = new DOMDocument();                     $dom->validateOnParse = true;                     $dom->loadHtml(file_get_contents("http://domain.xxx/blog/"));                     echo $dom->getElementById('wpfoot');                      }else{                     wp_footer();                 }             }              //          ?>     </div>


title: Trying to the deduce shortcode from a function

text: I have a theme where the wysiwyg button to insert the shortcodes is not appearing. I am trying to manually type in the shortcode that would output the tabs that I need. I am looking at the function that generates the shortcode to try deduce what that might be. The function is                   function display_tabs(){              var code        = '[tabs ';         var tab_names   = '';         var tabs        = '';         var tab_index   = 0;              $('.shortcode-dynamic-items').each( function(){                  $(this).children('.shortcode-dynamic-item').each( function(){                      tab_index++;                      tabs += '[tab id=' + tab_index + ']';                      //input loop for extra attrs                 $(this).children('#options-group').find('.attr').each( function(){                          if( $(this).attr('data-attrname') == 'tab_name' ){                              tab_names += 'tab' + tab_index + '="' + $(this).val() + '" ';                     }                      });                      // if the shortcode has content                 if( $(this).find('#shortcode-content').length > 0 ){                          tabs += $(this).find('#shortcode_content').val();                      }                      tabs += '[/tab]';                  })         });              code += tab_names + ']' + tabs + '[/tabs]';              return code;     }      I have tried a few attempts and have the tabs showing on the page but the content of the tabs is not showing and not toggling between them               [tabs 1 2 3]     [tab]Content for tab one goes here.[/tab]     [tab]Content for tab two goes here.[/tab]     [tab]Content for tab three goes here.[/tab]     [/tabs]      Is it possible to work out exactly what it should be from the function?


title: How to make the 'delete' button inactive on some categories?

text: As currently there's no way to declare any new custom post format in WordPress (3.9.1), is there a way I can make the 'delete' button on some categories inactive, so that the Editor can't remove them, and I can call them where necessary with their IDs without any hustle.   ![delete button in categories](http://i.stack.imgur.com/2rFwM.png) I just want it for some specific Categories only -- not for all.


title: url_to_postid redirected posts

text: i wanna url_to_postid some urls, it work pretty fine but when it come to auto- redirected posts it fail to return postid. here is my example urls:               http://animup.net/anime/kuroko-no-basket-2/      auto redirect into: (wordpress redirect old slugs into new slugs-like kuroko-no-basket-2 => kuroko-no-basket-2nd-season)               http://animup.net/anime/kuroko-no-basket-2nd-season/      but when i try this:               $url='http://animup.net/anime/kuroko-no-basket-2/';     $postid = url_to_postid( $url );       it return failure ( 0 ); * * * after more search i found _wp_old_slug meta, here is my custom function to return postid of redirected posts:               function url_to_postid_oldslug($slug){     $args = array(         'post_type' => 'any',         'numberposts' => 1,         'meta_key' => '_wp_old_slug',          'meta_value' => $slug     );          $posts=get_posts($args);          if ($posts){         return $posts[0]->ID;     }else{         return 0;      }


title: How to add 10 different css class to posts

text:
How I can assign a different css class to each post of the 10 posts of each blog page? Like this :
..
..     .     .     .
     --     Second page     --
..
..     ..      So on ! Thank You a lot for the help.


title: How to hide, and not to remove the attributes metabox?

text: I need to **hide** , and not to remove the attributes meta box in the backend. The following code is removing the metabox:               function hide_meta_box_attributes() {     remove_meta_box('pageparentdiv', 'post', 'normal'); }      add_filter('add_meta_boxes', 'hide_meta_boxes_attributes');      The problem is, that I am running hierarchical posts, which means I need to have the possibility to have posts and subposts which is enabled by this metabox. When I am removing the metabox, the functionality is not working anymore. But for my authors, I need to hide these attributes metabox. Anybody has a clue how to get a solution on this?


title: Determining Author post count

text: This is more of an efficiency question as the following code does do what I want.               $user_name = get_the_authour;     $query = new WP_Query('author_name=JustinH');             $author_post_count = $query->post_count;                  if ($author_post_count >= jwh_option('post_count_set') {                 $post_status = 'publish';             }else{                 $post_status = 'pending';             }      That query pulls back all the user meta and all the data for their posts. Is there a more precise way to get to:               $query->post_count;


title: Run shortcode before filters

text: My users post snippets code in comments. I created a shortcode for this :               function post_codigo($atts,$content=""){                  return ''.$content.'';     }          add_shortcode('codigo','post_codigo');        Problem is that html gets filtered before its wrapped into the code tags. I think that if i can get the shortcode run before filters then i can use               function pre_esc_html($content) {       return preg_replace_callback(         '#()(.*?)()#imsu',         create_function(           '$i',           'return $i[1].esc_html($i[2]).$i[3];'         ),         $content       );     }          add_filter(       'the_content',       'pre_esc_html',       9     );      that i found around here. What you think? UPDATED: Ok now i changed my shortcode to:                function post_codigo($atts,$content=""){                      return ''.esc_html($content).'';         }              add_shortcode('codigo','post_codigo');      But it still adding breaks and breaking the whole code into several `` tags


title: Just created a Wordpress Table can't get $wpdb get row to work - need help

text:
I will begin by saying this is unfinished, and I am new to web programming. That being said, I am trying to create a javascript slide show that remembers the last slide a Wordpress (loggedin user) was viewing. I have hand entered one record into a new Wordpress table called wp_slideshow. The columns in that table are user and last_slide. The current data is one record, user = admin, last_slide = 3. I just want to get the current userid that is logged in from wordpress and then get the last_slide number. Once I get it I need to integrate the last slide into my javascript code and begin displaying the last slide. Any suggestions on why my current code (just for getting one record from my wp_slideshow table does not work? Here is my code:                   <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                      <?php the_content(); ?>                 <?php edit_post_link('Edit.', '
', '
');?>                      <?php global $current_user;?>                 <?php get_currentuserinfo();?>                 <?php $user_id = $current_user->ID;?>                      <?php global $wpdb;?>                 <?php                  $thenbr = $wpdb->get_row( $wpdb->slideshow( "SELECT * FROM $wpdb->slideshow WHERE user = "admin"" ) );                 echo $thenbr->last_slide;                  ?>

                  <FORM NAME="joe">             <INPUT TYPE="text" WIDTH="300" NAME="burns" VALUE="Text For Picture One">             </FORM>                   Back                   Next
         <?php endwhile; endif; ?>


title: How to display TinyMCE HTML view?

text: I'm displaying TinyMCE in my plugin's settings using wp_tiny_mce():               <?php wp_tiny_mce( false , array("editor_selector" => "a_nice_textarea"));?>          <textarea class="a_nice_textarea" id="a_nice_textarea" name="a_nice_textarea"></textarea>      Everything works as expected but I want to display the HTML editor ONLY but wp_tiny_mce seems to output only the Visual Editor. I know these are initial settings, but I've been playing with them for some time now without any luck:               // TinyMCE init settings     $initArray = array (         'mode'                              => 'none',         'onpageload'                        => 'switchEditors.edInit',         'width'                             => '100%',         'theme'                             => 'advanced',         'skin'                              => 'wp_theme',         'theme_advanced_buttons1'           => "$mce_buttons",         'theme_advanced_buttons2'           => "$mce_buttons_2",         'theme_advanced_buttons3'           => "$mce_buttons_3",         'theme_advanced_buttons4'           => "$mce_buttons_4",         'language'                          => "$mce_locale",         'spellchecker_languages'            => "$mce_spellchecker_languages",         'theme_advanced_toolbar_location'   => 'top',         'theme_advanced_toolbar_align'      => 'left',         'theme_advanced_statusbar_location' => 'bottom',         'theme_advanced_resizing'           => true,         'theme_advanced_resize_horizontal'  => false,         'dialog_type'                       => 'modal',         'relative_urls'                     => false,         'remove_script_host'                => false,         'convert_urls'                      => false,         'apply_source_formatting'           => false,         'remove_linebreaks'                 => true,         'paste_convert_middot_lists'        => true,         'paste_remove_spans'                => true,         'paste_remove_styles'               => true,         'gecko_spellcheck'                  => true,         'entities'                          => '38,amp,60,lt,62,gt',         'accessibility_focus'               => true,         'tab_focus'                         => ':prev,:next',         'content_css'                       => "$mce_css",         'save_callback'                     => 'switchEditors.saveCallback',         'wpeditimage_disable_captions'      => $no_captions,         'plugins'                           => "$plugins"     );      Here's even a pretty good explanation of the problem and kind of a solution, but the code provided doesn't work for me either (and doesn't do exactly what I want to achieve): http://keighl.com/post/switching-visualhtml-modes-with-tinymce/ Any hints?


title: Setup page template array in a custom post type

text:
Hi below is a 'case' (in a custom post type) for pulling all categories and displaying them as a drop-down menu. How can I do the same but turn it into a list of checkboxes?                   //tax_select - this lists all of the categories in a drop-down, we want to change to a checkbox     case 'tax_select':     echo '<select name="'.$field['id'].'" id="'.$field['id'].'">             //<option value="">Select One</option>'; // Select One     $terms = get_terms($field['id'], 'get=all');     $selected = wp_get_object_terms($post->ID, $field['id']);     foreach ($terms as $term) {         if (!empty($selected) && !strcmp($term->slug, $selected[0]->slug))             echo '<option value="'.$term->slug.'" selected="selected">'.$term->name.'</option>';         else             echo '<option value="'.$term->slug.'">'.$term->name.'</option>';     }     $taxonomy = get_taxonomy($field['id']);     echo '</select>
Manage '.$taxonomy->label.'';     break;      How I'm saving the data:                   // Save the Data     function save_custom_meta($post_id) {     global $custom_meta_fields;          // verify nonce     if (!wp_verify_nonce($_POST['custom_meta_box_nonce'], basename(__FILE__)))         return $post_id;     // check autosave     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)         return $post_id;     // check permissions     if ('page' == $_POST['post_type']) {         if (!current_user_can('edit_page', $post_id))             return $post_id;         } elseif (!current_user_can('edit_post', $post_id)) {             return $post_id;     }          // loop through fields and save the data     foreach ($custom_meta_fields as $field) {                 if($field['type'] == 'tax_select') continue;         $old = get_post_meta($post_id, $field['id'], true);         $new = $_POST[$field['id']];         if ($new && $new != $old) {             update_post_meta($post_id, $field['id'], $new);         } elseif ('' == $new && $old) {             delete_post_meta($post_id, $field['id'], $old);         }     } // end foreach              // save taxonomies     $post = get_post($post_id);     $category = $_POST['category'];     wp_set_object_terms( $post_id, $category, 'category' );     }     add_action('save_post', 'save_custom_meta');


title: Child and grandchild taxonomy listings - 404

text: I have the following structure:   * Hotels (custom post type)   * Continents (taxonomy) Working actual links examples leading to single post: _hotels/europe/france/a-hotel_ *hotels/europe/italy/firenze/a-hotel* Problem: getting 404 when trying to access childs and grandchilds listings:   * _hotel/europe_ - **works!**   * _hotel/europe/france_ - **404**   * _hotel/europe/france/paris_ - **404** Not sure if something is missing, should I use a page template for those access points? The code was hard to get working, thanks for examples around here: http://pastebin.com/WYJLYjHM Thanks for any help.


title: Using Output from one Function and calling it into another

text: I'm trying to get my head around a fairly simple concept in PHP but I'm pretty green. I have a function..               function pa_insertPage($atts, $content = null) {         // Default output if no pageid given         $output = NULL;         // extract atts and assign to array         extract(shortcode_atts(array("page" => '2404' // Value for Course Descriptions page         ), $atts));         // if a page id is specified, then run query         if (!empty($page)) {             $pageContent = new WP_query();             $pageContent->query(array('page_id' => $page));             while ($pageContent->have_posts()) : $pageContent->the_post();                 // assign the content to $output                 $output = apply_filters( 'the_content', get_the_content() );             endwhile;         }         return $output;     }      And I'd like to use the returned `$output` from this function in another function called `naada_assess()` In my `naada_assess` function I've called `$recClasses = pa_insertPage($output);` but that doesn't seem to do the trick.


title: add_image_size() to crop images into squares?

text: So I know about setting custom images with `add_image_size('name',X,Y,Crop?)` which is cool but I need to build something that will crop images, regardless of their size, into squares. Basically, I want to make sure the user's uploaded images will always be squares.


title: What is best for saving lot of extra detail of user?

text: In my site i need to store 200 extra data for each user. Now i know about the user meta option. But is it a good way to save 200extra field for each user? Or should i create an extra table in the database to do the work.


title: Edit Media - Edit Custom Sized Featured Images

text: When I edit images in the wordpress backend - crop, aspect ratio etc. my featured images don't change. I've tried all combinations of saving (All image sizes, Thumbnail, All sizes except thumbnail). How can I make these changes effect my featured image? This featured image is a custom size using add_image_size() eg. `add_image_size( 'featured', 638, 300, true );`


title: Plugin could not be deleted due to an error: Could not fully remove the plugin(s) my-plugin/my-plugin.php

text: Why uninstalling the following (empty) plugin results in error? Here is `my-plugin/my-plugin.php`:               <?php     /*     Plugin Name: My Plugin     */      and `my-plugin/uninstall.php`:               <?php      When I click 'Delete' and then confirm, I get the following error: > Plugin could not be deleted due to an error: Could not fully remove the > plugin(s) my-plugin/my-plugin.php. What's wrong here? * * *               ~/Sites/wordpress/wp-content/plugins/my-plugin $ ls -ll     total 16     -rwxrwxrwx@ 1 me  staff  34 13 Aug 21:43 my-plugin.php     -rwxrwxrwx@ 1 me  staff   6 13 Aug 21:44 uninstall.php


title: Cannot login to admin panel in multisite install if subdomain is added to hosts file

text: This is my case.I created a multi-site installation where users can register and be provided with a subdomain. As of this time, the administrator has not yet enable the creation of sub-domains in the apache configuration, so I manually added the newly created subdomains (from my testing) to my hosts file. After registration, it works but it will only access the front end. If I will logged-in, e.g. http://mysubdomain.mymultisiteexample.com/wp-admin, it won't allow me to logged-in to the backend even though the logged-in details are correct? Any clues what is causing this? Is this related to a cookie? Thanks for any ideas..


title: Updating shortlinks from staging

text: Many of the shortlinks on pages of our site are links to our staging site. The current live site started life as the staging version, so I imagine that's why, but I don't know how to fix the issue. Does anyone have any tips as to how to achieve this? **Update** Apologies, this is actually the http://wp.me/... shortlinks created and added to the head of pages by Jetpack. I need to know how to clear/update these, to reflect the change of domain (from staging to production). Hope this is now clearer.


title: Editor capabilities - admin_init

text:
I'm having a little difficulties with roles and capabilities. Editors gets a 'Cheatin uh?'-message when they try to update the custom theme- settings. Can anyone explain why - or maybe even have a solution?               <?php     add_action('admin_menu', 'add_global_custom_options');     function add_global_custom_options() {     add_menu_page('Indstillinger', 'Indstillinger', 'moderate_comments', 'functions','global_custom_options');     }          add_action('admin_init', 'custom_settings_css');     function custom_settings_css() {     wp_enqueue_style('custom-settings-css', get_bloginfo('template_directory') . '/theme-files/css/custom-settings.css');     } ?>          <?php     function global_custom_options()     {?>

Indstillinger
         <form method="post" action="options.php">             <?php wp_nonce_field('update-options') ?>

Settings

BOXIT
                     <textarea name="box1" size="45"><?php echo get_option('box1'); ?></textarea>

<input type="submit" name="Submit" value="Gem indstillinger" />
             <input type="hidden" name="action" value="update" />             <input type="hidden" name="page_options" value="box1" />         </form>
     <?php}?>


title: How to set up WP Cron in this scenario

text: I wanted to use Wordpress built in WP Cron to update currency rates daily. I use this function currently,               require_once(WP_PLUGIN_DIR . '/autocurupdate/currencyexchange_class.php');     $cx=new currencyExchange();     $cx->getData();     $currency_sql = "select last_updated from " . $wpdb->prefix."currencies where code = 'PHP'";     $currency_1 = mysql_query($currency_sql);     $currency_2 = mysql_fetch_array($currency_1);     $last_updated = mysql2date(get_option('date_format'), $currency_2['last_updated']);     $current_date = $cx->Date;     $currentdate = mysql2date(get_option('date_format'), $current_date);     if($last_updated !== $currentdate) {     update_currency();     }      How can I run `update_currency()` function daily using WP Cron?


title: How to highlight most recent posts in a list

text:
I want to be able to highlight the most recent post in a list of recent posts. By highlight I mean bold or style slightly differently from the other posts. This is the code I use now:
Assignments

     <?php         $recentPosts = new WP_Query();         $recentPosts->query('showposts=15&cat=188&order=ASC');     ?>     <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>
     <?php endwhile; ?>
      This simply returns a numbered list. I would like to style differently the most recent post (i.e. the last item on the list). How can this be done?


title: esc_sql inserting weird chars to DB

text: I am using esc_sql function for making safer SQL operations but i am mysteriously getting `? and  ` in the DB table how can i avoid them. Edit : Here is my array after esc_sql()                 Array     (         [image_main] => http://market.watchprosite.com/img/watchprosite/market/23/post/market_image.3444923.jpg         [0] => Rolex  (more) \n\n\n         [1] => WG Submariner dial (only)         [2] => 116619         [3] => MINT         [4] =>           [5] =>           [6] =>           [7] =>           [8] => WTB: Want To Buy         [9] => Aug 7, 2013, 7:00 AM         [10] => EUR 1,000&nbsp(in USD)         [11] => EUR  *(estimate)\n         [12] =>           [description] => Looking for a spare dial from a Rolex Submariner 116619 (white gold). Urgently! Plenty of references available as a good buyer and seller and I expect the same from you. Thanks in advance!!!! Carl     )      I am using this function for applying esc_sql for each value.               public static function sanitizeInput($key='',$value=''){             return trim(esc_sql($key));         }      Here is the actual query which is generating :               INSERT INTO tbl_scrubed_data SET                                               keywords='{"brand":"rolex","model":"","WTB":1,"FS":0}',                                              url_to_post='http://market.watchprosite.com/?show=collection.detail&id=163938&brandview=Rolex&mod=&series=+WG*+WG+Submariner+dial+%28only%29&p=Rolex+WG*',                                              description='Looking for a spare dial from a Rolex Submariner 116619 (white gold). Urgently! Plenty of references available as a good buyer and seller and I expect the same from you. Thanks in advance!!!! Carl',                                              date_captured=now(),crawl_id='6',                                              image_main='http://market.watchprosite.com/img/watchprosite/market/23/post/market_image.3444923.jpg',                                              images='["http:\/\/market.watchprosite.com\/img\/watchprosite\/market\/23\/raw\/market_image.3444923.jpg"]',brand='Rolex  (more)',                                              series='WG Submariner dial (only)',model='116619',                                              watch_condition='MINT',box=' ',                                              papers=' ',year=' ',case_size=' ',status='WTB: Want To Buy',listed='Aug 7, 2013, 7:00 AM',                                              asking_price='EUR 1,000&nbsp(in USD)',retail_price='EUR  *(estimate)',payment_info=' ',forum_id='1'      This is working good in phpmyadmin.


title: How To Remove WordPress Version From The Admin Footer

text: Is there anyway to remove version number from the right side of WordPress admin footer? I know this code will add some text before the version number, but it will not remove it:               function change_footer_version() {echo 'Anything ';}     add_filter( 'update_footer', 'change_footer_version', 9999);      And the following code will do nothing"               function change_footer_version() {return ' ';}     add_filter( 'update_footer', 'change_footer_version', 9999);      So, is there anyway to remove the entire from the template or anything with functions.php file? Thanks for your time!


title: Get current user array into hyperlink

text:
I am unsure how to take data from the user array and place some of these values into the following hyperlink. I want to replace the email address, first name and last name with the values from the currently logged in user array.                         <?php     $current_user = wp_get_current_user();     /**      * @example Safe usage: $current_user = wp_get_current_user();      * if ( !($current_user instanceof WP_User) )      *     return;      */     echo 'Username: ' . $current_user->user_login . '
';     echo 'User email: ' . $current_user->user_email . '
';     echo 'User first name: ' . $current_user->user_firstname . '
';     echo 'User last name: ' . $current_user->user_lastname . '
';     echo 'User display name: ' . $current_user->display_name . '
';     echo 'User ID: ' . $current_user->ID . '
';          ?>


title: Customizing the built-in Media Playlist

text: I have a simple challenge I can't quite seem to make any progress on: **Get the current track (or video) playing and display a link to a transcript of the song.** This should be a simple task (and the solution might very well be simple). I'm using the default media player for Wordpress. Options I've thought of so far:   1. Hooks. I don't see any I could use, yet there's a million other hooks for everything else. For example, use a filter hook when the current title changes, grab the current title, display the link underneath the title. This would be the preferrable method as I could simply name the transcript files the same.   2. Jquery. Use some sort of change event for the current track element and display a transcript link of the same name. Couldn't get this to work.    3. Custom Media Fields. Add the URL into a custom field for each media element. A more manual process, but I'd be OK with this. But this kind of relies on getting the PHP/Javascript correct which I've had trouble with (see above). Any help is appreciated.


title: Font Face Doesn't want to work in Wordpress

text: I do have a font I want to use with my links. Somehow it doesn't work.               @font-face {           font-family: HelveticaNeueLight;           src: local('fonts/HelveticaNeueLight.ttf');        }      My font path is: `wp-content/themes/mytheme/fonts/HelveticaNeueLight.ttf`, and I used it like this-               .jplnav li a {          font-family: HelveticaNeueLight;        }      Browser: Chrome Is there some kind of special code to use?


title: 2nd and 3rd Custom Post Type URL's 404ing

text: My first CPT saves its URL's exactly as expected. However, I have worked for 2 days on getting my second and third Custom Post Type URL'S to rewrite correctly. They do in fact save as expected in edit.php like this:               www.domain.com/things/postname/      **However it is 404ing when I view the page.** I have used               global $wp_rewrite;          $projects_structure = '/%things%/';     $wp_rewrite->add_rewrite_tag("%things%", '([^/]+)', "things=");     $wp_rewrite->add_permastruct('things', $projects_structure, false);       **Why won't the other CPT URL's rewrite?** For my "food" CPT I am using               'rewrite' => array(         'slug' => 'food',        'with_front' => false,        'feed'=> true,          'pages'=> true      ),       and have also tried               global $wp_rewrite;          $projects_structure = '/food/%food%/';     $wp_rewrite->add_rewrite_tag("%food%", '([^/]+)', "food=");     $wp_rewrite->add_permastruct('food_pt', $projects_structure, false);      Brand new WP install, I have checked my htaccess               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      I have manually flush_rewrite_rules(); and my settings->permalink structure is               /%year%/%postname%/      I have read everything that Google can get me and just don't get understand. Any help would be great.


title: Can't edit images

text: Two days ago I discovered a huge problem with my Wordpress media editor. I just can't edit any image because it doesn't appear. Wordpress shows only small icon of broken picture... I was looking for the problem and now I'm pretty sure functions.php file causes my problem. I realized when I remove functions.php - problem disappear too. But what is strange - editor doesn't work when functions.php is EMPTY. I tried everything. I turned off all of my plugins, but I can't rid of my functions.php, because It's too important for me. On the other hand the problem with images is really irritating... Thanks in advance.


title: Get list of years when posts have been published

text: I want to create a list of posts from a Custom Post Type and add some filters the user can click to filter the list. I added filters for all the categories by using the get_terms() function. Now I want to add filters by year, so I need a way to retrieve a list of all the years in which at least one post has been published... I just need something like:               $years = get_all_years_with_posts();     // returns array( 2011, 2013, 2014 )      I know I can grab all the posts, check their year, and build the list myself, but is not there any other approach?


title: Best Practise: Linking to WPMU sites from other sites

text: I'm digging through WPSE, and WP Codex/Core, and I am looking for essentially `wpmu_blog_link( $blog_id )`, which would essentially be `home_url()` with a parameter to pass the `blog_id`. I could easily just do               Link to blog 2      but it seems a little more hard-coded than necessary, and would break between development (localhost) and live. There's always               function blog_home_url( $blog_id ) {         switch_to_blog( $blog_id );         $url = home_url();         restore_current_blog();         return $url;     }          ...          <a href="<?php echo blog_name_url( 2 ) ?>">Link to Blog 2      Just seeing if there is anything built-in.


title: post edit button on front end

text: If you are logged-in and switch to the front-end the default Wordpress theme `Twenty Eleven` provides `edit` buttons next to every post. Pressing this button you get to the certain post's back-end post edit page. How to implement this into a custom template?


title: Remove Posts Without Comments

text: I would like to have any posts that contain 0 comments be deleted on a regular and ongoing basis. My blog is currently using a combination of a cron job and the following snippet added to functions file to publish a basic post; I need for that post to be removed when no comments are added for that 24 hour day - so the next day, if no comments have been added, post is deleted. //-- Auto_Post Snippet --// add_action('wp_auto_post', 'my_auto_post'); function my_auto_post() { // Create a post object $my_post = array( 'post_title' => 'Click Here to submit a concern.', 'post_content' => '', 'post_status' => 'publish', 'post_author' => 1, 'post_category' => array(8,39) );               // Insert the post object into the database     $post_id = wp_insert_post( $my_post );     wp_publish_post( $post_id );      } //--//


title: wp_register_script and wp_register_style when shortcode is used

text: hi so I used a great tutorial off of http://scribu.net/wordpress/optimal- script-loading.html and I am having trouble loading the scripts when a shortcode called lightbox is used here is my code. I am at the page when it is called wanted to check with someone to see if it is properly written.               class fancy{         static $add_script;              static function init() {             add_shortcode('lightbox', array(__CLASS__, 'handle_shortcode'));                  add_action('init', array(__CLASS__, 'register_script'));             add_action('wp_footer', array(__CLASS__, 'print_script'));         }              static function handle_shortcode($atts) {             self::$add_script = true;                  // actual shortcode handling here         }              static function register_script() {         wp_register_script('fancy-wheel', get_stylesheet_directory_uri('/js/jquery.mousewheel-3.0.6.pack.js', __FILE__), array('jquery'), '3.06', true);         wp_register_script('fancybox', get_stylesheet_directory_uri('/js/jquery.fancybox.js', __FILE__), array('jquery'), '1.0', true);         wp_register_script('fancy-buttons', get_stylesheet_directory_uri('/js/jquery.fancybox-buttons.js', __FILE__), array('jquery'), '1.0', true);         wp_register_script('fancy-media', get_stylesheet_directory_uri('/js/jquery.fancybox-media.js', __FILE__), array('jquery'), '1.0', true);         wp_register_script('fancy-thumbs', get_stylesheet_directory_uri('/js/jquery.fancybox-thumbs.js', __FILE__), array('jquery'), '1.0', true);         wp_register_style('fancy-css', get_template_directory_uri('/css/jquery.fancybox.css', __FILE__), array('css'), '1.0', true);          wp_register_style('fancy-buttons', get_template_directory_uri('/css/jquery.fancybox-buttons.css', __FILE__), array('css'), '1.0', true);          wp_register_style('fancy-thumbs', get_template_directory_uri('/css/jquery.fancybox-thumbs.css', __FILE__), array('css'), '1.0', true);           }     static function print_script() {         if ( ! self::$add_script )             return;              wp_print_scripts('fancy-wheel','fancybox','fancy-buttons','fancy-thumbs','fancy-css','fancy-buttons','fancy-thumbs');         }     }          fancy::init();


title: Wordpress Specified file failed upload test

text: I am trying to upload a excel file to wordpress, i am getting error: "Specified file failed upload test.", .xls format file cannot be uploaded?? How do get arround it?


title: How to use checked() function with multiple check box group? How to properly sanitize that checkbox group?

text: I'm using the theme options page from the underscores (_s) theme to build a theme options page and I have a group of check boxes on it. In the example below I've just included 2 for simplicity. My questions are:   1. What goes in the checked() function below to keep each check box checked when saved? I have to check each value against the value in the DB correct?   2. How do I properly sanitize the group of checkboxes? They seem to save to the DB fine, but I know I'm doing something wrong. Here's each relevant block of code:               // register setting     register_setting(         'options', // Options group         'theme_options', // Database option         'theme_options_validate' // The sanitization callback, see below     );          // add settings field     add_settings_field(         'post_sharing_networks',         'Post Sharing Networks To Show',         'settings_field_post_sharing_networks', // callback below         'theme_options',         'general'     );          // set up the array     // more will be added later. 2 shown here for simplicity     function post_sharing_networks() {              $post_sharing_networks = array(             'twitter' => array(                 'value' => 'twitter',                 'label' => 'Twitter'             ),             'facebook' => array(                 'value' => 'facebook',                 'label' => 'Facebook'             ),         );              return $post_sharing_networks;     }          // callback          function settings_field_post_sharing_networks() {              $options = get_option( 'theme_options' ); // get array of all the theme options              $post_sharing_networks = $options['post_sharing_networks']; // this will get array for just the post sharing networks          // eg         /*         array (size=2)       'twitter' => string '1' (length=1)       'facebook' => string '1' (length=1)     */              // builds the checkbox list form the post_sharing_networks() function         foreach ( post_sharing_networks() as $network ) { ?>                 <label>                  <input type="checkbox" value="1" name="theme_options[post_sharing_networks][<?php echo esc_attr( $network['value'] ); ?>]" <?php checked( /* what goes in here for this to work? */ ); ?> />                      <?php echo $network['value']; ?>             </label>              <?php }     }               // sanitization callback     function theme_options_validate( $input ) {              $output = array();              // how do I properly sanitize the checkbox group?             // it saves the checkboxes to DB fine currently but I think it can be improved         $options = get_option( 'theme_options' );              foreach ( post_sharing_networks() as $network ) {                  if ( isset( $options['post_sharing_networks'] ) )                 $output['post_sharing_networks'] = $input['post_sharing_networks'];              }              return apply_filters( 'theme_options_validate', $output, $input );          }         This is what it looks like when saved into the wp_options table               s:21:"post_sharing_networks";a:2:{s:7:"twitter";s:1:"1";s:8:"facebook";s:1:"1";}


title: load-* hook for dashboard

text: I'm trying to add a screen option to the dashboard screen. I have a function like:               my_function() {              ...         add_screen_option()         ...          }      Now, I need to know the correct action hook $hook to use hooking in my function when the dashboard screen is loaded:               add_action( "load-$hook", 'my_function' );      What should $hook be?


title: Using add_theme_support inside a plugin

text: I've created a custom post type as a plugin and released it into the repository. One of the core features involves using a featured image. I've added `thumbnail` to `$supports` in `register_post_type()`, so the meta box shows up in the Administration Panel. I'm also hooking into `after_setup_theme` and calling `add_theme_support( 'post-thumbnails' )`, but I don't think it's taking affect. The codex says you have to call it from the theme's functions.php file, but if that's true then it'll only work if the user's theme calls `add_theme_support( 'post-thumbnails' )` (which would cover _all_ post types. If the theme doesn't call it, or only calls it on a specific type, then it won't work. Does anyone see a way around this problem?


title: Script that gets the first tag of post and query all other posts with the same tag

text:
The script gets the first tag of a post and retrieves in a wordpress loop all other posts with the same tag. I can't seem to get it working:( Any ideeas?               $posttags = get_the_tags();     $count=0;     if ($posttags) {       foreach($posttags as $tag) {         $count++;         if (1 == $count) {           $tag = $tag->name . ' ';         }       }     }     query_posts('tag='.$tag.''&'showposts=-1');          while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
          <? endwhile;      wp_reset_query();       Take care


title: How to display regular posts & custom post types that fall under a category using just the generic category template?

text: 1) My site has posts, and 2 custom post types (news & essays) 2) They all share normal categories like sports & health (no custom taxanomy involved) 3) Using the generic category.php template, how do I make it so this template handles all categories while displaying all content falling under it regardless of content post type. Or simply, I would like the generic category.php template to handle all category displays but should include custom post types as well. This may be a stupid question but have returned to Wordpress after a long hiatus and am finding the default wordpress themes hard to understand to do this. Just confused and frustrated right now. Please help


title: How to show link to next posts in single.php

text: I can't get `get_next_posts_link` to work. shouldn't his code work?               <?php echo  get_next_posts_link(); ?>      Well, I am trying to get next 5 posts, any idea how? EDIT: Accroding to:               <?php next_post_link('<strong>%link</strong>', '%title', TRUE); ?>      Should show me a link to next post in the same category, when I do this nothing is shown. And I do have posts in the category. Thanks!


title: Update meta values with AJAX

text: I am working on a voting system in Wordpress. I first made it with `GET` requests but someone told me you should not use `GET` for this, So I started working with AJAX to update custom fields/meta values, after reading this article. I've read a lot of the documentation from jQuery and Wordpress AJAX pages this is with I have now. I think I am on the good way, but there is something missing / or I am doing wrong. The vote function works fine, because I have tested this earlier with the `GET` requests. I have this simple HTML test form:               <form id="vote_form" method="post">         <input type="hidden" id="id" name="id" value="810">         <input type="hidden" id="post_id" name="post_id" value="811">         <input type="submit">     </form>      I have this jQuery file included in my header.php and off course included the jQuery library itself.               jQuery(document).ready(function() {              jQuery( "#vote_form" ).submit( function( event ) {                  event.preventDefault();                  var id = jQuery("#vote_form #id").val();             var post_id = jQuery("#vote_form #post_id").val();             var vote = 'up';                  jQuery.ajax({                 type: "POST",                 url: stn_vote.ajaxurl,                 data: {                      id: id,                      post_id: post_id,                     vote: vote,                      action: 'stn_voting'                  },                  });               });          });      And my vote function hooked into the `wp_ajax` action.                   // Ajax Voting     wp_register_script( 'ajax-vote', get_template_directory_uri() . '/js/ajax-vote.js', array('jquery') );          $nonce = wp_create_nonce("vote_nonce");     $stn_vote_data = array(         'ajaxurl' => admin_url( 'admin-ajax.php'),         'nonce' => $nonce,     );     wp_localize_script( 'ajax-vote', 'stn_vote', $stn_vote_data );          function stn_script_enqueuer() {             wp_enqueue_script( 'jquery' );         wp_enqueue_script( 'ajax-vote' );          }     add_action( 'wp_enqueue_scripts', 'stn_script_enqueuer' );                  // Vote Up             if( isset( $_POST['id'] ) ) {                      //simple Security check                 if ( ! wp_verify_nonce( $_POST['nonce'], 'vote_nonce' ) )                     die ( 'Busted!');                      if( isset( $_POST['post_id'] ) ) {                     $post_id =  $_POST['post_id'];                 }                      if( $_POST['vote'] == 'up' ) {                          $vote_id = $_POST['id'];                     $key = 'vote_up_' . $post_id;                     $vote_up = get_post_meta( $vote_id, $key, true );                     $value = $vote_up + 1;                     $update_vote_up = update_post_meta( $vote_id, 'vote_up_' . $post_id, $value );                          // Update vote count                     $vote_count = get_post_meta( $vote_id, 'vote_count_' . $post_id, true );                     $value = $vote_count + 1;                     $update_vote_count = update_post_meta( $vote_id, 'vote_count_' . $post_id, $value );                          // Update vote percent                     $vote_percent = ( ( $vote_up + 1) / ( $vote_count + 1 ) ) * 100;                     update_post_meta( $vote_id, 'vote_percent_' . $post_id, $vote_percent );                      }                      // Vote Down                 else {                               $vote_id = $_POST['id'];                     $key = 'vote_down_' . $post_id;                     $vote_down = get_post_meta( $vote_id, $key, true );                     $value = $vote_down + 1;                     $update_vote_down = update_post_meta( $vote_id, 'vote_down_' . $post_id, $value );                          // Update vote count                     $vote_count = get_post_meta( $vote_id, 'vote_count_' . $post_id, true );                     $value = $vote_count + 1;                     $update_vote_count = update_post_meta( $vote_id, 'vote_count_' . $post_id, $value );                          // Update vote percent                     $key = 'vote_up_' . $post_id;                     $vote_up = get_post_meta( $vote_id, $key, true );                     $vote_percent = ( $vote_up / ( $vote_count + 1 ) ) * 100;                     update_post_meta( $vote_id, 'vote_percent_' . $post_id, $vote_percent );                      }             }             die();              }         add_action('wp_ajax_stn_voting', 'ajax_stn_voting');         add_action('wp_ajax_nopriv_stn_voting', 'ajax_stn_voting');


title: Why does `inclusive` not work in this wordpress loop?

text: It's seemingly simple, I have this loop which should loads posts from, and including the current post.               <?php     $categories = get_the_category();     foreach( $categories as $category ) {       $catID[] = $category->cat_ID;     }      $args = array(         'category__in' = > $catID,         'category__not_in' = > 1,         'posts_per_page' = > 10,         'date_query' = > array(             array(                 'before' = > get_the_date()             ),             'inclusive' = > true,          )     );     $loop = new WP_Query($args);     while ($loop -> have_posts()) {     $loop -> the_post();       get_template_part( 'sidebar-posts-template' );     }     wp_reset_postdata();     ?>      The problem is that it doesn't **include** the current post. Why? Edit: This loop, using a fixed date also does not work and will start loading posts from the 27th, not including the 28th. The `inclusive` date should include posts from the 28th.               $args = array(         'date_query' = > array(             array(                 'after' = > 'January 1st, 2013',                 'before' = > array(                     'year' = > 2013,                     'month' = > 2,                     'day' = > 28,                   ),                 'inclusive' = > true,              ),          ),         'posts_per_page' = > -1, );      Edit 2: This is now the loop I am using.               $args = array(         'category__in' => $catID,         'category__not_in' => 1,         'posts_per_page'=>10,         'date_query' => array(             array(                 'before' => get_the_date(),                 'inclusive' => true,              ),         )     );      Edit 3:               $args = array(         'posts_per_page'=>10,         'date_query' => array(             array(               'before'    => array(              'year'  => 2013,              'month' => 2,              'day'   => 28,                ),               'inclusive' => true              ),          )     );


title: Changing the order of widgets according to current page?

text: I would like to change the order of the widgets, for instance: **Front-Page** : Recent Posts Recent Comments **Single Post** : Recent Comments Recent Posts Is it possible to achieve this?


title: How do i set up multiple portfolios (each with its own defined set of images -) to display on the same page?

text: I want to have one multi-column portfolio page but within each column or cell is a defined set of images for that particular category (or event) I do not want to rotate through images and see ones from another cell or column it would be like having multiple photo albums accessible on the same page. I think this can be done using categories but I dont seem to be able to assign more than one category to a page and have the portfolio display each category as a separate set of images. Thank you


title: List custom field values in alphabetical order without repetition

text: The function below lists the custom fields as in this example:   * Frank Capra   * Alfred Hitchcock   * Woody Allen   * Woody Allen   * Frank Capra   * Pedro Almodóvar   * Pedro Almodóvar I introduce the values in alphabetical order and without repetition. Eg:   * Alfred Hitchcock   * Frank Capra   * Pedro Almodóvar   * Woody Allen * * * This is the code:               <?php     $movie_reviews = get_posts('numberposts=-1&orderby=post_name&order=ASC');     foreach($movie_reviews as $post) : setup_postdata($post);     ?>     <li>     <?php $director = get_post_meta($post->ID, "director", $single = true);     if($director !== '') {     echo $director;     } ?>     </li>     <?php endforeach; ?>     </ul>      Is this possible? Grateful for any help.


title: Reset form on onclick function

text: I have a problem. I want to have an reset/clear button in my form, but it won''t work.. http://pastebin.com/jc0yqXiq Line 1-8 is the php for my form on line 94-97                 <form id="myForm" method="post" action="" onSubmit="if(!confirm('Är du säker på att du vill acceptera budet?')){return false;}">        <input type='text' value="1" value='<?php echo $doors ?>' name='doors[<?php echo $auto->ID; ?>]'>        <input type="button" onclick="" value="Neka bud"> - <input type='submit' value='Godkänn bud' />     </form>          <?php     if ( isset( $_POST['doors'] ) ){       // verify nounce prob a good idea         foreach($_POST['doors'] as $item=>$key) {             $id= sanitize_text_field($item);             update_post_meta( $id, 'doors', sanitize_text_field( $key ) );         }       }     ?>      Any suggestions to what the problem might be :)


title: How to change the default home page for the WordPress Dashboard?

text: Is it possible to change the Default "Home" admin page when logging into the WordPress Dashboard? I thought about a couple of possibilities...   1. Substitute the content on the Dashboard home page with custom content.   2. Redirect to a different admin page within the WordPress Dashboard upon successful login. If it is possible to do either of the two options, what hooks would you recommend utilizing?


title: avi mp4 flv video player

text: I want to uploads videos from admin and show them using any video player. I used a plugin but when i tried uploding a video the message appers that uplod size exceeded. Can anybody suggest me any good video player plugin.


title: Custom field with Types: get custom field's value label (of type select)

text: We use the Types plugin to setup different custom products for a client. A certain custom post (product) contains some custom fields which is a drop-down select. When creating a new product of this type, the user may select one option from that list. For example, let say that certain product has a custom field of type select with the following options set :               1 = Option A     2 = Option B     3 = Option C      Now, in a template, I'm trying to display the label for that custom field. The best thing I came up with is by doing :               $value = reset(get_post_custom_values('custom_field', $post->ID));      which would return a string, for example `"1"`, the value of the custom field. Now, this is worthless as I need to display the label (the chosen item from the list, for example `"Option A"`) in that template. How do I find the associated label for that custom field value?


title: How to use "offset" to paginate get_users?

text:
Is is possible to paginate the get_users function with the "offset" parameter? I have complete my custom query of users for my list and now I need to paginate the results into multiple pages. Here is my sample code:
         <?php              $args = array(             'meta_key' => 'jabber',             'meta_value' => 'User Name',             'meta_compare' => 'LIKE',             'order' => 'ASC',             'count_total' => true,             'fields' => 'all',           );                   $blogusers = get_users($args_1);         foreach ($blogusers as $user) {                  $user_id = $user->ID;              $user = get_userdata($user_id);                    echo '
' . $user->display_name . '
';              }         ?>
      If there's anyone you can give some advice I would appreciate it. Thanks in advanced.


title: Compare post-IDs within WP_Query? (Less than / Greater than)

text: Can I use `WP_Query` to only query posts less than (or greater than) a given post ID?               $filtered_query_args = array(         'post_type' => 'projects',         'order' => $prev_next=='next' ? 'DESC' : 'ASC',         'orderby' => 'ID',         // ID <= $post->ID     );      I've been digging around in the codex with no luck. I can of course do this conditionally within the loop, but it would be much cleaner if I could use `WP_Query` directly.


title: Email entire post contents

text: We're a small newspaper with our archives put into a localhost WordPress web server in-house. I'm looking for some sort of plugin that might allow the reporters to, say, click a button that would email them the contents of the entire post to themselves (not just a link, as the server is not connected to the rest of the world). Any ideas? TIA


title: Which theme foundry has clean coded themes, where code is poetry

text: I'm looking to find a theme foundry (ie. woothemes, elegant themes) that has themes that are very well coded; where "code is poetry". To be more precise, I'm looking for themes coded in "the wordpress way" - similar to how Twenty Ten, Eleven and _s themes are coded. My experience buying and then subsequently modifying themes bought from theme forest was been quite traumatic! The themes look fantastic in the demo (ie. dandelion theme) but then you look at how the theme is coded and it's a tragic mess. Nothing like the elegance and thoughtfulness put into themes like twenty ten or the new starter theme _s. I am a wordpress developer, so I'm often wanting to go into functions.php, style.css or page templates and change and modify things for a client. Having to work around spagetti code and strange coding practices used in many premium themes wastes a lot of time. So, which theme foundry has the very clean code that is the most similar to default wordpress themes? And for this question I'll just assume they are all beautiful, simple and elegant. Knowing if the themes are responsive would be a bonus. Please respond if you have real experience with customizing theme code.


title: Send email when a new post is published

text: I'm looking for a method, or plugin, that will allow me to do the following:   1. User can signup to a 'notifications' email list   2. When a new post is published on the site, users on this list are automatically emailed a notification This is for site visitors as opposed to administrators or registered users. Any suggestions much appreciated.


title: Why are there updates for obsolete WordPress versions?

text: Today milestone 3.3.3 was completed – five days after version 3.4. I have seen the same with milestone 3.2.2 which was never released. WordPress does not offer any long term support as Matt once explained. See also: Will there be security updates for 3.1 once 3.2 is released? 3.3.3 is a security backport – somewhat understandable – but the backports 3.2.2 were mostly not security related. What is going on here? As an administrator and developer – should I care?


title: Displaying a list of tags in my archives page

text: I'm looking to display a list of tags on my archives.php page. Here is the search archives page. I have archives by month               <ul>       <?php wp_get_archives(); ?>       </ul>        Archives by category               <ul>       <?php wp_list_categories(); ?>       </ul>      and now I'm trying to look through the codex for a way to display a list of tag links but none of them do that. I just want them to do exactly what my list of categories is doing. Why can't I find the right template tag for that? Any help is appreciated.


title: Cannot upload themes. Error: "The uploaded file could not be moved to /var/www/wp-uploads/localhost/2011/10."

text: The uploaded file could not be moved to /var/www/wp-uploads/localhost/2011/10.      That's the error message I get when I try to upload a wordpress theme. This is my current permission status of my folder.               $ sudo ls -la /var/www/wp-uploads/localhost     total 12     drwxrwxr-- 3 root     www-data 4096 2011-10-27 16:44 .     drwxr-x--- 3 root     www-data 4096 2011-10-27 15:45 ..     drwxrwxr-- 3 www-data www-data 4096 2011-10-27 16:44 2011      Is there a terminal command I can use to allow wordpress to have permission to write things in this folder? I use LAMP and Ubuntu 11.04. Thank you.


title: Best Wordpress Localization Plugin?

text: We would like to translate our Wordpress installation into multiple languages. I found the following 3 plugins: ICanLocalize http://wordpress.org/extend/plugins/icanlocalize-translator/ GTS Translation http://wordpress.org/extend/plugins/gts-translation/ Straker http://www.strakersoftware.com/straker/index.cfm?3B36AF5E-65E2-4D8F-8F16-B5B863523FF2 I heard the ICanLocalize is a bit of a mess. Don't know the others. It's not sooo important to have an integration with a translation agency, but really just to have the website up in multiple languages with a reasonable link structure.