Problem display

Hy I have this code:                   <?php          $id_film_array = get_post_meta(get_the_ID(),"info_film", true);         $id_film = $id_film_array[0];         $titlu_film = get_the_title($id_film);     ?>     <?php          $the_query = new WP_Query( array( 'p' => $id_film) );         while ( $the_query->have_posts() ) : $the_query->the_post();     ?>               <a href="<?php echo get_permalink($id_film); ?>"><?php echo $titlu_film; ?>               <?php         endwhile;        // Reset Post Data        wp_reset_postdata();     ?>      I recive an error if i do not have anithing select. How can i fix this. For example i do not want to select nothing for some post, in the page i do not want to retrive nothing. I use Custom Field, Relationship


comments_template form redirects back to single page

I placed a the `comments_template()` function on the archive page, so the comments, and the comment box is visible under every post. The problem is when I submit the form, wp redirects me to the single page of the post. What is the solution for this?


Most commented / popular posts and offset

I am using this code to show 3 most popular posts based on number of comments :               <?php                 $pop_posts = 3;                     $popularposts = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title,  COUNT($wpdb->comments.comment_post_ID) AS 'stammy' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND comment_status = 'open' GROUP BY $wpdb->comments.comment_post_ID ORDER BY stammy DESC LIMIT ".$pop_posts;                     $posts = $wpdb->get_results($popularposts);                     if($posts){                         foreach($posts as $post){                             $post_title = stripslashes($post->post_title);                             $guid = get_permalink($post->ID);                             $thumb = get_post_meta($post->ID,'_thumbnail_id',false);                             $thumb = wp_get_attachment_image_src($thumb[0], 'popular-posts-image', false);                             $thumb = $thumb[0];              ?>                                      <?php if ($thumb) { ?>                                     <img src="<?php echo $thumb; ?>" width=80 height=80 />                                 <?php } ?>
<a href="<?php echo $guid; ?>" title="<?php echo $post_title; ?>"><?php echo $post_title; ?>

                          <?php                              }                     }             ?>      but I want to use this code in two different places, so I want to offset the first 3 posts. Is there any way I can offset the three posts? thanks


How can I set a different specific header image on each page?

1 am using WordPress 3.3.2 and Twenty Eleven 1.3. I would like to feature a different specific header image on each individual page, corresponding with the content of that page. At present I can get as far as uploading my own different header images, but it seems the only option is to set these to appear randomly on different pages, rather than specific ones I wish them to.


Update user meta using Ajax on front end?

I would like to update some user meta information from the front end of a WordPress page when the user clicks on a button. I am attempting to pass along a string of data, and then updating the field when the data is passed to the php file. This is the code I have, but the data is not being updated on the user profile page. **Ajax**               jQuery(document).on('click', ".removeFav", function() {              var item = '#'+jQuery(this).parent("div").attr("id");         jQuery(item).remove(item); //visually remove item from product list              // AJAX call to remove item         jQuery.ajax({             url: '<?php echo get_template_directory_uri(); ?>/my-product-delete.php', //using data-slug value to specify unique product id + data-category for tab category (so item isn't deleted across all tabs if there are duplicates)             type: 'post',             data: { 'action' : 'change_json_favoriteString', 'id' :  jQuery(this).parent("div").attr("data-slug") , 'category' :  jQuery(this).parent("div").attr("data-category") },             dataType: 'json',             success: function(data) {                  alert("Deleted");                 alert(JSON.stringify(data));             },              error: function(data){                 alert("error");             }         });     });      **my-product-delete.php**               <?php                   $thisProductID = $_GET['id'];         $thisProductCategory = $_GET['category'];              /* Get current user info */         get_currentuserinfo();               $currentUserID = $current_user->ID;              $currentUsersFavorites = $current_user->json_favorites;              $newJSONfavorites = 'http://wordpress.org'; // <= must create a dynamic variable to populate with new favorites json object         update_user_meta($currentUserID, 'json_favorites', $newJSONfavorites); // <= update users json favorites with new json object                    ?>


Update Specific Key Value in Complex `wp_options` object

This should b really easy but I can't find reference - easy points for someone! I have an option in my `wp_options` table, and need to set it via `update_option()`. I just can't find the correct syntax for doing something similar to the following where I update the key `object_key` in the option `my_plugin_settings` where this is an option in my `wp_options` table: ` update_option('my_plugin_settings[object_key]','new value'); ` How is it done correctly?


Do i need to keep register_post_type in functions.php?

I am creating several custom post types, do I need to keep the register_post_type calls in functions.php? I would assume that this would only need to be run the once then removed, or do I need to keep the calls there?


delete_post_meta() for whole CPT / multiple posts?

I'm cleaning up a theme and one of Custom Post Types has some odd, long gone custom fields. I want to delete them, unfortunately delete_post_meta() takes post->ID for an argument, while I want to perform this action on all the posts not only one. How should I do that? Using a loop? Let's say the CPT is called "custom_photos" and every single post there has these custom fields.


Get posts from 2 different categories

I have a custom post (it's called "ait-dir-items") and 2 categories there. On category archive page, I need to get posts which belong to 2 categories.      get posts from 2 categories      Codition.   category1= "food" on "ait-dir-item-category" (food id is 6)   and   category2= "cate" on "ait-dir-item-category" (food id is 39)   and   post_type="ait-dir-items"      I have been trying 3 ways to solve this problem. None of them is working well. please advice me how I could fix it. ## 1st way `query_posts("cat=6, 39&showposts=5&post_type=ait-dir-item");   /*query_posts( array( post_type=>'ait-dir-item', 'category__and' => array(6,39), 'posts_per_page' => 12, 'orderby' => 'title', 'order' => 'DESC' ) );*/ while(have_posts()) : the_post(); echo $title = get_the_title(); echo $content = get_the_content(); endwhile; ` when I put "cat=6, 39" or "'category__and' => array(6,39)", no result found. ## 2nd way ` global $post;                   $tmp_post = $post;              $args = array(             'posts_per_page'  => 5,             'post_type' => 'ait-dir-item',             'category__and' => array(6, 39) // where 1, 2 is cat id             /*'tax_query' => array(                 array(                     'taxonomy' => 'ait-dir-item-special',                     'field' => 'id',                     'terms' => 39 // taxonomy id                 )             )*/         );         $myposts = get_posts( $args );         foreach( $myposts as $post ) :               $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );         $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail_size' );         $url = $thumb['0'];         ?>
<img src="<? echo $url; ?>"/>"><?php the_title(); ?>         <?php endforeach; ?>         <?php $post = $tmp_post; ?>
      ` 3rd way : relation and AND * * * ` $custom_terms = get_terms('ait-dir-item-special'); $other_custom_terms = get_terms('ait-dir-item-category');               foreach ($custom_terms as $custom_term) {     foreach ($other_custom_terms as $other_custom_term) {             wp_reset_query();             $args = array('post_type' => 'ait-dir-item',                 'tax_query' => array(                   'relation' => 'AND',                     array(                     'taxonomy' => 'ait-dir-item-category',                     'field' => 'id',                     'terms' => 6                     ),                         array(                         'taxonomy' => 'ait-dir-item-special',                         'field' => 'id',                         'terms' => 39                         ),                     ),                      );                   $loop = new WP_Query($args);              if($loop->have_posts()) {                 echo '
'.$custom_term->name.'
';                      while($loop->have_posts()) : $loop->the_post();                     echo '
'.get_the_title().'
';                 endwhile;              }         }         }      ` I think I have little problems with these codes. it shows but duplicated and all item posts. how should I fix it? Thanks,


Processing shortcodes in groups (separated by line breaks)?

## The Project I'm working on a plugin to resize and embed rows of images using shortcodes that will be converted into `<img>` tags. In most cases there will be multiple images per row, and the rows are separated by line breaks. Here's a simplified example of what 4 rows might look like in the text editor...               [img id="311409" w="1200" h="800"][img id="287556" w="900" h="750"]          [img id="511289" w="600" h="800"][img id="839905" w="850" h="850"][img id="214342" w="1150" h="1800"][img id="973537" w="450" h="300"]          [img id="223798" w="1600" h="900"]          [img id="592297" w="750" h="900"][img id="896732" w="800" h="600"][img id="722292" w="900" h="1100"]      The width and height shortcode attributes are the _original_ dimensions of each image, _not_ the display sizes. The plugin automatically resizes them (smaller) so that each image in the row is the same height and all the images in the row together fit the width of the page exactly. (This math is the easy part that I already have working.) ## The Problem When Wordpress comes across the first image shortcode in a row, it's expected that it will be replace by a real `<img>` tag at that point, but I don't yet know at what size it's supposed to be displayed. There is also no built-in way for the shortcode parser to know when it has reached a line-break. **I need to know how many image shortcodes are on a given line (in the "row") and use all of their dimensions together to calculate the desired size of each image _before_ I'm ready to replace the first shortcode in the row.** As far as I've been able to tell, Wordpress can only deal with each shortcode one at a time in the order they are found, and there doesn't seem to be an easy way to tell where the line breaks fall. ## Solution? Am I overlooking an easy solution? An ideal one would...   1. _**Leave the images easily separable_** -- using one tag per image so I can easily reorder them by dragging and dropping between rows, or even between posts (plus, as I mentioned in a comment below, my actual shortcodes are much more complex than my example and would be _extremely_ unwieldy if combined into one tag per row)   2. _**Use Wordpress' built-in shortcode support_** -- since that's the preferred method for plugins to embed content, and Wordpress has nice parsing tools already built-in for that purpose   3. _**Not require "parent" tags for each row of images_** -- to keep the code simple and flexible for future development   4. _**Remain as future-proof as possible_** -- e.g. if I wrote my own complex regex for this and overloaded `do_shortcode()` then there's a greater chance that this could break in the future as Wordpress evolves ## Compromise... After several hours of research I haven't been able to find anything that would meet all these criteria. If I have to compromise on these points, I would start from the bottom of that list. For example...   1. Rolling my own `do_shortcode()` and/or modifying the (very complex) regex pattern (defined in `get_shortcode_regex()`) -- **_these are the kinds of creative solutions that I am most interested in_**   2. Using parent tags to encapsulate each row, e.g. `[imgrow][img ...][img ...][/imgrow]` -- though that doesn't really answer the question as asked   3. Abandoning the shortcode tools altogether, e.g. implementing a broader custom filter using `add_filter()` -- which technically maintains the shortcode syntax but gives up all the nice tools (and at that point the answer to this question would simply be "it's not currently possible")


Leverage permalinks with AJAX

I'm trying to implement some AJAX to my theme, but there are a few things I cannot get my head (or Google) around. I have a custom post type named "Faculty" and a page displaying the featured image for each entry in the custom post type in a grid that links to /faculty/entry1, /faculty/entry2 etc. Instead of loading a new page with the content I'm trying to load the content above the grid using the admin-ajax.php file. But how can I implement this leveraging the current "pretty" permalinks? What I would like to achieve is that the user clicks the featured image and the url will change to /faculty/item2 and I will receive the content for item2 via AJAX. And if the user manually enters /faculty/item2 in the browser the same faculty page will load with the content from item2. I really hope the explanation makes sense - and that somebody can give me a pointer in the right direction. EDIT: This is an example of the functionality I'm looking for, just with the WordPress permalinks implemented: http://themewich.com/aware/


List all pages including archive

I'm creating a custom options page on my site. One of the options is controlling a box on the homepage and i'm trying to set the link for the item to any page on the site via a `select` menu. as of now I can list all the pages including my custom post types - what I'm trying to do is also have the custom post type archive page as a link as well as some sort of ordering in the list. So for example the select hierarchy should be something like this: Work - (Custom Post Type Archive) Matchbox - (Custom Post Type Page) Page - (Regular Page) My current code:               $sitePages= get_posts(array('post_type'=>array('page', 'work', 'people'), 'posts_per_page'=>-1, 'post_status'=>'publish', 'depth'=> 0));          $wp_cats = array();     foreach ($sitePages as $page_list ) {            $wp_cats[$page_list->ID] = $page_list->post_title;     }     array_unshift($wp_cats, " ");      and then a foreach on `$wp_cats` calls it back. any help would be greatly appreciated! _**_*UPDATE*** Based on Sven's answer ∨∨ I used the following code to output everything.               <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">             <option value="">Choose A Page</option>             <?php              $post_types = array( 'page', 'work', 'people' );             $wp_cats = array();             foreach ( $post_types as $post_type ) {                  $pages = get_pages( array( 'post_type'=>$post_type, 'posts_per_page'=>-1, 'post_status'=>'publish', 'depth'=> 0 ) );                  $obj = get_post_type_object( $post_type );             // output custom post type archive with link             if ( $post_type !== 'page' ){             echo '<option value="' . get_post_type_archive_link( $post_type ) .'"';             if (get_option( $value['id'] ) == get_post_type_archive_link( $post_type )) { echo 'selected="selected"'; }             echo '>'. $obj->labels->singular_name . '</option>';             }             foreach ( $pages as $page ) {            $wp_cats[$page->ID] = $page->post_title;            // output posts with link            echo '<option value="' . get_permalink($page->ID).'" ';            if (get_option( $value['id'] ) == get_permalink($page->ID)) { echo 'selected="selected"'; }            echo '>   '. $page->post_title .'</option>';              }            }             ?>     </select>


Special 404 header page

I wonder if there is a specific way to create a custom 404 header template. This can be done for secondary page, but creating a header-404.php doesn't do the trick. Am I really supposed to create an if in the main header checking whether the is_404() returns true? Thanks Andrea


Deactivate a plugin on wp version

I've creating a theme options page at the moment and was playing around with this function `deactivate_plugins()` I'm running wordpress 3.8.3 so running this code in my plugin should uninstall it. Questions 1.Am I using this function incorrectly? 2. Because the version 4.0 of Wordpress doesn't exist does the logic not work?                register_activation_hook( __FILE__, 'dw_deactivate_theme_options' ); // activate hook              function dw_deactivate_theme_options() {             if ( version_compare( get_bloginfo('version'), '4.0', '<') )  { // check the version                 deactivate_plugins( basename( __FILE__ ) ); // deactivate this plugin if the version is lower then 3.8             }         }      Full plugin code               <?php          /*     Plugin Name: Theme Settings     Plugin URI: xxx     Description: This Plugin will generate all of the theme options, Social Media, Logo, Google analytics.     Version: 0.0.1     Author: xxx     Author URI: xxx     License: GPL2     */          /*     Function Reference      plugins_url() - Full plugins directory URL (for example,http://example.com/wp - content/plugins )     register_activation_hook(); Hook to add settings before plugin activation 2nd parem is callback function               */          //Preset plugin functions          register_activation_hook( __FILE__, 'dw_deactivate_theme_options' ); // activate hook          function dw_deactivate_theme_options() {         if ( version_compare( get_bloginfo('version'), '4.0', '<') )  { // check the version             deactivate_plugins( basename( __FILE__ ) ); // deactivate this plugin if the version is lower then 3.8         }     }          add_action('admin_menu', 'dw_theme_options_create_menu');          function dw_theme_options_create_menu() {         //create custom top-level menu         add_menu_page('Theme Options', 'Theme Settings', 'manage_options', __FILE__, 'dw_theme_options_cb');     }          function dw_theme_options_cb() {         echo ''; // ?>
Theme Settings
         <?php echo get_bloginfo('version'); ?>     <?php } ?>


Need to have an archive widget which organizes and displays a custom post type using a custom date field

I found a handy plugin at http://www.redletterdesign.net/wp/cpt- archive/index.php for generating a calendar archive using a custom post type. My problem is I need it to organize these posts not by the post's publish date but by a custom date field (using Unix time). The custom post type is a custom event calendar which uses user-input (future) dates. Any idea as to how I would go about this?


Post interior margin in twenty eleven theme

I'm trying to customize the aspect of a single format post, in my case is "Link". I've added a different color background so they look different, editing the CSS as this:               .format-link .entry-content {         padding: 0;         font-style: italic;         background: #d7b5b5; //sfondo rosa     }      So they look like this: http://www.adessomilano.it/wordpress/category/ar/ I'm trying to add a margin between the color and the text in the way there's some free space (but with color background) on left and right side before the text. I've tried adding Margin and Padding values in the CSS but nothing happens, I think because the padding and the margin space take the white color instead of the pink... Can someone explain me? thanks a lot


Strange caching behaviour

I changed options in my theme (style settings, to keep it simple just say _switched color from blue to red_ ) and it seems nothing happened. After some trial and error I figured out that when I am logged in I **always** see the _blue_ theme. When I delete my cookies, I see the red theme until I sign up again - until I delete my cookies again. It doesn't change anything when I log in as another user. Logged in: _blue_ , Logged out: _red_ The settings I changed are commited to database. * * * I use the w3 total cache plugin. Caching for logged in users is **disabled**. Even when I clear all cache the behaviour don't change. When I disable the plugin or _delete_ the `../wp-content/cache` folder I always (logged in **and** out) see the old, blue theme. Additional: When I disabled the plugin I ahve to delete my cache/cookies to see the new,red theme again. I also disabled **all** plugins and checked the behaviour, it is still the same as described before.   Wordpress and all plugins are up-to-date. Okay I'm aware that it's unlikely to answer this question w/o more information. But I'm running out of ideas and hope you have some things I could check for errors.


Check if first paragraph is an image, then show custom code right after it?

I would like to add some code in functions.php that does this:   * If the first paragraph contains an image, show my custom code right AFTER it. For example:

MY CUSTOM CODE

        * But if the first paragraph is text (i.e. NOT an image), show my custom code right BEFORE it.

MY CUSTOM CODE

This 1st paragraph contains text, not an image.

      How do I do it? An example code snippet is most welcome. **PS:** The custom code could also be an ad (e.g. Google Adsense).


Making a form for user to add new custom post with custom taxonomies and custom fields

![enter image description here](http://i.stack.imgur.com/gwAIu.png) I want to ask that is there a way display all my custom taxonomies in a drop down menu with checkboxes so when the user check any taxonomy it will be slected and when the user click the submit button .the new post will be created with selected custom taxonomy. i know how to insert it in new post but i WANT TO KNOW ABOUT THE DROPDOWN WITH CHECKBOXES IN THE RED BOX


How the widget can be run by shortcode

I have my own widget, that uses WP_Widget class, and executes its code inside function in this class. Is there any ways to run this widget using shortcode inside post? This is how my widget structure looks like:               add_action( 'widgets_init', 'register_my_widget' );     function register_my_widget() {}     class My_Widget extends WP_Widget () {         function My_Widget() {}         function widget() {}         function update() {}         function form() {}     }      How can I add the shortcode for executing this widget?


How to get the group_id from the "groups_join_group" action in buddypress

I want to get the GROUP_creator_id when an user joins any GROUP. So if I got the `group_id` after immediately performing the the `groups_join_group` action by `add_action()` method.


Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/

I made a site some time ago and after some days some posts were indexed by search engines. Today I changed the permalink structure from `/%postname%/` to `/%category%/%postname%/`. After that, when people come to my site from search engines a `404 page not found error` appears. I want to change all old URLs to the new category base URL without any 404 error. How can I do it?   By the way, I use Yoast plugin.


Create Div Wrapper On 3rd Iteration Or When Query Loop Items Run Out

I'm running into an issue.. I've written a code inside a loop so that it creates a new box every 3rd iteration in the loop. It does this nicely, however for example if I have 4 items in a full query of returned posts , it breaks on the 4th one because when it resets to 1 again (from creating the end div tags on the 3rd final iteration then it resets back to 1) it doesn't know to create and end to the 2nd box on the 4th post item. Is there a way so that if there is no more posts left in the query to create end div tag even there's only 1 left? If that makes sense..               <?php if($i%3 == 0){ ?>

Featured Accident Lawyers

     <?php } ?>                      <?php /*echo "$i" . "
"; */?>                 <div class="thumbnail-large box-<?php echo $i; ?>" style="float: left;">                     <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <img                     itemprop="image" src="<?php echo $PPT->Image($post->ID, "url", "&w=180&h=128"); ?>" class="listImage"                     alt="<?php the_title(); ?>" title="<?php the_title(); ?>"/>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                      <?php $i++; ?>          <?php if($i%3 == 0) {  ?>

          <?php } ?>          <?php if($i == 3){ ?>

<?php } ?>


Add quick edit fields without custom colum

This question is a follow up on that answer I wrote. Let's say I want to add something to the quick edit box for the _Posts_ post type list table. To do so, I have to add a custom column because of the following part in the `class-wp-posts-list-table.php` file in core:               foreach ( $columns as $column_name => $column_display_name ) {         if ( isset( $core_columns[$column_name] ) )             continue;         do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $screen->post_type );     }      As you can see, the filter for custom quick/bulk edit fields won't trigger if there's no custom column registered. Now this, this and this answer suggest to either just add or add and then remove a dummy custom column. So I added a dummy custom column:               $pt = 'post';     add_filter( "manage_{$pt}_posts_columns", array( $this, 'addColDummy' ) );     # add_action( "manage_{$pt}_posts_custom_column", array( $this, 'removeColDummy' ), 10, 2 );     # add_filter( "manage_edit-{$pt}_columns", array( $this, 'remove' ) );      Problem now is: If I then remove the custom column again from within one of those two filters above, the custom code doesn't get triggered anymore. _Question:_ How can I remove the dummy column without removing the custom quick edit stuff again?


HTML5 Youtube wrapper works in jsfiddle but not in WP?

I've included few file src's and html into my webpage just as shown in jsfiddle. I put the stuff into php file, since wordpress texteditor tends to ruin code. The video doesn't work even in separate page template. Help? :/ Code on my website jsFiddle


Exclude a category of posts from all listings if user doesn't have a role

I have **some categories** that I'd like **to bulk exclude from all listings** (the loop on the main blog listing page, category listing pages, archives, etc.) and **to show them only to users with a specific role** (one specific category to only one specific role). Right now, as a temporary solution, I am using a code of @G. M. (see bellow) that disallow subscribers to see the content of posts from specified categories, but the posts are listed everywhere and users with different roles can see each other posts, that I want to avoid. Can you help me with a solution?               add_filter('template_include', 'restrict_by_category');          function check_user() {       $user = wp_get_current_user();       if ( ! $user->ID || in_array('subscriber', $user->roles) ) {         // user is not logged or is a subscriber         return false;       }       return true;     }          function restrict_by_category( $template ) {       if ( ! is_main_query() ) return $template; // only affect main query.       $allow = true;       $private_categories = array('reserved', 'personal'); // categories subscribers cannot see       if ( is_single() ) {         $cats = wp_get_object_terms( get_queried_object()->ID, 'category', array('fields' => 'slugs') ); // get the categories associated to the required post         if ( array_intersect( $private_categories, $cats ) ) {           // post has a reserved category, let's check user           $allow = check_user();         }       } elseif ( is_tax('category', $private_categories) ) {         // the archive for one of private categories is required, let's check user         $allow = check_user();       }       // if allowed include the required template, otherwise include the 'not-allowed' one       return $allow ? $template : get_template_directory() . '/not-allowed.php';     }


Resize an image on selection from media library

i want the image(image1) that is uploaded by a user to be automatically resized to 360px width and 560px height once selected and image 2 to 280*510 once selected from the media library via the theme options page that i have created.How can this be achieved? Here is a screenshot of the admin panel.![enter image description here](http://i.stack.imgur.com/gyaYu.png) This is the code that that i am using in index.php:                     <?php $image1= get_option('director_image1', IMAGES.'/1.jpg'); ?>           <?php $image2= get_option('director_image2', IMAGES.'/2.jpg'); ?>           <img src="<?php print $image1; ?>"  />           <img src="<?php print $image2; ?>"  />      I have created a theme options page that retrieves the images from the media library. The code in function.php:               <?php require_once('theme-options.php'); ?>      And in theme-option.php:               <?php     // create custom plugin settings menu     add_action('admin_menu', 'director_create_menu');     function director_create_menu() {     //create new submenu     add_submenu_page( 'themes.php', ' Theme Options',     'Theme Options', 'administrator', __FILE__,     'director_settings_page');     //call register settings function     add_action( 'admin_init', 'director_register_settings' );     }     function director_register_settings() {          register_setting( 'director-settings-group', 'director_image1' );     register_setting( 'director-settings-group', 'director_image2' );}          function director_settings_page() {     ?>

Theme Settings
           <form id="landingOptions" method="post" action="options.php">             <?php settings_fields( 'director-settings-group' ); ?>
White iphone slides

             *Upload using the Media Uploader and paste the File URL below.      Image 1:	                            <input type="text" name="director_image1" value="<?php print get_option('director_image1'); ?>" />

Galaxy S3 slides

             Image 1:	                          <input type="text" name="director_image7" value="<?php print get_option('director_image7'); ?>" />

       </form>


Unable to get_the_content(); of a post in Wordpress via AJAX

I'm trying to ajaxify my Wordpress theme and I use the method described here and I'm now trying get_the_content of post via functions.php. Using jQuery, when I do alert(data) I get the 'title' echo but not the content of the existing post I want (returns 0). The jQuery part               $('.ajaxed,.ajaxed a,.menu-item-home a,.menu-item-object-page a').live('click', function(event) {             event.preventDefault();             var link = $(this).attr('href');             var toRemove = MySettings.url;             var rewritepath = link.replace(toRemove,'');             var handler = function(data) {                 $('title').html($('title', data).html());                 $('#primary').html($('#primary', data).html());                 $('#primary').hide().fadeIn('slow');                 $.address.title(/>([^<]*)<\/title/.exec(data)[1]);             };             $.post(ajax_object.ajaxurl, {                 action: 'ajax_action',                 post_id: $(this).find('input.post_id').attr('value')             },function(data) {                 alert(data.title);                 alert(data.content);             });             $.address.state(MySettings.path).crawlable(true).value(rewritepath);             return false;         });      The functions.php part               <?php     function javascripts() {         if( !is_admin()){             $blogurl = get_bloginfo('url');             $thumbnail_width = get_option('thumbnail_size_w');             $thumbnail_height = get_option('thumbnail_size_h');             $path = parse_url(get_bloginfo('siteurl'), PHP_URL_PATH);             $url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js';             wp_deregister_script('jquery');             if (get_transient('google_jquery') == true) {                        wp_register_script('jquery', $url, array(), null, true);             }              else {                 $resp = wp_remote_head($url);                 if (!is_wp_error($resp) && 200 == $resp['response']['code']) {                     set_transient('google_jquery', true, 60 * 5);                     wp_register_script('jquery', $url, array(), null, true);                 }                  else {                     set_transient('google_jquery', false, 60 * 5);                     $url = get_bloginfo('wpurl') . '/wp-includes/js/jquery/jquery.js';                     wp_register_script('jquery', $url, array(), '1.7', true);                 }             }             wp_enqueue_script('plugins.js', get_bloginfo('template_directory') . "/js/plugins.js" , array('jquery'));             wp_enqueue_script('ajax-script', get_bloginfo('template_directory') . "/js/scripts.js", array('jquery'));             wp_localize_script('ajax-script', 'ajax_object', array('ajaxurl' => admin_url( 'admin-ajax.php' )));             wp_localize_script('jquery', 'MySettings', array('width' => $thumbnail_width,'height' => $thumbnail_height,'url' => $blogurl,'path' => $path));         }     }     add_action('wp_enqueue_scripts', 'javascripts');     add_action('wp_ajax_ajax_action', 'ajax_action_stuff'); // ajax for logged in users     add_action('wp_ajax_nopriv_ajax_action', 'ajax_action_stuff'); // ajax for not logged in users     function ajax_action_stuff() {         $post_id = $_POST['post_id'];              //Query the post and set-up data         $post = get_post($post_id);         setup_postdata();              update_post_meta($post_id, 'post_key', 'meta_value');              //Return response as an array. This will give us data.title and data.content browser-side.         $response = array();         $response['title'] = get_the_title();         $response['content'] = get_the_content();              echo json_encode($response);         exit;     }     ?>      What am I doing wrong? Thanks


Is there a plugin to record querystring parameters for a page (for customer tracking)?

I am creating an information landing page that I intend to cold email out to a bunch of potential clients. I need to track customers that not only open the email (I know how to do that) but track which email recipients actually navigated to the landing page. In a custom web application I would do this by sending them a link to the landing page that's something like www.site.com/landing?rec=my@email.com, and upon seeing the querystring I would put that in the database. Are there any wordpress plugins to do something like that?


Plugin for a static piece of text on homepage

I have this site where most of the Homepage is programmed into the php page. For example: a photo slider, a list of the most recent products, etc. I also need to add a piece of static text to only the Homepage. It's easy just to add it on the php page, but it should be editable from the admin area. Is there a plugin that will allow me to do something like that?


Plugin to email a post or page to someone

Is there a plugin that will allow visitors to email a page or post to someone? I found WP-EMail but it was updated last on April 2010 so I'm not sure if I should use it.


Are Wordpress Plugins essential?

I'm new to WordPress. I recently read an article about how hackers can exploit vulnerabilities in plugins. Various sources such as Google Pagespeed has also disssuaded me from using plugins or at least keep it to the minimum. Personally, I also try to avoid plugins because I feel more in control of what happens on my site, and downloading one almost feels like 'Great, another thing I have to learn how to use'. I understand that 'Plugins-recommendation' are off-topic, but what I'm after is actually explanation to why/if some plugins are essential in WordPress. Take these for example: **Security** - A few top plugins has to do with security. But are WordPress sites vulnerable in general? Why do I need an additional plugin to avoid exploitation? **Back Up** - I'm new to the blogging world, but don't most hosts provide backup services? Or do I need special plugins for that with WordPress? **AdSense Click-Fraud Monitoring** - Supposed to block click bombs to avoid banishment from Google. But I don't understand, are a few fake clicks all people have to do to shut your revenue down unless you download a plugin? _Edit: Might be better to ask this one in Google support, ignore it if so_


REmoving sensitive information from comment notifications - notify_post_author

Basically I need to remove or comment our lines 1114 - 1116 in pluggable.php, and edit line 1113 These are the lines               $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";     $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";     $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";     $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";      They are all part of function - wp_notify_postauthor I can replace the whole thing by creating a plugin (which is what I've done) - but is there a way to just change those affected lines - without replacing the whole function? Thanks


How to handle form submission?

I'm new to wordpress and hence facing some issues. **The use case scenario is as follows:**   1. A user is displayed an application form to start a club in his school.   2. The user fills the form and hits the 'Submit' button.   3. The form needs to be validated.   4. If the validation is successful, then data is stored in custom table `club_details` in db and the user is shown some message(eg: Thanks for submission. Your application is sent to the admin for approval.) else appropriate error messages are shown to the user.   5. The admin goes to the Wordpress admin panel to approve the pending requests for the club. (The data is fetched from db and shown to the admin). **I have done the following:**   * for 1) I have created a application form/page using the Wordpress HTML editor.    * for 3) I have a javascript file (`validation.js`) that has the validation code.   * for 4) I have a php file (`club-functions.php`) that has a function `storeInDB()` to store the application details in custom table in db.   * for 5) I have created my own plugin folder and added a php file (`club.php`) that displays the application details to the admin on the Wordpress admin panel. I'm stuck up at the following place: How to handle the form submission. Where should I place the code that calls the javascript's validate function and later calls the `storeInDB()` function. Please provide me some suggestions on how do I achieve this and is this approach good? Thanks a lot in advance.


Is it possible to install a different wordpress installation in a subdirectory?

What I'm trying to say is, I have this wordpress site called www.mysite.com which is a one pager site that only contains static pages and I want to install a new wordpress installation called shop and use it as an ecommerce page. So it will be called www.mysite.com/shop and shop will be a completely different installation. Is this possible and How am I going to do this? and on the nav bar I'll have something like, Home - About Us - Contact - Shop. and Shop will automatically direct to the new installation?


Is wp3.8 / twenty fourteen's Sticky Nav & Responsive - core or theme based

I want to have a twenty fourteen like sticky nav & responsive menu button, in my Genisis 2.0 theme. Before I go to figure this out, is it somehow now native to 3.8 or is it theme dependant. Casey


Image rotator plugin

I have tried two Rotator plugins so far. Nivo-slider and EasyRotator. Nivo- slider was great, but i could only have an image caption, and i need both image caption and image title. Also, i couldn't get the "bullets" for indicating the current slide to work. So i Googled and found the "EasyRotator"-plugin. Great, except it rescales the images, even if i upload in the correct resolution, the generated HTML is all inline styling so it's kind of hard for me to style it as i want from css. Now im wondering, is there any plugin that does the following?   1. Image Title   2. Image Caption   3. Bullets to indicate current slide Any tip is appreciated! Thank you!


Should I custom code drop down menus or use a wordpress plugin?

**EDIT** -- Hopefully my question is more clear What is the best practice for wordpress dropdown menus:   1. Custom CSS (editing styles.css)   2. Using a WP Plugin I'm leaning toward coding it myself from scratch, but I don't want to reinvent the wheel if there's a plugin that is standard.


How to disable WordPress trackback?

I have higher PR as a result of that lots of spammers make trackbacks, everyday I have to delete them. Those trackbacks will negatively affect my site SEO? How do I disable my site all the posts trackback at once? I have run following code in my MySQL admin and WotdPress manage DB plugin,, it show me an error. UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post'; UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';


Page speed error: "serve scaled images"

I made a test on GTmetrix.com and I got a pretty bad grade regarding the Page Speed (D or F). The worse error is the following: **Serve scaled images (grade F):**   _some image URL_ is resized in HTML or CSS from 1024x539 to 530x279. Serving a scaled image could save 70.3KiB (73% reduction). What should I do to get a better grade? How can I solve this issue? What can I do to prevent the resizing in HTML? Is it better to upload to WP smaller images? What would be the best resolution?


Allow users to add custom functions to wordpress theme

I'd like to allow users to add functions to the theme I'm developing, but don't want users to change functions.php directly, as this file may be updated with theme updates. In other words, I'd like this to work in a similar fashion to custom CSS files. How can I setup a user-functions.php file for users and ensure those functions are also run when the theme is activated?


How do I translate: "2 hours and 15 minutes"?

I want to translate the generic phrase "x hours and y mintues". Of course, if it's only one hour, it should say "1 hour and y mintutes". The same goes for minutes, "x hours and 1 minute." I know `_n()` handles the single/plural issue, but what is the best practice on handling two numbers in a phrase? **Method 1**               printf(_n("%d hour", "%d hours", $hours), $hours);     _e(" and ");     printf(_n("%d minute", "%d minutes", $mins), $mins);      Works, but concatenating strings makes translation inflexible. I'd expect not all languages would work with "[hour phrase] [and phrase] [minutes phrase]". **Method 2**               printf(         "%s and %s",         sprintf(_n("%d hour", "%d hours", $hours), $hours),         sprintf(_n("%d minute", "%d minutes", $mins), $mins)     );      This seems right, but seems like it would be hard to translate without context. Maybe I need to add context with `_x()`? # Solution I went with: something more readable @toscho               function nice_time($minutes) {         $hours = floor($minutes/60);         $minutes = $minutes % 60;              if ($hours == 0 && $minutes == 0) {             return __("no length of time", 'context');         } else if ($hours == 0 && $minutes == 1) {             return __("1 minute", 'context');         } else if ($hours == 1 && $minutes == 0) {             return __("1 hour", 'context');         } else if ($hours == 1 && $minutes == 1) {             return __("1 hour and 1 minute", 'context');         } else if ($hours == 0) {             return sprintf(__("%d minutes", 'context'), $minutes);         } else if ($minutes == 0) {             return sprintf(__("%d hours", 'context'), $hours);         } else if ($hours == 1) {             return sprintf(__("1 hours and %d minutes", 'context'), $minutes);         } else if ($minutes == 1) {             return sprintf(__("%d hours and 1 minutes", 'context'), $hours);         } else {             return sprintf(__("%d hours and %d minutes", 'context'), $hours, $minutes);         }     }


Rich text editor settings persist throughout all rich text editors

I have an issue I'm trying to better understand in order to force mce to true in the script check below. Background: I'm applying a rich text editor to the category description textarea to allow users to apply rich text formatting to the category descriptions. The problem I'm having is when the user happens to leave the post or page editor on the "HTML" tab. In this case, WordPress apparently is setting a global flag that results in the mce variable in the script below to initialize as false. This has the effect of disabling my rich text editor on the category description field. How can I overcome this?               <script type="text/javascript">         (function(){             var init, ed, qt, first_init, mce = false;          //mce needs to be true!!!                  if ( typeof(tinymce) == 'object' ) {                 // mark wp_theme/ui.css as loaded                 tinymce.DOM.files[tinymce.baseURI.getURI() + '/themes/advanced/skins/wp_theme/ui.css'] = true;                      for ( ed in tinyMCEPreInit.mceInit ) {                     if ( first_init ) {                         init = tinyMCEPreInit.mceInit[ed] = tinymce.extend( {}, first_init, tinyMCEPreInit.mceInit[ed] );                     } else {                         init = first_init = tinyMCEPreInit.mceInit[ed];                     }                          if ( mce )                         try { tinymce.init(init); } catch(e){}                 }             }                  if ( typeof(QTags) == 'function' ) {                 for ( qt in tinyMCEPreInit.qtInit ) {                     try { quicktags( tinyMCEPreInit.qtInit[qt] ); } catch(e){}                 }             }         })();


similar of my posts in all over the internet sites and blogs

i asked here in WordPress first and next asked there in webmasters Stack but i think here is very useful for WordPress users but close my question. I'm using the similar posts plugin http://wordpress.org/extend/plugins/similar-posts/, but I want the similar posts in all over the internet. is there any tools that when someone copy and paste my article in their own site alert to me? some of the bloggers don't link to my articles and i want to


Shortcodes: closing shortcode not being processed

I have been using shortcodes in my templates successfully, apart from when a closing tag is required to wrap some other code or content. The problem is that the closing tag, eg [/shortcode], doesn't get processed, and is simply printed to screen as plain text. Am I missing something obvious? Thanks! Austen


Pagination and Custom Search page

I am stuck on an issue for the last two days. I have a CPT - 'listings'. This is it's archive page   * Till here, everything is fine.   * I put in a search form there, and added this to `pre_get_posts`:              if ($query->is_main_query() && $query->is_post_type_archive('listings') &&  !is_admin() && is_search()) {          echo '
me runnning
';          $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $query->set('paged', $paged);          $query->set('posts_per_page', 1);        * Another code in 'functions.php' that redirects my search to 'archive_listings.php', which is the same archive page for 'listings' CPT   * When I do a search the results that appears are fine. Problem arises when I try to get on the second page in the search results.   * When I click on next page for search results, it takes me to the  > wwwsitename.com/listings/page/2 which is the page of archive-listings default results.   * In other words, when I try to move to next page - the query forgets about the search terms, and get the second page of default archive for listings. I am not sure, if I was able to clearly explain it. So, I have`print_r($wp_query)` which can help understand the issue I have tried several code blocks from support forums, stack exchange, and other blogs. Any suggestions will be heartily appreciated.


Limit page template choice by page title or ID?

I'm developing a multisite and creating my own themes for it. All the themes will feature some standard pre-defined pages eg. homepage, about, blog, contact us etc. Each page will also have a number of page template options available, eg: homepage1, homepage2, blog 1, blog 2, contact. **The problem is that some of the page templates will not be appropriate for all pages.** For example, if I have a template designed as a "blog" page, it will not work well if applied to a "contact us" page. The Question (finally): **_How can you limit or restrict the templates available to choose depending on the page title or ID?_** "Human" code required: if the page is the about page, then only show page template options x & y etc. Thanks!


Altering HTTP Headers when Serving Certain Files

I'm trying to use jquery.filedownload within a site but it requires that my files (a pdf, for instance) be served with specific headers.               header('Set-Cookie: fileDownload=true; path=/');     header('Cache-Control: max-age=60, must-revalidate');     header("Content-type: text/csv");     header('Content-Disposition: attachment; filename="'.$title.'-' . $timestamp . '.csv"')      I've found how to alter headers via an action hook. Does this mean I need to create an intermediary page which alters the headers and the sends the file, e.g. with readfile() ?


why is are these rewrite_tags and rules not working?

im trying to get this to work for 3 different pages it was working fine with 1 rewrite, then when i added 2 more its not working for any of them. heres the code:               function add_video_rewrite ()      {         add_rewrite_tag("%video_id%", '([^/]*)');         add_rewrite_tag("%video_slug%", '([^/]*)');         add_rewrite_rule('^video/([^/]*)/([^/]*)', 'video/?video_id=$matches[1]&video_slug=$matches[2]', 'bottom');     }     add_action( 'init', 'add_video_rewrite' );          function add_team_rewrite ()      {         add_rewrite_tag("%team_id%", '([^/]*)');         add_rewrite_tag("%team_slug%", '([^/]*)');         add_rewrite_rule('^videos/team/([^/]*)/([^/]*)', 'videos/?team_id=$matches[1]&team_slug=$matches[2]', 'bottom');     }     add_action( 'init', 'add_team_rewrite' );          function add_league_rewrite ()      {         add_rewrite_tag("%league_id%", '([^/]*)');         add_rewrite_tag("%league_slug%", '([^/]*)');         add_rewrite_rule('^videos/league/([^/]*)/([^/]*)', 'videos/?league_id=$matches[1]&league_slug=$matches[2]', 'bottom');     }     add_action( 'init', 'add_league_rewrite' );


Remove multisite "blog" slug from specific custom post type

I have wordpress multisite, by default multisite has the word "blog" added to all post types excluding "pages" How would i only remove it from a specific custom post type. If I go to setting and remove the "blog slug" from setting it gets remove from the actual blog section of the website which i don't want because i need to keep the URL the same.


Set loop format & have a loop inside other one

I have few questions on wordpress loop. The question may be strange, but it was fit for the jquery requirement. What I want to do are:   1. Loop the "page" div with two "threads" show in each by NOT using any transition like page number(pagination??), but just to paste all the posts("thread" div) in below format inside one php. All the class name of div no need to be changed in loop.   2. "title" div come from another loop, as it is not related to "thread", that's "loop inside loop"?

             <--title from another loop-->

             <--content of 1st thread-->

             <--content of 2nd thread-->


User File Upload Repository?

I am trying to make a user-uploaded file repository on my wordpress site, but have been unable to find any plug-ins or tutorials on how to accomplish such a task. Basically I want a page where users can go and upload files via an upload file dialogue. Then I want to have a page that lists all user-submitted files that is sortable. I have seen some tutorials on how to add an upload option to a users dashboard, but I'm not using the normal dashboard because I think it is clunky. Are there any such plug-ins out there? Or does anyone have any recommendations? Thanks, Tre!


In what files I can change country names of wp-ecommerce plugin?

I am using the newest wp-ecommerce plugin and as I am selling to a non-english speaking country I would like all country names listed in my language in the cart. I search and all the files and changed in several files, but it did not help. Maybe, somebody know where I should change country name what it would be in my language in the cart?


Change order of comment fields

Is there a way to display the comment field first and then the Name / Email / Website fields? I am using               <?php comment_form( ); ?>      in my theme. I am not looking for a CSS solution.


Advertising: Every page refresh counts as 3 ad impressions

I have tried multiple plug-ins for ads and for each page refresh they all count it as 3 impressions. Any idea why this is happening or how to fix it? Currently using the Ad Engine plugin, and already tried Simple Ads Manager. Using an Image. **Example Code:**                                   <!doctype html>                                            <meta charset="utf-8">                   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">                   <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>         <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />              <?php wp_head(); ?>            <meta name="description" content="Saint Petersburg SociaBulls">       <meta name="author" content="Austin Piazza">                   <meta name="viewport" content="width=device-width,initial-scale=1">                        <link rel="stylesheet" type="text/css" href="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/jcar/skins/tango/skin.css" />                            <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen,projection" />                                                                                <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>               <body <?php body_class($class); ?>>

St. Pete Sociabulls

                 <?php wp_list_pages('title_li='); ?>

<?php the_title('');?>
                          <?php if (have_posts()) : while (have_posts()) : the_post();?>

                                 <?php the_date( 'M d' ); ?>

                                       <?php the_content(); ?>

                        <?php endwhile; endif; ?>
                                                        <?php if ( !function_exists('dynamic_sidebar')               || !dynamic_sidebar( 'rightsidebar' ) ) : ?>      <?php endif; ?>
                         <?php if ( !function_exists('dynamic_sidebar')               || !dynamic_sidebar( 'Ads' ) ) : ?>      <?php endif; ?>

                         <?php if ( !function_exists('dynamic_sidebar')               || !dynamic_sidebar( 'extra' ) ) : ?>
This is the deafult sidebar, add some widgets to change it.
       <?php endif; ?>

                                                                 <?php wp_footer(); ?>                       **Update: Added all my code together** Thanks!!


Does the lazyload plugin make this server disks busy?

Some people claim that this plugin make many read/writes to the disks making them too busy. Increasing IOps rate. Is this correct? http://wordpress.org/extend/plugins/lazy-load/


What is the scope and persistence of add_filter() and remove_filter()?

I understand that using add_filter() or remove_filter() directly within a themes' functions.php would make the changes global across the theme unless you override them elsewhere. But believe this is a result of WordPress initialization.               add_filter( $tag, $function_to_add, $priority, $accepted_args );      However if a call to add_filter() or remove_filter() is made within a function or class:               function example(){         ...         add_filter( $tag, $function_to_add, $priority, $accepted_args );         ...     }      What is the scope and persistence of the change?


query_posts - slightly more advanced query

I'd like to edit the front page posts query to be slightly more advanced. Right now it excludes all posts in the Featured category. I'd like it to exclude the first 5 posts (or first n posts, really), but include the rest in the results. Here is the current call:               <?php query_posts("cat=-".$GLOBALS['ex_feat'].",-".$GLOBALS['ex_vid'].",-".$GLOBALS['ex_aside']."&paged=$paged"); ?>      How would I edit this to include all featured posts as well, except the first 5?


This is a follow up to Display Post by taxonomy and taxonomy child if exist I need to display a list of Accomodation, first by Type of Accomodation, then by Regions. I have a post-type, called `accomodation`, a taxonomy `Country`, a taxonomy `accomodation-type`, a taxonomy `Region` I am in the Country page, where I retrieve the value of the country via               $taxonomy = 'country';     $terms=get_the_terms($post->ID,$taxonomy);          if($terms) {         foreach( $terms as $termcountry ) {      So I am successfully getting `$termcountry->name;` as the value of current country. Next I need to do my query for the Accomodation based on that country, filtered by Accomodation Type, and by region in this type. So it should be   * Acc-Type 1      * Region1        * Acco 1       * Acco 2       * Acco 3     * Region 2        * Acco 1       * Acco 2   * Acc-Type 2   * etc.... I am trying to do it this way               $taxonomy2 = 'accomodation-type';     $termsacc = get_terms("accomodation-type",array('orderby' => 'slug', 'order' => 'ASC'));            //Loop through Acc-Type             foreach ($termsacc as $termaccomodation) {                 //Loop through Region in this type                 $taxonomyregion = 'region';                 $termsreg = get_terms("region",array('orderby' => 'slug', 'order' => 'ASC'));                  foreach ($termsreg as $termregion) {                 $args = array(                     'post_type' => 'accomodation',                     'country' => $termcountry->name,                     'tax_query' => array(                         'relation' => 'AND',                         array(                             'taxonomy' => 'accomodation-type',                             'field' => 'slug',                             'terms' => array($termaccomodation->name),                         ),                         array(                             'taxonomy' => 'region',                             'field' => 'slug',                             'terms' => array($termregion->name),                         )                     )                 );                           $query = new WP_Query($arg);                   //Do the loop      but this is not doing it.... Scratching my head proper on this one and will appreciate some help/solution thx in advance


Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation

I really need some help, I dont know where else to turn with this request. I'd like to add a shortcode to one of my posts. The template tags get_next_post() and get_previous will not work for me since I dont want post navigation on each post page and I want to control where it displays. In a DIV in an HTML structure I've created in a post. So what I need is to generate shortcodes from get_next_post() and get_previous_post()


Stop Wordpress Redirection From /keyword to /some-post-containing-keyword/

I have tried everything I've found. I can't stop webhostingbreak.com/ipage/ from redirecting to webhostingbreak.com/hosting-directory/ipage-hosting/ I tried remove_filter('template_redirect', 'redirect_canonical'); in my theme's functions.php. I tried removing or commenting out add_action(‘template_redirect’, ‘redirect_canonical’); in /wp-includes/canonical.php I even removed EVERY line of code in canonical.php and still no result... It still redirects like I've done nothing. I changed webhostingbreak.com/hosting-directory/ipage-hosting/ to webhostingbreak.com/hosting-directory/test/ and then I cleared the database of any attachements/old slugs that might cause redirect. It STILL redirects. I'm out of ideas. I've spend 20 hours trying to find answers on this.


Produce a plain page with only a message

I am integrating a payment gateway into a distributed wordpress plugin. The notification page (page that the gateway sends info to after the payment has been made) requires only a message of "success" or "fail" to be printed. In that page, I need access to the database and some org options. Can someone please tell me how to produce such a page (i.e. no menu, no header, no footer and etc.)? The gateway in question is alipay.


How-to leverage WordPess for creating Extended Social Profiles

My question is actually quite simple, but I think there are a number of answers to choose from: **If one were to use WordPress, what would be the most elegant way of creating a part of the website that has "People Profiles", whereby; they can update their own mini-blog, add images, assign them a multitude of taxonomies, etc. (basically having a very light version of Facebook functionality plus some e-commerce products specific to the person). Scalability would obviously be key too, would need to work for 10, 100, 1000+ profiles.** I think my first instinct would be to try and go with BuddyPress as a support application from which these profiles would originate, but there are possibly other solutions? What do you think? Thank you!


Save checkboxes of a metabox with a foreach loop (invalid argument)

I'm new to Wordpress plugin development and I'm trying to create a list of checkboxes (from a WP Query) to associate as custom fields for a specific post type. Nothing wrong with the display function, but when I'm trying to save I get the error > Invalid argument supplied for foreach(). How can I check what the save function sees in my global array `$loop_brands`? Someone can helps me to solve and understand?               <?php          function brands_display_meta_box( $post ) {               global $loop_brands;         $loop_brands = array();              wp_nonce_field( plugin_basename( __FILE__ ), 'brands-nonce-field' );              $args = array(             'post_type' => 'page',             'post_parent' => 7,             'orderby' => 'title',             'order' => 'ASC'         );              $query_brands = new WP_Query($args);              while ($query_brands->have_posts()) : $query_brands->the_post();                   $id_brand = get_the_ID();             $brand = get_post($id_brand, ARRAY_A);             $slug_brand = $brand['post_name'];             $titolo_brand = $brand['post_title'];                  $loop_brands[] = $slug_brand;          ?>                  <p>                 <input type="checkbox" id="<?php echo $slug_brand; ?>" name="<?php echo $slug_brand; ?>" value="yes" <?php checked( get_post_meta($post->ID, $slug_brand, true ), 'yes' ); ?>>                 <label for="<?php echo $slug_brand; ?>"><?php echo $titolo_brand; ?></label>                  </p>          <?php endwhile;          }          function brands_add_meta_box() {              add_meta_box(             'brands-meta-box',             'brands Meta Box',             'brands_display_meta_box',             'stores',             'side',             'high'         );          }          add_action( 'add_meta_boxes', 'brands_add_meta_box' );          function brands_user_can_save( $post_id, $nonce ) {              $is_autosave = wp_is_post_autosave( $post_id );         $is_revision = wp_is_post_revision( $post_id );         $is_valid_nonce = ( isset( $_POST[ $nonce ] ) && wp_verify_nonce( $_POST[ $nonce ], plugin_basename( __FILE__ ) ) );              return ! ( $is_autosave || $is_revision ) && $is_valid_nonce;          }          function brands_save_meta_box( $post_id ) {              global $loop_brands;              foreach ( $loop_brands as $brand ) {                  if ( brands_user_can_save( $post_id, $brand ) ) {                      if ( isset( $_POST[ $brand ] ) ) {                          update_post_meta( $post_id, $brand, $_POST[ $brand ]);                      } else {                          delete_post_meta( $post_id, $brand);                      }                  }              }          }          add_action( 'save_post', 'brands_save_meta_box');


WordPress SEO by Yoast: Hide Meta boxes in posts for non-admins

I have multi-author website and I am not very comfortable for allowing all members to enter SEO details in the posts they are publishing. I would like this would be visible only to Administrator of the website. Any ideas?


How can i add custom field inside custom post taxonomy?

I need to add one image uploading field to my custom post type. But it should be inside the taxonomy (product category). How can i add that field?.               <?php     add_action('init', 'wlg_cstm_register');             function wlg_cstm_register() {                $product_labels = array(         'name' => _x('Products', 'post type general name'),         'singular_name' => _x('Product', 'post type singular name'),         'add_new' => _x('Add New', 'Product'),         'add_new_item' => __('Add New Product'),         'edit_item' => __('Edit Product'),         'new_item' => __('New Product'),         'view_item' => __('View Products'),         'search_items' => __('Search Products'),         'not_found' =>  __('No Products found'),         'not_found_in_trash' => __('No Products found in Trash'),          'parent_item_colon' => ''     );              $product_args = array(                'labels' => $product_labels,                'public' => true,                'show_ui' => true,                'capability_type' => 'post',                'hierarchical' => false,                'rewrite' => true,              'supports' => array('title', 'editor', 'thumbnail'),             'taxonomies' => array( '' ),             'menu_icon' => get_bloginfo('template_directory') . '/resources/img/Products-icon.png',  // Icon Path             'has_archive' => false                    );               register_post_type( 'products' , $product_args );           register_taxonomy( 'item', 'products', array( 'hierarchical' => true, 'label' => __('Product Category'), 'query_var' => 'item' ) );      }


Declaring arguments for taxonomy

Just a bugbear about declaring taxonomies, reading Justin Tadlocks article about Taxonomies and want to find what does the 0 mean in this snippet from the above article:               add_action( 'init', 'create_pc_db_taxonomies', 0 );      In the codex article on taxonomies they've omitted it but I see it used just about on every tutorial published so far. Lastly is there a benefit to calling the above function before the actual function?


If metabox has content display content

I know how to display field content if the field has content.               $monday = get_post_meta($post->ID, '_cmb_open_monday', true);     if ( ! empty ( $monday ) ) {         echo 'content';     }      How do I display the content if one of the fields from the metabox "store_openingtimes" has content? Maby this explains better what i want to do:               $storeopen = Get all meta from metabox id "store_openingtimes"     if ( ! empty ( $storeopen ) ) {         echo 'content';     }


Contact Form 7: Redirecting on a condition?

I am doing a survey using the plugin "Contact Form 7". I want to insert an acceptance box. ONLY if people check this box and click "submit", they should be redirected to another page, where I am going to ask for their e-Mail- addresses. If they don't check "acceptance" there should be no redirecting. How can I do this? I ready inserted on_sent_ok: "location = "" - BUT: This ignores if the acceptance box is check or not.


Inherit plugin settings to new site in Multisite

I use the Breadcrumb NavXT plugin for a WP Multisite. I activated the plugin for all sites so I can use it throughout my network. My problem is that every time I add a new site I have to change the default settings of the plugin, but I’d like WP to use the settings I already customized for the main site because on all future sites they would be the same. Is there a way to force WP adopting the plugin settings of the main site?


Trying to get property of non-object error using get_post_meta()

I made a simple function for post_meta, in `functions.php`:               // Top Sub Heading (top_sub) FROM CUSTOM FIELD     function topSub( $Trunckvalue = null ) {         global $post;         $TopSub = get_post_meta( $post->ID, 'top_sub', $single=true );         $shortTopSub = trunck_string( $TopSub, $Trunckvalue, true );         if ( !$TopSub == NULL  ) { ?>
<?php echo $shortTopSub; ?>
          <?php }         return $shortTopSub;     }          add_action( 'init', 'topSub' );      And in my theme I'm using it like: `topSub(300);`. Here, `trunck_string()` is another acting function - no need to worry about it. The function is working fine. But with `WP_DEBUG` **true** - it's showing error: > **Notice: Trying to get property of non-object ... line 88** And in line#88 resides:               $TopSub = get_post_meta( $post->ID, 'top_sub', $single=true );      I used this many times, but this time, I'm getting error. What's wrong with my code? For your kind information: `top_sub` is an optional custom field. There can be many _blank_ custom fields on `top_sub` and there can be many _filled_.


JQuery Issues With Wordpress Theme Interface

I'm having a back-end script issue with a recently installed theme. I took it up with the theme developer, but they are of no help (that's another story for another time). I apologize if this is outside the scope of this site, but I'm at a loss for help. Basically, I had a fully functional WP site running 3.4.2. I decided to add a new theme (MikMag by ThemeDutch) and it actually works fine on the front end. The problem I'm having is in the theme's UI, trying to create sliders. I have the theme installed on another site and it works fine. However, on this install it's throwing script errors when I try to use the slider interface. I have disabled all plugins with no change. I'm comfortable with CSS, HTML, and even minor PHP, but this stuff is beyond me. Since the site is live I don't want to start messing around with anything without knowing what I'm doing! Below is a link to a screen cap showing the errors. All of the called upon scripts appear to be exactly where they need to be when I look at the site via FTP. Here is the working version: http://www.unitytactical.com/screen2.jpg And the broken version: http://www.unitytactical.com/screen.jpg As you can see a whole section is missing, and clicking the "Add Slide" link does nothing. Hopefully this is something simple and stupid. Regardless, I truly appreciate any help. Thanks!


Insert code on specific taxonomy archives

On a woocommerce site, I am trying to insert a piece of code on all category pages. The code I am using is:               function my_code() {         if ( ! is_tax('product_cat') ) return;         ?>         <!-- my code goes here-->         <?php     }      Why does this not work?


Create a "feed" from one WordPress site to another?

I know there a way to use XML-RPC to transfer past posts from one WordPress site to another, but I am wondering if there is a way to create a constantly updating feed of posts of a certain type. That way when a post is added to one site it is simultaneously added to the other (one site being the feeder and the other only being able to display the posts). any help would be appreciated!


How to add Default Post Type "Custom" category to custom post type

Hi I have three custom post types 1- student 2 - teacher 3 - academy All three types share should have three categories 1 - subjects 2 - area 3 - qualification level First I thought I should add all three categories for each post type but I decided to add three categories to default post type and than add these categories to each individual custom post type. Here is a problem I have successfully added all these categories. When I query categories for custom post type It does show up but when I see number of posts attached to these categories It shows null means these categories are not linked properly with custom post type even though they are added. Is there anyway to add these categories to all three custom post types or shell I switch to adding all three custom categories for each individual custom post?


Login problem after installing my written plugin

I have create a simple widget plugin, it's so simple and it make no changes in cookie setting, also it work great in my local site , but in the host i have a problem after activate this plugin and try to login the WordPress again, it says: > ERROR: Cookies are blocked or not supported by your browser. or a whitepage show after logging in, and dashboard do not appear. after deactivating the plugin every thing will work correctly! what is the problem? is there any thing that i must add to my plugin for setting an special cookie?


get a specific taxonomy term name

I need to print a specific term with its id. I get that for categories with this code:               <a href="<?php echo get_category_link(1); ?>" title="<?php echo get_cat_name(1);?>"><?php echo get_cat_name(1);?>      … where 1 is the id I have to print. Is there something like the following?               <?php echo get_term_link(1); ?>      or               <?php echo get_term_name(1); ?>


Visiting Webpage ONLY after another page was visited. Possible?

I am looking for a way to solve the following problem: User should only be able to visit mywebsite.com/page2 after they visited mywebsite.com/page1. If a user was not on page1, he or she should not be able to visit page2. Is this possible? Further specification: On page1 should be a survey (plugin: "Contact Form 7") and people are redirected to page2 after submitting their answers.


Can Wordpress used as a CMS?

I saw many people use WordPress as a CMS, is that common? but the problem I noticed is that the download in such sites is slow, is WordPress slow?


Pagination not working on Custom Page Template

I searched a lot on this but I can't figure out why my code is not working. I published a page with slug "blog" that uses a custom built template "page- blog.php" that I build from editing the original "page.php". I want to loop latest posts, with pagination. For numbered pagination I tried several plugins. They all works on archive and category pages, but on page-blog.php I always get the same result. Any page I try to view gives me a 404 error. Only the loop on first page is working. URLS are like this: > www.mywebsite.com/blog/ (page url, with first page loop, ok) > > www.mywebsite.com/blog/page/2/ (404 error) > > www.mywebsite.com/blog/page/3/ (404 error) This is My page-blog.php full code.                   <?php get_header(); ?>
                                   <?php while ( have_posts() ) : the_post(); // page loop ?>                      <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                                              <?php the_title( '
', '
' ); ?>                         <?php edit_post_link( __( 'Edit', 'mywebsite' ), '', '' ); ?>
                         <?php the_content(); ?>

                      <?php endwhile; // end of the page loop. ?>                 <?php wp_reset_postdata(); ?>                      <?php                  // Begin secondary loop (pagination not working)                 $paged = ( get_query_var('page') ) ? get_query_var('page') : 1;                      $args = array (                     'post_type'              => 'post',                     'post_status'            => 'publish',                     'paged' => $paged,                 );                      // The Query                 $news_query = new WP_Query( $args );                      // Preserving main query                 $temp_query = $wp_query;                 $wp_query   = NULL;                 $wp_query   = $news_query;                      ?>                 <?php if ( $news_query->have_posts() ) : ?>                     <?php while ( $news_query->have_posts() ) : $news_query->the_post(); ?>                         <?php get_template_part( 'content', get_post_format() );?>                     <?php endwhile; ?>                          <?php  if(function_exists('wp_paginate')) {                         wp_paginate();                     } ?>                          <?php wp_reset_postdata(); ?>                      <?php else : ?>                          <?php get_template_part( 'content', 'none' ); ?>                      <?php endif; ?>                 <?php                  // Reset main query object                 $wp_query = NULL;                 $wp_query = $temp_query;                     ?>
          <?php get_sidebar('blog'); ?>     <?php get_footer(); ?>


$wpdb doesn't like to store arrays

I'm attempting to store an array that looks like the one below, into a cell in a database using the code below the sample array. Unfortunately, WordPress doesn't seem to want to save it, and continually throws a database error (like the one on the bottom). Changing the order of the data in the array changes the location of the error, which is not tied to any particular character. Sample Array (the actual array is a bit different):               $data = array();     $data['twitter'] => array( 'key1' => '64 digit long string', 'key2' => '63 digits');     $data['facebook'] => array( 'key1' => '64 digit long string', 'key2' => '63 digits');      It should be noted the column this is being inserted to is set to varchar 1000 (thus not an issue of the data being too long) Sample Insertion code:               $serialized_data = maybe_serialize($data);     $fire = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET oauth = %s WHERE email = %s",  $serialized_data, $email ) );      Sample Error: (note the real payload has been swapped out for security reasons, but the demo data is anatomically correct. Same format, same type of characters. Just randomized)               WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''wp_custom_4' WHERE email = 'chriscct7@gmail.com' SET tasks = 'a:1:{s:7:\"twitte' at line 1]     UPDATE 'wp_custom_4' WHERE email = 'sample@gmail.com' SET tasks = 'a:1:{s:7:\"twitter\";a:4:{s:11:\"oauth_token\";s:50:\"128310837-uY4xWwegwegmwIUBxWWf7gilcqQWRGWRGWzeV3tU26N\";s:18:\"oauth_token_secret\";s:45:\"MPfJMJULgjD8JwoyAsZUEHRWRGPXMrqMgzBOyvVFPtm5s\";s:7:\"user_id\";s:9:\"1282424237\";s:11:\"screen_name\";s:9:\"sampleuser\";}}'      This also isn't a consequence of the serialization method employed. I've attempted using serialize(), json_encode(), and also not serializing it at all


media_handle_sideload on a file already on server

I want to attach a file already on server but outside the wp uploads directory to a post, so I tried the `media_handle_sideload` and used the `download_url()` on the file's URL I'm trying to attach, however for some reason, the `download_url` cannot access my server, is there a work around that I can do so instead of giving `media_handle_sideload` a $_FILES array I can give it the file absolute path? Or can I move a file already on server to the temp folder?


How to show number of unpublished articles?

I recently started an article directory using wordpress, and theme by dimox and plugin and plugin by artilcesss dot com. On homepage it shows number registered authors and and published posts. It is using %2$s for registered authors and %1$s for number of published articles in main index template. I have so many unpublished articles too, so my question is that is there any way to show the number of unpublished articles (only counts) on the homepage? Update: thanks for the answers, it is useful for users like me, I am not expert in this, here is the code.
<?php global $numposts, $users; printf(__('We have %2$s registered authors and %1$s published articles till the date.', 'article-directory'), $numposts, $users); ?>
      And this will show the output: We have 24 registered authors and 43 published articles till the date. (24 and 43 numbers are current statistics)


problem with quotes on new post

i have a little form to post:               $post_content = '"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."';          $post = array( 'post_author' => 1,                    'post_title' => 'title',                    'post_content' => $post_content,                    'post_category' => $categories,                    'post_type' => 'post'                  );      but, once my post is published shows :               &;Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…&;      please note the `&;` I've tried to escape before like this:               \"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...\"      but still the same. Any ideas?


Multiple Author with link and image

I have a blog with multiple authors. Each author has an image inside the "/ wp-content/themes/mytheme/img/authornamecomeshere.png" directory, and each image has the author's name. I would like to put a link from these sites reviewers along with the image, and each image automatically appear under the name. The code I'm using is this:               <?php _e('Posted by'); ?>           <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author">                    <?php the_author_meta('display_name'); ?>                I'd like to do something like this:               Posted by:      if author1:           Posted by:      if author2:       I'd like do this without plugin. Could anyone help me?


Detect CURLOPT_SSL_VERIFYPEER programatically?

I have setup a somewhat intricate MailChimp plugin using their latest PHP class wrapper. One of the settings towards the top of the class wrapper is : ` /** * CURLOPT_SSL_VERIFYPEER setting * @var bool */ public $ssl_verifypeer = true; ` Some of the users of our plugin have to manually change this setting to 'false' to get the plugin to function correctly, and I'm not sure why or what this setting is doing. What server setting would force a user to need to set this to false? I'm looking for two things here: 1) What exactly is this setting doing? Why are some users required to set it to true and others false? 2) Is there a way to programatically detect which setting should be used, based on the users server settings? I had set up a way to detect if cURL was enabled at the server level, and am looking to do something similar here. Thanks!


New users must comment when requesting username

Does any one know of a Plug in that will help with reducing the number of unknown user requests to my site? current when a new user requests access I can only see an email address and username. Is it possible to ask the user to also make a short comment, to make it easier to see what is spam and what is valid? Regards aaron


How to edit the get_price_html on woocommerce

I am trying to edit the price value for a single product. In single- product/price.php there is a template call to $product->get_price_html. How can I edit that function/method to change the way the HTML is presented. At the moment even if I delete all the contents of the function located in `class-wc-product` it still miraculously displays? Anyone know why?


Is it possible to create an action hook using do_action() within add_action()?

Is it possible to create a new action hook like `do_action('my-hook-name');` inside a call to `add_action();`? I'm aware this code doesn't work, but I was thinking something along the lines of... `add_action('init', do_action('my-hook-name'));` or Is the only way to actually add a callback function to `init`, then inside my callback function create my hook?               add_action('init', 'my_callback');     function my_callback(){         do_action('my-hook-name');     }


Custom Post Types on Custom Categories

Can some one let me know how I can create custom Category and Post type including the items in side the red box (Please take a look at following image link) and add them to WordPress dashboard? There is an image a this link, sorry I wasn't allowed to attach image on the post Thanks


WP List Table custom quick edit box - post meta data missing and columns change on submit

I have extended class WP_List_Table to create a custom sortable table of posts along with a quick edit box with custom meta boxes. The meta boxes populate and save but when I click submit the field values disappear and the defaults ( cb, title, tags, cats, etc) which are not even included in my class get added back to the column saved. This throws off the other columns on the page. The saved custom field values return when the page is refreshed. It seams like on submit the $post_object is missing. I'm using a hacked get_inline_data function that includes the meta_values in my quick edit form instead of calling get_inline_data in my class. My save function for the meta boxes:               add_action( 'save_post', 'save_inline_edit_meta' );     function save_inline_edit_meta( $post_id  ) {         global $pagenow;              if ( $pagenow == 'admin.php' ) {          if ( isset( $_POST[ 'is_quickedit' ] )  && isset( $_POST[ 'standinghead' ] ) )             update_post_meta( $post_id, '_wnd_standing_head', $_POST[ 'standinghead' ] );              if ( isset( $_POST[ 'is_quickedit' ] )  && isset( $_POST[ 'headline' ] ) )             update_post_meta( $post_id, '_wnd_alt_title', $_POST[ 'headline' ] );              if ( isset( $_POST[ 'is_quickedit' ] )  && isset( $_POST[ 'deck' ] ) )             update_post_meta( $post_id, '_wnd_deck', $_POST[ 'deck' ] );         }       return $post_id;          }      My Javascript save function:               save : function(id) {             var params, fields, page = $('.post_status_page').val() || '';                  if ( typeof(id) == 'object' )                 id = this.getId(id);             $('table.widefat .inline-edit-save .waiting').show();             params = {                 action: 'inline-save',                 post_ID: id,                 post_type: 'post',                 edit_date: 'true',                 post_status: page             };             fields = $('#edit-'+id+' :input').serialize();             params = fields + '&' + $.param(params);                  $.post('admin-ajax.php', params,                 function(r) {                     $('table.widefat .inline-edit-save .waiting').hide();                          if (r) {                         if ( -1 != r.indexOf('<tr') ) {                             $(inlineEditPost.what+id).remove();                             $('#edit-'+id).before(r).remove();                             $(inlineEditPost.what+id).hide().fadeIn();                         } else {                             r = r.replace( /<.[^<>]*?>/g, '' );                             $('#edit-'+id+' .inline-edit-save .error').html(r).show();                         }                     } else {                         $('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();                     }                 }             , 'html');             return false;         },      ![enter image description here](http://i.stack.imgur.com/tQziA.jpg)


Insert wp gallery shortcode into custom textarea

Is there a way to insert wp gallery shortcode into custom metabox textarea ? I would like to have something like this: New metabox in post/page with textarea and below textarea there are a button to open wp browse media gallery lightbox. then when we have done to select few images as gallery, click the "insert gallery" button will insert the shortcode to the textarea custom field. is it possible ? Thanks **====== Update: ======** I was able to show media library, now I don't have idea how to insert shortcode to the custom textarea when click button "insert gallery" Here my code so far: HTML               <div class="uploader">      <textarea name="settings[_cs_shortcode_gallery]" id="_cs_shortcode_gallery"></textarea>      <input class="button tf-browse-btn" name="_cs_shortcode_gallery_button" id="_cs_shortcode_gallery_button" value="Browse Gallery"/>     </div>      JS               var _custom_media = true,           _orig_send_attachment = wp.media.editor.send.attachment;       $('.tf-browse-btn').live('click', function(e) {         var send_attachment_bkp = wp.media.editor.send.attachment;         var button = $(this);         var id = button.attr('id').replace('_button', '');         _custom_media = true;         wp.media.editor.send.attachment = function(props, attachment){           if ( _custom_media ) {             $("#"+id).val(attachment.url);           } else {             return _orig_send_attachment.apply( this, [props, attachment] );           };         }         wp.media.editor.open(button);         return false;       });       $('.add_media').on('click', function(){         _custom_media = false;       });      What I want to achieve now are:   * How to set Create Gallery Tab as default tab when open the modal   * Insert gallery shortcode to the custom textarea Please see the screenshot below for details http://i.stack.imgur.com/m1l2e.png http://i.stack.imgur.com/y9Fi5.png


Get register wp_customize settings in the front end

The `customize_register` is hooked to `wp_loaded` which runs on the front end too, but when in the frontend I access the global wp_customize variable, it's empty. I'm wondering, does WordPress removes the registered settings and section when the site is viewed? Is there a way to access the registered options in the body_class hook for example?


Symbolic Links on dev box with plugins and stylesheets

I'm using mac os x 10.6 with xampp. `http://wp3.1/` is the url to where I have WordPress installed. The physical path is `/Users/myUserName/Sites/wp3.1/` I do not install plugins or themes in the "natural" way. I have created a directory named "git" which is located in `/Users/myUserName/git/`. This is where all my git repositories live. When I want to install a plugin, I just create a symbolic link in `/Users/myUserName/Sites/wp3.1/wp-content/plugins/`. This works great for simple plugins, but if the plugin enqueue's a style sheet or script, the url displays as: `http://wp3.1/wp-content/plugins/Users/myUserName/git/options-framework- plugin/css/colorpicker.css?ver=3.1.1` How do I fix this?


Something is generating spam pages on my site

The site is Videos-de-musica.com it is a simple wordpress blog with music videos. Somehow the subdomain stats.videos-de-musica.com filled up with spam, I remember setting the domain for pwiki stats, but then uninstalled it and I don't remember what happened to it. This is an example spam page stats.videos-de-musica.com/aal-0exe.htm When you search PRINTABLE SUPERMAN EMBLEM BATMAN on Google that is the first result, and when you access it you are redirected to a "Google has found malicious software may be installed onto your computer if you proceed" scam site. I have tried disabling all the plugins with no change. Does anybody know what happened and how to remove this? I am downloading all the site directory to search for any clues. Thanks.


Show css depending on activity type in BuddyPress activity-loop

I was wondering if anyone knew of a way to show specific styles to the activity loop depending on the activity type? This is what I had an idea of:               function mycustom_act_type() {     if ('friendship_created' != bp_get_activity_type() )     echo ' style="background:red;" ';     }      and this is in the `<li>` whithin the loop:               <li <?php mycustom_act_type()?> >blah </li>      but obviously doesn't work. Any ideas?


How can I make some themes usable only by admins?

I want to restrict certain themes so they can only be usable by the an admin. If I network a theme then everyone has access to it. How can I do this?


Add Search Form to Dropdown menu

I am wondering if its possible to have a search form within a dropdown menu. I can add it to the main menu (base) but not quite sure how to actually go about adding it to a sub-menu of one of the main menu items. Has anyone encountered this issue before and is there a fix I can use ? Hopefully something linked to Wordpress it self (even a plugin if one exists).