Replacing textarea with wp_editor

I have a working front end posting system on my site that initially I designed with a simple text area for the content. I am now attempting to swap the textarea out with the TinyMCE function, wp_editor. I can easily get the editor to display and function properly, but on the submission of the form, the content is saved/not saved in a strange way. The behavior is as follows: When I attempt to publish the post the first time, the content does not seem to save, leaving the textarea blank. If I edit the post and save it again, the OLD content (from the first save) magically reappears and the new stuff is gone. After that, it randomly gives me either nothing or the old content only. I've looked around, but was only able to find this question: wp_editor textarea value not updating which doesn't exactly apply to my situation and I'm not sure that any of those solutions are really what I need. I'm not sure what code would be best to help troubleshoot, but here is my original text box:               <textarea name="user_post_content" id="user_post_content" placeholder="Enter your content..." class="inputwide"><?PHP echo ((!empty($post_obj->post_content))?$post_obj->post_content:''); ?></textarea>      And here is what I want to replace it with:               <?php wp_editor($post_obj->post_content, 'userpostcontent', 'textarea_name=user_post_content' ); ?>      Here is a pastebin of the entire page template file: http://pastebin.com/tncmQGDA Hopefully someone can help.


How to list all network sites on one page

Can I list all the blogs in my network on one page?


Is it possible to use add_filter from a theme to alter a plugin's function?

Can add_filter() be used to intercept a plugin function? I'm not having any success, so I'm thinking perhaps I'm doing this wrong. The plugin is "All in One SEO" and the function I'm trying to intercept is in the All_in_One_SEO_Pack class and its called get_original_title() Here's the code I'm trying to intercept...specifically, when the is_404() method is called...               class All_in_One_SEO_Pack {          function rewrite_title($header) {         global $aioseop_options;         global $wp_query;         if (!$wp_query) {             $header .= "<!-- no wp_query found! -->\n";             return $header;          }              $post = $wp_query->get_queried_object();              // the_search_query() is not suitable, it cannot just return         global $s;              global $STagging;              if (is_home() && !$this->is_static_posts_page()) {             $title = $this->internationalize($aioseop_options['aiosp_home_title']);             if (empty($title)) {                 $title = $this->internationalize(get_option('blogname'));             }             $title = $this->paged_title($title);             $header = $this->replace_title($header, $title);         } else if (is_attachment()) {                              $title = get_the_title($post->post_parent).' '.$post->post_title.' – '.get_option('blogname');                             $header = $this->replace_title($header,$title);         } else if (is_single()) {             // we're not in the loop :(             $authordata = get_userdata($post->post_author);             $categories = get_the_category();             $category = '';             if (count($categories) > 0) {                 $category = $categories[0]->cat_name;             }             $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));             if (!$title) {                 $title = $this->internationalize(get_post_meta($post->ID, "title_tag", true));                 if (!$title) {                     $title = $this->internationalize(wp_title('', false));                 }             }             $title_format = $aioseop_options['aiosp_post_title_format'];             /*             $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);             $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);             $new_title = str_replace('%post_title%', $title, $new_title);             $new_title = str_replace('%category%', $category, $new_title);             $new_title = str_replace('%category_title%', $category, $new_title);             $new_title = str_replace('%post_author_login%', $authordata->user_login, $new_title);             $new_title = str_replace('%post_author_nicename%', $authordata->user_nicename, $new_title);             $new_title = str_replace('%post_author_firstname%', ucwords($authordata->first_name), $new_title);             $new_title = str_replace('%post_author_lastname%', ucwords($authordata->last_name), $new_title);             */             $r_title = array('%blog_title%','%blog_description%','%post_title%','%category%','%category_title%','%post_author_login%','%post_author_nicename%','%post_author_firstname%','%post_author_lastname%');             $d_title = array($this->internationalize(get_bloginfo('name')),$this->internationalize(get_bloginfo('description')),$title, $category, $category, $authordata->user_login, $authordata->user_nicename, ucwords($authordata->first_name), ucwords($authordata->last_name));             $title = trim(str_replace($r_title, $d_title, $title_format));          //      $title = $new_title;     //      $title = trim($title);             $title = apply_filters('aioseop_title_single',$title);             $header = $this->replace_title($header, $title);         } else if (is_search() && isset($s) && !empty($s)) {             if (function_exists('attribute_escape')) {                 $search = attribute_escape(stripcslashes($s));             } else {                 $search = wp_specialchars(stripcslashes($s), true);             }             $search = $this->capitalize($search);             $title_format = $aioseop_options['aiosp_search_title_format'];             $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);             $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);             $title = str_replace('%search%', $search, $title);             $header = $this->replace_title($header, $title);         } else if (is_category() && !is_feed()) {             $category_description = $this->internationalize(category_description());                 if($aioseop_options['aiosp_cap_cats']){                     $category_name = ucwords($this->internationalize(single_cat_title('', false)));                 }else{                         $category_name = $this->internationalize(single_cat_title('', false));                 }                        //$category_name = ucwords($this->internationalize(single_cat_title('', false)));             $title_format = $aioseop_options['aiosp_category_title_format'];             $title = str_replace('%category_title%', $category_name, $title_format);             $title = str_replace('%category_description%', $category_description, $title);             $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title);             $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);             $title = $this->paged_title($title);             $header = $this->replace_title($header, $title);         } else if (is_page() || $this->is_static_posts_page()) {             // we're not in the loop :(             $authordata = get_userdata($post->post_author);             if ($this->is_static_front_page()) {                 if ($this->internationalize($aioseop_options['aiosp_home_title'])) {                                  //home title filter                             $home_title = $this->internationalize($aioseop_options['aiosp_home_title']);                             $home_title = apply_filters('aioseop_home_page_title',$home_title);                             $header = $this->replace_title($header, $home_title);                      }             } else {                 $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));                 if (!$title) {                     $title = $this->internationalize(wp_title('', false));                 }                 $title_format = $aioseop_options['aiosp_page_title_format'];                 $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);                 $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);                 $new_title = str_replace('%page_title%', $title, $new_title);                 $new_title = str_replace('%page_author_login%', $authordata->user_login, $new_title);                 $new_title = str_replace('%page_author_nicename%', $authordata->user_nicename, $new_title);                 $new_title = str_replace('%page_author_firstname%', ucwords($authordata->first_name), $new_title);                 $new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);                 $title = trim($new_title);                                 $title = $this->paged_title($title);                 $title = apply_filters('aioseop_title_page',$title);                 $header = $this->replace_title($header, $title);             }         } else if (function_exists('is_tag') && is_tag()) {             global $utw;             if ($utw) {                 $tags = $utw->GetCurrentTagSet();                 $tag = $tags[0]->tag;                 $tag = str_replace('-', ' ', $tag);             } else {                 // wordpress > 2.3                 $tag = $this->internationalize(wp_title('', false));             }             if ($tag) {                 $tag = $this->capitalize($tag);                 $title_format = $aioseop_options['aiosp_tag_title_format'];                 $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);                 $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);                 $title = str_replace('%tag%', $tag, $title);                 $title = $this->paged_title($title);                 $header = $this->replace_title($header, $title);             }         } else if (isset($STagging) && $STagging->is_tag_view()) { // simple tagging support             $tag = $STagging->search_tag;             if ($tag) {                 $tag = $this->capitalize($tag);                 $title_format = $aioseop_options['aiosp_tag_title_format'];                 $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);                 $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);                 $title = str_replace('%tag%', $tag, $title);                 $title = $this->paged_title($title);                 $header = $this->replace_title($header, $title);             }         } else if (is_archive()) {             $date = $this->internationalize(wp_title('', false));             $title_format = $aioseop_options['aiosp_archive_title_format'];             $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);             $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);             $new_title = str_replace('%date%', $date, $new_title);             $title = trim($new_title);             $title = $this->paged_title($title);             $header = $this->replace_title($header, $title);         } else if (is_404()) {             $title_format = $aioseop_options['aiosp_404_title_format'];             $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);             $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);             $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);             $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);             $new_title = str_replace('%404_title%', $this->internationalize(wp_title('', false)), $new_title);             $header = $this->replace_title($header, $new_title);         }              return $header;          }}


How to pull blogposts using shortcodes

I want to grab the two latest blog posts on my homepage. i would also like the option to select the category if I want to also, but mainly just pulling the latest 2 blog posts. Thanks


is there a way to remove featured image from blog page and single page

<?php     /*      *      * The default template for displaying content. Used for both single and index/archive/search.      *      * @package WordPress      * @subpackage Twenty_Twelve      * @since Twenty Twelve 1.0      */     ?>              <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                 <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
                         <?php _e( 'Featured post', 'twentytwelve' ); ?>
                 <?php endif; ?>                                           <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?>                         <?php if ( is_single() ) : ?>
<?php the_title(); ?>
                         <?php else : ?>
                                 <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?>
                         <?php endif; // is_single() ?>                         <?php if ( comments_open() ) : ?>
                                         <?php comments_popup_link( '' . __( 'Leave a reply', 'twentytwelve' ) . '', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
                         <?php endif; // comments_open() ?>                                       <?php if ( is_search() ) : // Only display Excerpts for Search ?>
                         <?php the_excerpt(); ?>
                 <?php else : ?>
                         <?php the_content( __( 'Continue reading →', 'twentytwelve' ) ); ?>                         <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'twentytwelve' ), 'after' => '
' ) ); ?>
                 <?php endif; ?>                                               <?php twentytwelve_entry_meta(); ?>                         <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '', '' ); ?>                         <?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>

                                                 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>

<?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?>

<?php the_author_meta( 'description' ); ?>

                                                         <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">                                                                 <?php printf( __( 'View all posts by %s →', 'twentytwelve' ), get_the_author() ); ?>

                         <?php endif; ?>
      At moment in the TwentyTwelve theme looks like `the_post_thumbnail()` gets the featured image and render it in the main blog page and the single page I tired removing it but it also removed any other images the blog might have, I would like to only remove the featured image from the main blog page where all the posts are listed and the single.php. Any help would be greatly appreciated                <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?>


Is it possible to check is loaded language files correctly with WordPress plugin?

I have a plugin to be translated. I have done following tasks: 1. Loaded the TextDomain               $my_td = 'mysignup';     function my_signup_textdomain_init() {         load_plugin_textdomain( $my_td, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );     }     add_action('plugins_loaded', 'my_signup_textdomain_init');      2. Added language files(po, pot, mo) in `wp_plugin_folder\my_signup\languages` (for Bengali bn_BD)   * mysignup.pot   * mysignup.mo   * bn_BD.po   * bn_BD.mo 3. Changed the language code in `wp_config.php` file               define('WPLANG', 'bn_BD');      But the problem is nothing is changed. I am not sure what I have done wrong.   Now I need to know how can I test everything, whether what I've done is fine, and how can I solve the issue.


Best practices for a Style/CSS based theme options page?

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc. I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option. For instance `background-color: <?php echo get_option('background_color'); ?>;` Would I be correct in assuming this is a bad idea performance wise if there are many options? I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this? Would creating a custom script that writes to the static CSS file be a good idea? Is there any way the settings API can handle this? ** PS. Great answer but I have decided to actually go with writing to a static file as it provides way less overhead.


Delete post is image is missing or broken link

Is there a easy way to delete post if image link in post is broken? I want to move large number of posts, but I noticed that some images may have broken links (to external sites) and images are missing. Rather than fixing all this, I would prefer simple to delete posts that have missing images. I noticed there is a script that can unlink broken link - so would be possible to just modify this and say if post have broken link (image or any other broken link) - delete post! Please note I am very interested in this script and not any other solution to sort my website. This script or any other smart solution to automatically delete posts with rboken links would be greatly appreciated. Thanks good people.


making my own "related pages" / "pages you might like" section

I'm trying to get the tags of a post on the single content page and displaying a list of other articles that share the tags with the post. For example, the user is reading an article with a tag like 'game'; I want to display the titles of other articles that share the tag 'game'. I'm basically trying to make my own "related pages" section. How would I do this without using a plugin and which PHP file does the code go? I am using wordpress 3.2.1 and a child theme for the Twenty-Eleven theme.


How to make an image bigger with wp_get_image_editor

I'm trying to programmatically increase the size of images that are uploaded. I want to double the size of each image. The code I've written so far is:               $pathDirectory = dirname( $imagePath );     $large_w = $width*2; // These values are correct     $large_h = $height*2; // These values are correct     $largeImage = wp_get_image_editor( $imagePath );     $largeFilename = $largeImage->generate_filename("large", $pathDirectory, $ext);     $largeImage->set_quality(100);       $largeImage->resize($large_w, $large_h, false);     $largeImage->save($largeFilename);      This is making an image with the '-large' bit in the filename but it's exactly the same size as the original image. After reading the WP manual is says regarding resize:               resize( $max_w, $max_h, $crop = false ) // NOTE - max width and max height     Resizes current image.      So I'm thinking that resize only makes images smaller? Am I right in assuming this and, if so, how do I make images bigger with WP? Thanks for your help :-)


Adding an input field to the comment form, and not letting it submit if any info is in it

I am working on a WordPress plugin that adds a hidden input field into the comment form. I have the code in place that adds the input field in, using this code.               function hiddeninput_more_comments( $post_id ) {         echo '<input type="hidden" id="hidden-input" name="hidden-input" />';     }          add_action( 'comment_form', 'hiddeninput_more_comments' );      Now, I'm stuck on this issue - I have the field empty in value, and I would like it to not allow the comment to submit if any info is put into the input field, but I cannot figure it out for the life of me. Any ideas? **Edit: Figured it out** So, I found this tutorial which shows the following code that checks if data is added to the field.               add_filter( 'preprocess_comment', 'verify_comment_meta_data' );          function verify_comment_meta_data( $commentdata ) {         if ( ! isset( $_POST['city'] ) )             wp_die( __( 'Error: please fill the required field (city).' ) );         return $commentdata;     }      For what I needed, I changed the **isset** to **empty** , so if the field I added in isn't empty, it gives the **wp_die** error message


How to programmatically add login form to wp_nav_menu X position

I have a menu I created in WP that registers 'main_nav' so the user can still use the Appearance > Menus screen to edit their menu. However I need to add the login form to the 4th (main) menu items sub menu and I am a bit confused on the best way to do that. I have browsed the forums online and found this post: How to Hard Code Custom menu items However it doesn't give me an idea on how to add something to the (4th) menu items sub menu while still retaining the ability for admin to add/edit menu from the Appearance Menus section. I would rather not program the whole nav menu if possible because I would like for the site admin to still be able to edit other menu items. What (if any) is the best way to go about adding the `wp_login_form()` to the 4th menu items sub menu (second position)? An example is lets say I have a menu and one tab is called Members, in that sub-menu I would like to have Register (link), the login form and the last menu item would be forgot password(link). Any ideas?


$post->ID not working

I have the following code and while get_the_ID() works, $post->ID does not, why?                   $the_query = new WP_Query( array(             'post_type' => 'custompost',         ) );              while ( $the_query->have_posts() ) : $the_query->the_post();             echo $post->ID;         endwhile;


page displaying media caption shortcodes

I am developing my first wordpress theme. I encountered a problem in page section. I added a image in a page with add media button. When i viewed the page, it does display the image but also the caption part.                [caption id="attachment_50" align="alignnone" width="300"] (actual image) [/caption]      I can't figure out why it's showing up. I googled a lot but couldn't find a solution. Please help me out.


Calling external Libraries in Wordpress

I am doing some maintenance on a blog that I was hired to create a couple of months ago. They wanted to add a slider in, so I started to implement FlexSlider. I ran into a problem though with the slider. I have added the needed dependencies into the header:                         <link rel="stylesheet" href="<?php echo get_bloginfo('template_directory'); ?>/flexslider.css" type="text/css" media="screen" />           In my index file, I have:

        <?php query_posts(array ( 'posts_per_page' => 1, 'tag'=> 'one' )); ?>         <?php while (have_posts()) : the_post(); ?>     <?php       $slider_image = get_post_meta($post->ID, 'slider_image', true);?>     <img src="<?php echo $slider_image[0]['image']; ?>" />

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

<?php the_time('F jS, Y') ?> by <?php the_author() ?>

<?php echo excerpt(55); ?>

<a href="<?php the_permalink(); ?>"> Read More >
             <?php endwhile; ?>

      My issue is this really, when you look at the slider, the "slides" dont seem to be styled at all, and the jquery files do not seem to be functioning at all. I keep seeing an error that:               Uncaught TypeError: Object #<Object> has no method 'slides'     :1112/:22Uncaught TypeError: Object #<Object> has no method 'flexslider'      You can see what I am working on at http://louisstephens.cc/blog (using my own blog so I do not mess up the client's site). Does anyone see something that I am missing to get this functioning properly?


Count all images of a certain post type

I followed two posts related to my query. One was about the number of images attached to a post and second about showing all images of a certain post type. I tried to combine the two codes in the following way but it didn't help:               $query = new WP_Query( array( 'post_type' => 'gallery', 'posts_per_page' => -1 ) );     if( $query->have_posts() ){         while($query->have_posts()){             $query->the_post();             $attachments = get_children( array( 'post_parent' => $parent->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) );             $count = count( $attachments );         }     }      Can anyone help me in counting all images attached to a certain post type?


WP 3-way voting system: On to something! Please help!

Okay I posted a question yesterday, that can be found here. I've found some code on the wonderful internet that I think is really the ticket for me, but I don't know how to develop into what I really need. Here is the breakdown - I need three separate vote links. I need to change the word "Vote" on each to something else. IE: Good/Meh/Bad. (I think I can figure this one out) I'm hoping there is a simple and easy way to slap another two vote links into this code, because the code itself is really simple and easy. Just beg pardon my lack of PHP/Jquery knowledge. Header code:               <?php wp_enqueue_script( 'jquery' ) ?>     <?php wp_head(); ?>           vote.php file:               <?php     $file = dirname(__FILE__);     $file = substr($file, 0, stripos($file, "wp-content") );          require( $file . "/wp-load.php");          $currentvotes = get_post_meta($_POST['post'], 'votes', true);     $currentvotes = $currentvotes + 1;          $voters = get_post_meta($_POST['post'], 'thevoters', true);     if(!$voters) $voters = $_POST['user']; else $voters = $voters.",".$_POST['user'];          update_post_meta($_POST['post'], 'votes', $currentvotes);     update_post_meta($_POST['post'], 'thevoters', $voters);          echo $currentvotes;     ?>      Functions.php reference:               function voting($id) {     global $user_ID;     $currentvotes = get_post_meta($id, 'votes', true);     $voters = get_post_meta($id, 'thevoters', true);     $voters = explode(",", $voters);     foreach($voters as $voter) {      if($voter == $user_ID) $alreadyVoted = true;     }          if(!$currentvotes) $currentvotes = 0;     echo '
'.$currentvotes.'';     if($user_ID && !$alreadyVoted) echo '
'.__("Vote").'';     if($user_ID && $alreadyVoted) echo '
'.__("Voted").'';     echo '
';     if(!$user_ID) echo '

'.__('Register').' '.__('to vote').'.

';     }      Source has a demo. Any and all help with this would be really, really appreciated. Thanks in advance.


wp_enqueue_style with style.php and Wordpress functions

I use wp_enqueue_style to add my stylesheet, like this:               <?php wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.php', false, '1.0', 'all' ); ?>      It works fine BUT **I need to run a Wordpress function in the style.php file**. The stylesheet file does not know that the core exists. **This is what I've heard**   * It's bad to include wp-load.php.   * It's bad to include the stylesheet directly to header.php because plugins can't find it.   * It's bad to include the stylesheet direclty to wp_head functions because plugins can't find it. Is there a "correct" way to do this?


Is Wordpress "publish" atomic?

If it is atomic, this must be a bug. What I have noticed is that, when a post is being published and I close the window, the post gets published partially - one time only body came but not the subject. Is this supposed to happen? I am not using wordpress client, but using it online to post on a blog.


Possibility of including third party software/plugins in the Wordpress repository

I've been looking into using the Wordpress Repository for one of my larger plugins, the problem is that it's using a lot of third party software. Video players/Slide scripts/Jquery includes, some of which are commercial in nature. My question is related to the content that differs from the GPL v2. Id like to include those into the plugin, since that would make it easier to use. If I get permission from the third party, is this possible? As an example flowplayer (GPL 3) and Longtail Video Player (Commercial). Also will this supporting software be exempt from the GPL 2 license restriction?


Remove image caption from post excerpt

I am currently using a wordpress plugin called "limit-posts" to better customize my post excerpts. The only issue I have is the excerpt is including the caption text from the image that is within the post. I can see in the code that all captions are enclosed in tags Is there a way I can strip out the any content within em tags from the post excerpt? Here is a link to the current plugin in use - http://labitacora.net/comunBlog/limit-post.phps Thank you very much


CSS file not registering through add_action

Im having a problem to register and load a gallery css code from my home page. Rest of the styles are loading fine, but this flexslider is not registering. Any guidance appreciated.               <?php           function theme_styles() {          wp_enqueue_style ('normalize', get_template_directory_uri() . '/css/normalize.css');     wp_enqueue_style ('grid', get_template_directory_uri() . '/css/grid.css');     wp_enqueue_style ('main', get_template_directory_uri() . '/style.css');          wp_register_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' );     if( is_page( 'home' ) ) {         wp_enqueue_style( 'flexslider' );     }     }     add_action( 'wp_enqueue_scripts', 'theme_styles' );          // Enable custom menus     add_theme_support( 'menus' );          ?>


Add Different Actions To Different Page's wp_footer

I am trying to add functions to wp_footer based on the the page id. I am hooking my callback to `init`, but its not working. Here is what I am using.               function fl_template_loader() {              if ( is_page( 1032 ) ) {             add_action( 'wp_footer', 'fl_theme_midnight' );         }         if ( is_page( 1032 ) ) {             add_action( 'wp_footer', 'fl_theme_passion' );         }     }     add_action( 'init', 'fl_template_loader', 0 );      What I am doing wrong? Is the `init` firing too early or too late? I tried to hook in `plugins_loaded` (for early execution) and `wp_loaded` (for later execution), but all failed.


Show Post Content with AJAX

I want to do a very basic AJAX call where, on click of a list item, a container div fills with associated content pulled from a Wordpress page. I'm a newb with AJAX; I've tried a few different routes today but to no avail. I got the page to load in the container but I want only the post content (as if I called the_content() in the div but doing it AJAX style). I only have three pages I would like to pull from. Does anyone know of a simple way to accomplish this? I would greatly appreciate it. Thank you.


Write CSV from array or custom $wpdb query results

Inside a template page I do a $wpdb query with two dates recieved from POST method. I process the query results into an array, and then I show them in a table. I want to offer a link to download the array data into a CSV. What options do you suggest me to achieve that? This is my code, just in case.               <?php                      global $wpdb, $current_user;                 //$wpdb->show_errors();                      get_currentuserinfo();                 $tabla_entradas = $wpdb->prefix.'entradas';                      if(isset($_POST['desde'])){                          //Guardo las fechas considerando la ultima hora.                     $desde = $_POST['desde'] . ' 23:59:59';                     $hasta = $_POST['hasta'] . ' 23:59:59';                          //Consulto                     $entradas = $wpdb->get_results($wpdb->prepare("SELECT user, precio, vencimiento                                                                     FROM {$tabla_entradas}                                                                     WHERE updated >= %s AND updated <= %s", $desde, $hasta));                          /*                     echo '
';                     print_r($entradas);                     echo '
';                     */                          $reporte = array();  // the REPORT !                                  //Lleno el arreglo del reporte                     foreach ($entradas as $entrada) {                              $legajo = $entrada->user;                              //sino existe el legajo en el reporte, inicializo total.                         if (isset($reporte[$legajo])) $reporte[$legajo]['total'] += $entrada->precio;                         else $reporte[$legajo]['total'] = $entrada->precio;                              //busco el nombre                         $empleado = get_user_by('login', $legajo);                         $reporte[$legajo]['nombre'] = $empleado->display_name;                          }                          //TABLE.                     echo '
',                          '
',                            '
',                               'Legajo	',                               'Nombre	',                               'Total	',                            '
';                          foreach ($reporte as $k => $v) {                         //Fila.                         echo '
',                                 '' . $k . '	',                                 '' . $v['nombre'] . '	',                                 '$ ' . $v['total'] . '	',                              '
';                     }                     echo '
',                          '
';                      }       ?>


Get the author registration date in the header.php file

I have some code that executes in header.php as follows:                 if (is_author()) {           $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));           $date = $curauth->user_registered;       }      I've tried to get this user information out of this code in a few different ways and can't seem to get the user object itself at all. It is null. I was thinking maybe the user object isn't available at this stage at where it's being called, but Wordpress is accurately getting into is_author() code based on determining the current page is an author template. What am I doing wrong?


Display Custom Post Type and Custom Taxonomy Data on Front End Using Only a Plugin

Can anyone suggest a good plugin-based, as opposed to template or theme-based, solution for the following that doesn't rely on shortcodes? I have a plugin that creates a custom post type and four custom taxonomies. The custom post type has the `/songs` slug. The custom taxonomies have the following slugs: `/songs/genres`   `/songs/eras`   `/songs/venue`   `/songs/artists` My question is, how do I get the following URLs to show my custom content IN TABLE FORM without messing with custom templates or shortcodes? `/songs` - show a table of all songs in the database sorted by song name   `/songs/<song-name>` - show a table of data connected to this song   `/songs/genres` - show a table of all genres in the database sorted by genre name   `/songs/eras` - show a table of all eras in the database sorted by era name   `/songs/venue` - show a table of all venues in the database sorted by venue name   `/songs/artists` - show a table of all artists in the database sorted by artist name   `/songs/genres/<genre>` - show a table of songs, sorted by name, with this genre   `/songs/eras/<era>` - show a table of songs, sorted by name, with this era   `/songs/venue/<venues>` - show a table of songs, sorted by name, with this venue   `/songs/artists/<artist>` - show a table of songs, sorted by name, with this artist _Example table I'd like on every page:_               Song Name | Artist  | Genre  | Era  | Venue     --------------------------------------------     song1     | artist1 | genre1 | era1 | venue1     song2     | artist2 | genre2 | era2 | venue2      I've figured out how to do this using custom templates, but these templates won't work with all themes. The custom templates would have to be re-coded for any theme other than the one I'm using for development. In my reading on this issue, I've come to understand that it's not a good idea to put design code into plugins. But, if this is the case, how can I be sure my custom content gets displayed appropriately across many different themes? I think what I'm missing is how custom post types and custom taxonomies can be portable across themes. If I haven't provided enough information, let me know what more I need to share. Thanks.


Image upload and other options in the same plugin settings form?

I write a wordpress plugin. My plugin has two options. One is an image upload mechanism and the other is a checkbox. My code is below:               <?php     /*     Plugin Name: Plugin Name     Plugin URI:     Description: Description     Version: 0.0.1     Author: Author Name     Author URI:     License: GPL3+     */          add_action( 'admin_menu', 'pluginname_menu' );          function pluginname_menu()         {         add_options_page( 'PluginName Options', 'pluginname', 'manage_options', 'pluginname_options_page', 'pluginname_options_page' );         }          add_action( 'admin_init', 'pluginname_admin_init' );          function pluginname_admin_init()         {         register_setting( 'pluginname_options', 'pluginname-settings' );         add_settings_section( 'section', 'Section', 'pluginname_section_callback', 'pluginname_options-section' );         $options_array = get_option('pluginname-settings');         add_settings_field( 'upload_image', 'Upload image', 'image_upload_callback', 'pluginname_options-section', 'section');         add_settings_field( 'use_image', 'Use image', 'use_image_callback', 'pluginname_options-section', 'section', array(         'name' => 'pluginname-settings[use_image]',         'value' => isset($options_array['use_image']) ? $options_array['use_image'] : '')         );              }          function pluginname_validate($input)         {         $options_array = get_option('pluginname-settings');         $output = array_merge($options_array, $input);         return $output;         }          function pluginname_section_callback()         {         echo 'Feel free to change parameters below.';         }          function upload_image_callback()         {         echo "Filename:<input type='file' name='file' value='image' />";         }          function use_image_callback( $args )         {         $name = esc_attr( $args['name'] );         $value = esc_attr( $args['value'] );         echo "<input type='checkbox' name='$name' value='$value'>";         }          function pluginname_options_page()         {         $uploadedfile = isset($_FILES['file']) ? $_FILES['file'] : '';         if ($uploadedfile['error'] == '0')             {             $upload_overrides = array( 'test_form' => false );             $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );             $options_array = get_option('pluginname-settings');             $options_array['upload_image'] = $movefile['url'];             update_option('pluginname-settings', $options_array);         }              echo "
";         echo "
Options
";         echo "<form action='options.php' method='POST' enctype='multipart/form-data'>";         settings_fields( 'pluginname_options' );         do_settings_sections( 'pluginname_options-section' );          submit_button('Update', 'primary',  'submit-form', false);         echo "</form>";         echo "
";     }     ?>      I have difficulty using both options in the same form. If I remove `action='options.php'`, then the checkbox value is not being saved (validation function is not called). If I remove `enctype='multipart/form-data'`, I can not upload. Leaving everything in place renders the options page completely unusable. Please, help.


How to remove trailing </li> tags from wp_nav_menu walker

I have used theme twenty thirteen a my base theme and Have tried used code from http://stackoverflow.com/questions/12159486/wordpress-change-header- navigation-list-items-to-div when I try to validate the page I get an error with invalid trailing `</li>` tags I am trying to create this result from the walker class

text

Text>

      But always end up with trailing `</li>` tags can anyone help with this problem I tried this first               class Description_Walker extends Walker_Nav_Menu     {         function start_el(&$output, $item, $depth, $args)         {             $classes = empty($item->classes) ? array () : (array) $item->classes;             $class_names = join(' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );             !empty ( $class_names ) and $class_names = ' class="'. esc_attr( $class_names ) . '"';             $output .= "
ID' $class_names>";             $attributes  = '';             !empty( $item->attr_title ) and $attributes .= ' title="'  . esc_attr( $item->attr_title ) .'"';             !empty( $item->target ) and $attributes .= ' target="' . esc_attr( $item->target     ) .'"';             !empty( $item->xfn ) and $attributes .= ' rel="'    . esc_attr( $item->xfn        ) .'"';             !empty( $item->url ) and $attributes .= ' href="'   . esc_attr( $item->url        ) .'"';             $title = apply_filters( 'the_title', $item->title, $item->ID );             $item_output = $args->before             . ""             . $args->link_before             . $title             . '
'             . $args->link_after             . $args->after;             $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );         }     }      and put this in the header               wp_nav_menu(         array (             'menu' => 'main-menu',             'container' => 'div', // parent container              'container_id' => 'my_nav', //parent container ID             'depth' => 1,             'items_wrap' => '%3$s', // removes ul         'walker' => new Description_Walker // custom walker to replace li with div         )     );      I have tried modifying this code but I all ways get trailing `</li>` tags do you think you could point me in the right direction been work on this problem for over a week others seem to have the same problem and I have tried what has been suggested but to no avail. by the way this code was provided by RCV


upgrade v. 2.8.5 to latest version of wordpress

Is it possible to upgrade WordPress version 2.8.5 to 3.9.2? I am trying to upgrade but the WordPress give me the link to download the latest version of WordPress. If it is possible, how am I going to upgrade my version 2.8.5 to 3.9.5?   Thanks in advance.


Optimizing Query used for a Shortcode

So, I have this shortcode that produces a list of all published multisite and their pages. The network in question has about 50 sites in it. The problem is that loading the page I put the shortcode on takes an extra couple of seconds to load. So performance blows. Wondering what I can do to optimize this. Thoughts?               <?php     class Multisite_Shortcode{              /** Multisite parameters         * network_id'  = $wpdb->siteid,         * site_order'  = 'blog_id ', // blog_id, site_id, domain, path, registered, last_updated, public, archived, mature, spam, deleted, lang_id         * site_sort'   = 'ASC', // ASC or DESC         * public'      = null,         * archived'    = null,         * mature'      = null,         * spam'        = null,         * deleted'     = null,         * limit'       = 100,         * offset'      = 0,              ** pages parameters         * depth'       = 0,         * child_of'    = 0,         * exclude'     = '',         * sort_column' = 'menu_order, post_title',         * sort_order'  = 'ASC', // ASC or DESC         * link_before' = '',         * link_after'  = '',         */              /**         * Shortcode initialization         * @return void         */         function __construct() {             add_shortcode( 'blog_pages', array(&$this, 'shortcode_blog_pages') );         }              function shortcode_blog_pages( $atts ) {             global $wpdb;             $args = shortcode_atts( array(                 // blog parameters                 'network_id' => $wpdb->siteid,                 'site_order' => 'blog_id ', // blog_id, site_id, domain, path, registered, last_updated, public, archived, mature, spam, deleted, lang_id                 'site_sort'  => 'ASC',                 'public'     => null,                 'archived'   => null,                 'mature'     => null,                 'spam'       => null,                 'deleted'    => null,                 'limit'      => 100,                 'offset'     => 0,                      // pages parameters                 'depth'         => 0,                 'child_of'      => 0,                 'exclude'       => '',                 'sort_column'   => 'menu_order, post_title',                 'sort_order'    => 'ASC',                 'link_before'   => '',                 'link_after'    => '',             ), $atts );                  $html = '';                  if ( wp_is_large_network() )                 return $html;                  $query = "SELECT * FROM $wpdb->blogs WHERE 1=1 ";                  if ( isset( $args['network_id'] ) && ( is_array( $args['network_id'] ) || is_numeric( $args['network_id'] ) ) ) {                 $network_ids = implode( ',', wp_parse_id_list( $args['network_id'] ) );                 $query .= "AND site_id IN ($network_ids) ";             }                  if ( isset( $args['public'] ) )                 $query .= $wpdb->prepare( "AND public = %d ", $args['public'] );                  if ( isset( $args['archived'] ) )                 $query .= $wpdb->prepare( "AND archived = %d ", $args['archived'] );                  if ( isset( $args['mature'] ) )                 $query .= $wpdb->prepare( "AND mature = %d ", $args['mature'] );                  if ( isset( $args['spam'] ) )                 $query .= $wpdb->prepare( "AND spam = %d ", $args['spam'] );                  if ( isset( $args['deleted'] ) )                 $query .= $wpdb->prepare( "AND deleted = %d ", $args['deleted'] );                  $query .= " ORDER BY {$args['site_order']} {$args['site_sort']} ";                  if ( isset( $args['limit'] ) && $args['limit'] ) {                 if ( isset( $args['offset'] ) && $args['offset'] )                     $query .= $wpdb->prepare( "LIMIT %d , %d ", $args['offset'], $args['limit'] );                 else                     $query .= $wpdb->prepare( "LIMIT %d ", $args['limit'] );             }                  $site_results = $wpdb->get_results( $query, ARRAY_A );                  $html = '';                  // Add other parameter to the list pages             $args['echo'] = false;             $args['title_li'] = '';             $args['walker'] = '';                  foreach( $site_results as $blog ) {                 switch_to_blog( $blog['blog_id'] );                 $list_pages = @wp_list_pages( $args );                 restore_current_blog();                      $details = get_blog_details( array( 'blog_id' => $blog['blog_id'] ) );                 $title = "siteurl}'>{$details->blogname}";                      $html .= "
blog_id}' class='site-pages'>
$title

$list_pages

";             }                  return $html;         }     }          new Multisite_Shortcode();     ?>


How to debug register_setting callback function

I am using the following code:               register_setting(             'myplugin_options', //setting group name             'myplugin_options', //option name that will be stored in the database             'myplugin_validate_options'//optional callback function     );          function myplugin_validate_options($input) {         //how can i print $input to the screen or view the output of this function for debugging purpsoses?          }      I just need to know how we can debug our validation callback functions. From what I see they can not be output to the screen so it makes writing correct code inside of them difficult. Thanks.


Help with Post Meta

This snippet pulls in post "industry" for the current post               $post_meta = get_post_meta( $post->ID );       This code pulls in all the logos for the "brands"               <?php query_posts( 'post_type=brands&orderby=title&order=ASC&posts_per_page=-1' );                           $i = 0;                 if ( have_posts() ) while ( have_posts() ) : the_post(); ?>                     <li id="feature<?php echo $i; ?>"><a href="<?php the_permalink(); ?>" rel="<?php echo $i; ?>"><image src="<?php echo get_post_meta( $post->ID, 'brand_logo_sm', true ); ?>" />
                 <?php $i++; endwhile; wp_reset_query(); ?>      I need some help limiting the the above code to ONLY display the brands that match the "$post_meta" If have tried:               <?php query_posts( 'post_meta=brand_industry&orderby=title&order=ASC&posts_per_page=-1' );      With not lock. Any tips? Thx! Function where I declare the meta:               $brand_meta = array(         'brand_email' => 'Email',         'brand_url' => 'Website',         'brand_stores' => 'Global Store Locator ID',         'brand_gallery' => 'Gallery ID',         'brand_products' => 'Products',         'brand_industry' => 'Industry'     );      Answer to comment below: This code, outputs all the logos.               <?php query_posts( 'post_type=brands&orderby=title&order=ASC&posts_per_page=-1' );                           $i = 0;                 if ( have_posts() ) while ( have_posts() ) : the_post(); ?>                     <li id="feature<?php echo $i; ?>"><a href="<?php the_permalink(); ?>" rel="<?php echo $i; ?>"><image src="<?php echo get_post_meta( $post->ID, 'brand_logo_sm', true ); ?>" />
                 <?php $i++; endwhile; wp_reset_query(); ?>      I only want it to display the logos if the "industry" gets outputted using this code:               <?php $post_meta = get_post_meta( $post->ID ); ?>      is equal to X Thant make sense?


Applying class to links around self hosted images embedded to posts/pages

So I need to add a class to links around the images for lightbox purposes. But only to images from the upload directory, not to external ones. I've found this solution by @TommiForsström here:               function add_colorbox_class_to_image_links($html, $attachment_id, $attachment) {     $linkptrn = "/<a[^>]*>/";     $found = preg_match($linkptrn, $html, $a_elem);          // If no link, do nothing     if($found <= 0) return $html;          $a_elem = $a_elem[0];          // Check to see if the link is to an uploaded image     $is_attachment_link = strstr($a_elem, "wp-content/uploads/");          // If link is to external resource, do nothing     if($is_attachment_link === FALSE) return $html;          if(strstr($a_elem, "class=\"") !== FALSE){ // If link already has class defined inject it to attribute         $a_elem_new = str_replace("class=\"", "class=\"colorbox ", $a_elem);         $html = str_replace($a_elem, $a_elem_new, $html);     }else{ // If no class defined, just add class attribute         $html = str_replace("<a ", "<a class=\"colorbox\" ", $html);     }          return $html;     }          add_filter('image_send_to_editor', 'add_colorbox_class_to_image_links', 10, 3);      Looks like it's exactly what I need, except it doesn't work. I've tried it on a clean WP thirty thirteen install as well. Any thoughts? Thanks!


Check for correct username on custom login form

I have used Jeff Star's tutorial for creating my own custom login form http://digwp.com/2010/12/login-register-password-code/. It works great, but I have one problem. On the reset password form, if someone enters their username incorrectly (so that it doesn't verify), they get kicked to the default wp- login.php?action=lostpassword with the error message. Is there a way to redirect to my own error page? Thanks!


2014 Theme Mobile Menu

Any suggestions on making 2014 Theme Mobile Menu have drop down vertical sub- navigation - instead of displaying all subnavs horizontally images show before, and looking to achieve ![before](http://i.stack.imgur.com/fXMZW.png) ![looking to achieve](http://i.stack.imgur.com/C9P7J.png)


Displaying Custom Taxonomy Children in Dropdown

I have a question I hope you can help me with. I have a custom taxonomy called locations and on the first level I have the areas (Asia, Europe, etc) and under each area I have countries (England, South Africa). What I would like to do it display a dropdown menu of all the children of that particular parent similar to what was done here, http://wordpress.org/support/topic/terms-of- custom-taxonomy-in-a-dropdown-menu . However, I want the dropdown to only display the children of the parent page I am currently on, not all the terms. So if I am on North America I want it to show the United States and Mexico and if I am on the Europe parent page I want it to show England. Does that make sense? Nick


Why is `add_meta_box` not working?

I'm trying to add some meta fields to a WPSC product using the following code:               /**      * data callback      */     function abc_callback($object, $box)     {         echo 'callback executed!';     }          /**      * add custom fields      */     function abc_load_post($post_id)     {         add_meta_box('abc_post_id', 'abc', 'abc_callback', 'post', 'normal', 'default', array());     }     add_action('load-post.php', 'abc_load_post', 10, 2);     add_action('load-post-new.php', 'abc_load_post', 10, 2);      The `abc_load_post` function gets called fine but nothing actually appears on the product editing page (i.e. `/wp-admin/post.php`) Can someone explain what I'm doing wrong?


What plugins to use for a travel site?

I am developing travel website where users can search and book their travel deal. It goes like this:   1. Providers are creating their travel deals (same as some blogger create blog in WordPress);   2. Users book wanted travel deals;   3. Providers, who have their account where they can see if users book their deal, are notified by the email and sms about just booked (sold) deal. Site is going to be developed using WordPress. Is there any plugin or module that I can use to accomplish this, or at least something similar to reconfigure and not to take this process from scratch?


plugin-list-category-post custom fields

I'm using list category posts and would like to display several custom fields, but not all together. I have used a template to display the list in a table, and have custom fields for country, county and town that I would like to display in individual cells. These are the only custom fields I will be using, so I can hard code the names in the template is necessary. Thanks.


I am using 'featured image' fields in my post and the images are sized and compressed already but whenever I upload an image that has some text, I keep noticing the image reduced in quality (specifically, the text in the image). Is wordpress compressing my images? if so, how to prevent it?


Modify Admin Bar Link

Starting on `line 474` of `/wp-includes/admin-bar.php` there is a function that is declared as the following: `function wp_admin_bar_new_content_menu( $wp_admin_bar )` What it does it generates the `\+ New` menu item along with any custom post types that a user has `edit_posts` capability for. The actual top-menu item, `\+ New` defaults to `posts` since it is the first called in the array (I believe that's how it works). I'd like to actually change that first `\+ New` link to something else. In our setup, we need to give users `edit_posts` capability to manage Advanced Custom Fields Options pages, but are not giving them access to posts themselves (which we just had to hide from the menu system). A bit funky, but it's more of a usability concern for us. Aside from all the jumble I said above, can you modify an existing menu link based on the ID of the item itself (which is `new-content` in this case) or would I need to destroy and rebuild the menu itself? I'm just looking to change that `href` attribute to `#`. Thanks!


Using www and without www url both for same site

Site URL is `lgagro.com.sg`; currently, if browsed without `www.`, it redirects to `www.lgagor.com.sg`. I want to access it with and without `www` i.e. when I browse it by `http://lgagro.com.sg` it should work and if I open it using `www.lgagro.com.sg` it should also work without re-writing the URL. I have `.htaccess` file in root folder which is as such:               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]      The site URL is set to `http://www.lgagro.com.sg`, I also tried with `http://lgagro.com.sg` I have another site `http://shashwatinternational.com/` which works in desired way. I don't have any other setting in shashwat. None of the site are multisite. Any suggestion will be helpful.


Add a custom field to post

I want add a column to my table wp_posts with name "address". So EVERY post have address like field. But i don't know how i can manage the save from Add Post(admin)... I have looked into hooks, but i found only: **manage_posts_columns** that is for manage the colomuns on list posts, and **edit_form_after_editor** where i can show a input field into add page(but what name i need for save it into db ?) Anyone can help me to know how i can show a new field into add post(maybe i can with edit_form_after_editor) and then manage the save to database(how i can take the value from my custom input field ?) Thanks You.


Removing the main link to Jetpack from the menu

I need to remove the link to the Jetpack settings, but not the links to Omnisearch and Site Stats from the admin menu for everyone not having an administrator role: ![enter image description here](http://i.stack.imgur.com/5mMAM.png) For this, I came up with this code:               function remove_posts_menu() {         if (!current_user_can('administrator')) {             remove_submenu_page('admin.php?page=jetpack', 'admin.php?page=jetpack');         }     }     add_action('admin_init', 'remove_posts_menu');      (Reference for the `remove_submenu_page()` function) However, this doesn't work. I did check that the function is called and so by adding `remove_submenu_page('tools.php', 'tools.php');` - when this is added to the function, just after the removal of the Jetpack settings link, the Tools link is removed, but the Broken Link Checker link (of a plugin I installed) is still visible. What's the correct way to remove the Jetpack link?


Empty Date Returned on my function

I am using this function to display the date and title of my latest posts on my dashboard. However for some of the posts the date is not being displayed at all - I have a feeling this might be the posts which I subsequently hit the "update" button but i am not sure.. any ideas why this happens?               function wps_recent_posts_dw() {     ?>
          <?php               global $post;               $args = array( 'numberposts' => 10, 'post_type' => 'any' );               $myposts = get_posts( $args );                     foreach( $myposts as $post ) :  setup_postdata($post); ?>
 (<? the_date('j M, Y @ G:i'); ?>) <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
               <?php endforeach; ?>
     <?php     }          function add_wps_recent_posts_dw() {            wp_add_dashboard_widget( 'wps_recent_posts_dw', __( 'Recent Posts' ), 'wps_recent_posts_dw' );     }     add_action('wp_dashboard_setup', 'add_wps_recent_posts_dw' );


Why can I not view image attachment pages?

I have a problem with images. I can see my uploaded images, as previously, through the media library. I can access each image by clicking on "edit". But if I then click on "View Attachment Page", I am taken to the "404! We couldn't find the page!" message. This applies to all images in the library. At the same, images in some posts (but not all) are behaving differently from before. It used to be possible for readers to click them and see them full size, whereas now that click simply relads the posts in question. I have experimented with deactivating plugins, but have not found a solution for this. Does anyone know what might cause this, and what might have triggered it?


Which plugin will let me decide what users have access to on their side bar in wp-admin?

I want to customize the editor role so that they only have access to 'pages, posts, comments, profiles'.


Display WordPress Parent Categories Only?

I have the following code on a custom wordpress page:                   <?php          $cat_array = array();         $args=array(           'post_type' => 'post',           'post_status' => 'publish',           'posts_per_page' => 10,           'caller_get_posts'=> 1           );         $my_query = null;         $my_query = new WP_Query($args);         if( $my_query->have_posts() ) {           while ($my_query->have_posts()) : $my_query->the_post();             $cat_args=array('orderby' => 'none');             $cats = wp_get_post_terms( $post->ID , 'category', $cat_args);             foreach($cats as $cat) {               $cat_array[$cat->term_id] = $cat->term_id;             }           endwhile;         }         if ($cat_array) {           foreach($cat_array as $cat) {             $category = get_term_by('ID',$cat, 'category');             echo 'name ) . '" ' . '>' . $category->name.''.'
';           }         }         wp_reset_query();     ?>      It lists the categories in order of most recently updated category first. How do I adjust the code to get parent categories only? # Example: Basically, I would just like to display the top level category. For example: Category - Subcategory - Sub Subcategory - Sub Sub Subcategory Just Category.


wp_title() handling of author page

Why doesn't wp_title() display the author's name on an author archive as it does for a category or date archive? How can I hack this functionality? header.php calls:               <title><?php wp_title ( '|', true,'right' ); ?></title>      Here is my author.php:               <?php get_header(); ?>     <?php            $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));         get_userdata(intval($author));         function validate_gravatar($email) {         // Craft a potential url and test its headers         $hash = md5($email);         $uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';         $headers = @get_headers($uri);         if (!preg_match("|200|", $headers[0])) {             $has_valid_avatar = FALSE;         } else {             $has_valid_avatar = TRUE;         }         return $has_valid_avatar;     }     $user_email = $curauth->user_email;     $has_avatar = validate_gravatar($user_email);     ?>
About <?php echo $curauth->display_name; ?>

<?php if($has_avatar) {echo get_avatar($curauth->ID, 70);} ?>
       <?php if ($curauth->user_description) : ?>
<?php echo $curauth->user_description; ?>
        <?php endif;         if ($curauth->user_url) : ?>
<a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?>
        <?php endif; ?>        <?php if (!$curauth->user_description && !$curauth->user_url) : ?>
A riddle wrapped in a mystery inside an enigma...
        <?php endif; ?>

Contact

       <?php echo do_shortcode( '[contact-form 1 "Contact Author"]' ); ?>

       <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>       <?php _e('Author Archive'); ?>       <a href="javascript: void(0);" id="mode"<?php if ($_COOKIE['mode'] == 'grid') echo ' class="flip"'; ?>>

          <?php get_template_part('loop'); ?>     <?php get_template_part('pagination'); ?>     <?php get_footer(); ?>


Commenting system for WordPress

Hi I am thinking of changing from the default WordPress commenting system to Disqus or LiveFyre. What are the biggest advantages of such a change, and maybe possible pitfalls I should look out for. Thanks.


Add a specific category at a specific place to the menu that uses wp_list_pages

I have a main menu where I display pages. All the pages have associated sub- pages, however in the menu some of them are displayed by themselves without sub-pages and some are displayed with a submenu as a list of all sub-pages. The pages in the menu are sorted according to the menu order specified for them. (Please see my code below). Now, I would like to add some categories at a specific place in the menu and not sure how to better do it. Is it possible to do it using wp_list_pages? What I like about my code is that whenever a subpage is added for a parent page that programmed to display all subpages, the newly added subpage will automatically appear in the site's menu. As opposite to using Appearance->Menu functionality where a user will need to add a newly created subpage to the menu before it will appear on the site. I might be easily over complicating it(!) and the only way to do it is via Appearance->Menu functionality. I would really appreciate any help and tips! Here is the code that I use to display pages, some with all the sub-pages and some only at the top level.               //main nav: use wp_list_pages to display cirtain parent pages without any and with all child pages (a tree with parent)     $parents = array(5,7,17,61,19,25);     $children = array();     foreach($parents as $parent) {       $child_pages = get_pages( "child_of=$parent" );       if($child_pages){         foreach($child_pages as $child_page){           $children[] = $child_page->ID;         }       }     }     //add all the pages that need to be included without children     $parents = array_merge( (array)$parents, (array)array(31,23) );     //merge $parents and $children     $menu_pages = array_merge( (array)$parents, (array)$children );     $menu_pages_str = implode(",", $menu_pages);      ?>           <ul class="menu wrap">       <?php wp_list_pages( "sort_column=menu_order&title_li=&include=$menu_pages_str" ); ?>     </ul>


How to tell if all posts are only in one category?

I have a `category.php` page which redirects users to a certain template page if the article in the output is in a category. However, I am seeing that if I have say 10 articles,and only one is in the special category, then it redirects. Is there a way to modify my code to only say "if all of the posts are only in this special category then show the template"?               else if (in_category('ontario-ohs-reform-alerts')) {    include(TEMPLATEPATH . '/ontario-ohs-reform-alerts.php'); }


Metabox nonce PHP notice

I've been getting a notice when I try to add a new post in two different taxonomies, in one i use a custom meta box and in the other not, however the notice appears for both when trying to add a new item, i see this: Notice: Undefined index: product_noncename in /Applications/MAMP/htdocs/site/wordpress/wp-content/themes/theme/functions.php on line 259 hidden just a little below the top black strip in WP Admin **Line 259 is:**               if ( !wp_verify_nonce( $_POST['product_noncename'], plugin_basename(__FILE__) )) {      **which is part of this:**               // Save the Metabox Data     function wpt_save_product_meta($post_id, $post) {         // verify this came from the our screen and with proper authorization,         // because save_post can be triggered at other times         if ( !wp_verify_nonce( $_POST['product_noncename'], plugin_basename(__FILE__) )) {         return $post->ID;         }         // Is the user allowed to edit the post or page?         if ( !current_user_can( 'edit_post', $post->ID ))             return $post->ID;         // OK, we're authenticated: we need to find and save the data         // We'll put it into an array to make it easier to loop though.         $product_meta['_location'] = $_POST['_location'];         $product_meta['_asiaLoc'] = $_POST['_asiaLoc'];         $product_meta['_europeLoc'] = $_POST['_europeLoc'];         $product_meta['_isbn'] = $_POST['_isbn'];         $product_meta['_orderform'] = $_POST['_orderform'];          // Add values of $events_meta as custom fields         foreach ($product_meta as $key => $value) { // Cycle through the $events_meta array!             if( $post->post_type == 'revision' ) return; // Don't store custom data twice             $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)             if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value                 update_post_meta($post->ID, $key, $value);             } else { // If the custom field doesn't have a value                 add_post_meta($post->ID, $key, $value);             }             if(!$value) delete_post_meta($post->ID, $key); // Delete if blank         }     }     add_action('save_post', 'wpt_save_product_meta', 1, 2); // save the custom fields


How to Make a Custom Grid View

I'd like to make a grid view that can be used to list items with a thumbnail, a primary description heading, a subheading, and possibly pricing details. This will not necessarily be for eCommerce as initially there will be no shopping cart. Similar to a post, clicking on the item should take you to a full "post" for that item with more information. For an idea what I'm thinking, take a look here: http://www.powerzoneequipment.com/inventory_search.asp?category=engines So here's my questions:   1) Does something like this already exist?   2) What are the requirements to build something like this? Should it be a plugin combined with a custom theme that supports this? Or could this be done with a custom theme and a custom post type? I realize that what I'm asking might be functionality more typically found in something like Drupal. However, I'm curious how difficult it would be to get this type of display in Wordpress.


Using Jquery submit with ajax request

When the user clicks the 'submit' button on my form, I would like 'this will be echoed back' to be displayed within an alert. The only JS console error I get: `Failed to load resource http://nikkomsgchannel/e?0017005e002b00560036004400190026002d0025002c005300…240020003700620024005b004a005500790053002c0045002b003600300026002f005d004c` The only code I've changed is the Jquery, before this I was using a hyperlink & `click`event in Jquery, which was working. My code: PHP file               function add_my_css_and_my_js_files(){         wp_enqueue_script( "ajax-test", plugin_dir_url( __FILE__ ) . '/ajax-test.js', array( 'jquery' ) );         wp_localize_script( 'ajax-test', 'the_ajax_script', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );       }     add_action('wp_enqueue_scripts', "add_my_css_and_my_js_files");           function text_ajax_process_request() {                 if ( isset( $_POST["post_var"] ) ) {             $response = $_POST["post_var"];             echo $response;             die();         }     }     add_action('wp_ajax_test_response', 'text_ajax_process_request');          function include_jQuery() {         if (!is_admin()) {             wp_enqueue_script('jquery');         }     }     add_action('init', 'include_jQuery');          add_action( 'init', 'register_shortcodes' );     function register_shortcodes() {         add_shortcode( 'displaycalcs', 'mp_calcs_display' );     }         function mp_calcs_display() {                      $output = <<<HTML                 <form action="" method="post" name="formsubmit" id="formsubmit"   >         Number of welds: <input type="number" name="numberofwelds" id="numberofwelds"  >      Number of construction welds: <input type="number" name="numberofconwelds" id="numberofconwelds"  >        Total one: <input type="text" name="totalone" id="totalone" disabled>

        Total two: <input type="text" name="totaltwo" id="totaltwo" disabled>

        Total three: <input type="text" name="totalthree" id="totalthree" disabled>

        <input type="submit"  value="Calculate" id="submit" name="submit" >

     </form>       HTML;     return $output;     }       **ajax-test.js**               jQuery(document).ready( function($) {         $("#submit").submit( function() {             var data = {                 action: 'test_response',                                  post_var: 'this will be echoed back'             };                     $.post(the_ajax_script.ajaxurl, data, function(response) {                 alert(response);             });             return false;         });     });


gravity forms user registration hide form after completed

I use gravity forms and addon "user registration" and i want to hide the registration form after the user is login. I guess i must use conditionnals for this job but know how to proceed exactly. Thank you R


get_permalink is getting old rewrite rule

I had some rewrite rules in my functions.php file. I decided that I didn't need them, and removed all rewrite rules and then flushed them. However for some reason when I use get_permalink() the url is wrong. It's still getting the old rule. I already cleared the cache and also tried accessing from a incognito window. The .haccess file in the root has the same basic WP rewrite.               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Any ideas why I am still getting the old url? I also went to each post and saved it again, hoping that would reset the url back. UPDATE: I checked the database and under the options table I have an option called rewrite_rules, which has the old rules there. I removed them, but they are added back again after I go to permalinks->save. Update 2: I also tried clearing all transients. Did not help. I also tried completely removing the functions.php from the server and then uploading it again. Just to make sure it was loading a fresh file.


Theme layout for home page

I'd like to create a theme with this layout http://i49.tinypic.com/2z6w7z5.jpg for the homepage. At the moment I am working off an already existing html website I am a confused about what the white and green/blue part of the layout should be named, i.e. what file name it should have. Thus far I have the bottom footer and the light blue background set up, but am at a lost for what the body file should be (to get it centred with the white background). Thank you in advance for any help.


Is it possible to remove WYSIWYG for a certain Custom Post Type?

I dont want to use the WYSIWYG at the top of my Custom Post Type. I want to use a custom field textarea that i can place at bottom of my list of custom fields instead. Is this possible?


How to show subcategories using loop?

i am using `wp_list_categories('child_of=54&title_li=')` method to display all the subcategories, but it is showing only one, how can i use it with loop to show all the subcategories properly.


Stop wordpress from adding html tags but not remove my own tags?

I've been trying to make wordpress stop adding html tags to my content but leave my own html tags alone? Tried `remove_filter( 'the_content', 'wpautop' );` and installed PS Disable Auto Formatting but the problem is that it removes my own html tags aswell? I've tried to get_the_content() and the_content() but the same problem occurs there... The way I wan't this to work is to let me add html tags and leave these alone, not removing them. Like this:
Some text here

some more text  fat


Shortcodes Not Working on Custom Theme

I am editing my mate's site which is a custom theme that his agency must have created: http://www.meddingshughes.com/ I'm using real3d flipbook to (try) display some important portfolio content. This plugin uses shortcode and for some reason, when I insert this into the page, it doesn't work when I update the portfolio page. Have attempting disabling plugins etc but TNA... Any ideas how a relatively minor-skilled tech can sort this? Thanks!


WP_Query using meta_query with relation OR and orderby meta_value doesn't work

I've been bashing against a bug for a few hours now, and can't seem to find my error. Could there be a bug with the relation type 'OR' in WordPress?               $evenements = new WP_Query(array(         'post_type'     => 'evenements',         'orderby'       => 'meta_value',         'meta_key'      => 'startDate',         'order'         => 'ASC',         'meta_query'    => array(             'relation'  => 'OR',             array(                 'key'       => 'startDate',                 'value'     => date('Ymd'),                 'compare'   => '>=',             ),             array(                 'key'       => 'endDate',                 'value'     => date('Ymd'),                 'compare'   => '>=',             ),         ),     ));      What is weird is that if I put relation to 'AND', it works as intended. If both statements are true, the post will show up. If I put relation to 'OR', all posts will show up, and for some reason even the order will not work properly. Even changing 'order' from 'ASC' to 'DESC' won't change the order the results come in. To understand the query, here's the detail of what exactly I'm trying to do: I want to show events that are in progress or in the future. The two metas are the date at which the event starts (startDate) and the date when the event ends (endDate). So if the start date is higher or equal (to get if an event is happenning today) to today or the end date is higher or equal to today, show the post. The second part (with the end date) is made so an event in progress will be shown, and I cant remove the first part (with the start date) because if the event only lasts a day, the client will only enter the startDate meta. I discarded the bug coming from plugins since I disabled all plugins and the bug was still there. Here is what I get if `echo $evenements->request`.               SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts     INNER JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id     INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id)     INNER JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id)     JOIN wp_icl_translations t       ON wp_posts.ID = t.element_id AND t.element_type = 'post_evenements'     JOIN wp_icl_languages l ON t.language_code=l.code AND l.active=1     WHERE 1=1     AND wp_posts.post_type = 'evenements'     AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')     AND (      wp_postmeta.meta_key = 'startDate'      OR ( mt1.meta_key = 'startDate' AND CAST(mt1.meta_value AS CHAR) >= '20140305' )      OR ( mt2.meta_key = 'endDate' AND CAST(mt2.meta_value AS CHAR) >= '20140305' )     )     AND t.language_code='fr'     GROUP BY wp_posts.ID     ORDER BY wp_postmeta.meta_value ASC     LIMIT 0, 10


File and directory permissions

I installed latest WordPress 3.5 in my CentOS server. When I tried accessing `http://example.com/wp-includes/`, I received a listing of the directory: ( **Index of wp-includes** ). I added the following code at the top of `.htaccess` file, and it fixed the issue:               Options -Indexes     IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*      ## My problem When I try accessing PHP files in `wp-includes` and `wp-content` using a web- browser (for example: `http://example.com/wp-includes/class-smtp.php`), it shows a blank screen. I think it should show "Permission denied" or something like this. Am I correct? How can I achieve this? I'm concerned if my website is vulnerable to attacks. I am already aware of the Hardening WordPress article. Here are my directory and file permissions:   * `wp-admin`: 755   * `wp-content`: 755   * `wp-includes`: 755   * Files have permission 644


Alphabetize all but one category

I have my categories set to sort alphabetically:               <?php if (is_category()) {           $posts = query_posts($query_string . '&orderby=title&order=asc');        }      ?>      I want to exclude one category so that it sorts by date. I tried this but it made all the cats come up blank:               <?php if (is_category()) {          $posts = query_posts($query_string . '&orderby=title&order=asc&exclude=15');         }     ?>      Any ideas?


Hierarchical Custom Post Types

I would like to have the following taxonomy structure:               site.com/courses/course-name/pathway/pathway-name      The domain is such that any particular course can be completed by taking a number of different pathways - different module structures. The following URLS would work as such:               site.com/courses      shows a list of courses               site.com/courses/course-name      will follow a template e.g. single-course.php, showing title, content and a list of the pathways associated to this course.               site.com/courses/course-name/pathways/      will follow a template e.g. archive-pathway.php, showing course-name and a list of pathways (not be used so much but will still need to work)               site.com/courses/course-name/pathways/pathway-name      will follow a template, e.g. single-pathway.php, showing the course-name title, the pathway-name title and content for this pathway. The files here may be incorrect whereby I should be using taxonomy-{}.php or otherwise as appropriate, instead of single-{}.php. My question: is it possible to set up the above hierarchy within WordPress? If so, please provide some code to `register_taxonomy` or `register_post_type` as appropriate to help me get started. I cannot find how to do this elsewhere but am pretty sure this is how courses in the TutsPlus network use WordPress.


I need to have two 1-5 star rating fields, only editable by admins. Which plugin should I use?

I need the following: two different 1-5 star rating fields, for one of my custom content types. The ratigs will be stablished by the admin, so I dont need a real voting system. The fields are more like indicators than polls. I tried gd-star ratings but its aimed at community voting and rating systems which is not at all what I want. I know this would be uite easy to code, but if there is a plugin for this I would like to know. Thank you guys!


How can I disable widget from being visible on some pages?

I have two widgets in my sidebar, a jQuery vertical menu and an image handler. I need to disable the jQuery widget on my contact page (or hide it or something like this), so that it wont be shown. How can I do this please?


Is it ok to not a have child theme and just create a theme from scratch?

I would like to know if creating a Wordpress theme from scratch is good? because I know the template tags in wordpress and other tags ... ...but Will I get any future problems in here when it comes to updating to another version? Im curious because I rather create one from scratch rather than creating a child theme because I cant modify the single/index/page.php files to create a modified custom loop.


Conditional Facebook Share and Like links

I am using Simple Facebook Connect, and have enabled "Recommend" and "Send" links. Unfortunately they are appearing in too many places. Can I limit their appearance using `is_category('catttttt')` style conditionals? Happy to switch to a different Facebook Connect plugin in order to gain this finegrained feature.


Multiple loops with / without sticky posts and different post limits

I am having trouble with multiple loops and sticky posts in wordpress. The first loop I just want all the sticky posts.               <?php query_posts(array('post__in'=>get_option('sticky_posts'), 'cat' => '-15,-17, -5, -2')) ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>             <?php $do_not_duplicate = $post->ID; ?>          <a href="<?php the_permalink(); ?>"><?php the_title(); ?>          <?php endwhile; endif; ?>      In the second loop I want to get the all of the posts that are NOT sticky (so the sticky posts don't show). Currently all but the latest sticky post still show in the loop below. Also the posts_per_page is including the posts in the first loop which I do not want. No matter how many sticky posts I add I want the number of posts that are NOT sticky to be consistent.               <?php query_posts($query_string . '&cat=-15,-17, -5, -2&post_type=post&posts_per_page=9'); ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>          <?php if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>     <?php the_first_category(); ?>     <a" href="<?php the_permalink(); ?>"><?php the_title(); ?>     <?php the_excerpt(); ?>          <?php endwhile; ?>          <?php next_posts_link('Older →') ?>          <?php endif; ?>      Can anyone help or point me in the right direction?


Post custom permalink results in 404 for archive page

I have set the following custom permalink structure (for my blog):               /news/%postname%      When I browse to `/news` I was expecting for the `archive.php` template to be served up, unfortunately, I'm presented with a 404. My rewrite is working properly since I can view all posts such as `/news/my- post-title`. How can I make it so that my "archive.php" is served up when browsing to `/news`, currently I have to create a dummy News page which is of course what I don't want. Any help would be much appreciated. **UPDATE:** I have set my Category Base and Tag Base permalinks as follows:               news/categorized     news/tagged      Browsing to `/news/categorized/test` triggers the `category.php` template and browsing to `/news/tagged/test` brings me to the `tag.php` template. I still have no luck in triggering the `archive.php`.


How to Build a Movie Library in WordPress 3.x

To help me learn WordPress development, I'd like to go "beyond the blog" and build a personal movie library -- similar to IMDb but on a much smaller scale. I need help understanding how to approach the project in WordPress and what I need to learn. Here are the types of things I'd like to do on the site:   * When you visit an actor's page, the actor's films are retrieved from the database and displayed. You can sort the movies by year, title, rating, etc. You can also click on the movie title to go to that movie's page.   * When you visit a movie's page, the actors in the movie are retrieved from the database and displayed along with information like a movie summary, my rating, and whether I own the DVD.   * On the homepage, you can perform a search for movies. For instance, if I'm in the mood for an '80s comedy, I can search for movies in the Comedy genre released between 1980-1989 and that I own on DVD. I can already write all of the PHP and MySQL that's needed, but I don't understand where the code actually goes in WordPress. For example...   * Would this application require building a plug-in, or just adding code to my theme?   * Would each actor's page be treated as a "page" or would it be treated as a post?   * For the actor pages, where would the query go that retrieves the list of movies?   * When the search form is submitted, where is the script located that would process the search request? -- I'm just looking for a push in the right direction regarding how WordPress would handle an application like this. Thanks in advance!


Multiple relationship for multiple tax_query in WP_Query

I want to use the WP_Query class to filter some of my posts. The problem I facing now is handling the taxonomy query. Normally, the wp_query only handle one relationship for tax_query (either AND or OR), but what I need is mixed use of theses relationship on the tax_query, how can achieve it?   eg               'tax_query' => array(             'relation' => 'AND',             array(                 'taxonomy' => 'taxonomy1',                 'field' => 'slug',                 'terms' => array( $term)             ),             array(                 'taxonomy' => 'taxonomy3',                 'field' => 'slug',                 'terms' => 'terms' => array( $term3),                 'operator' => 'IN',             )            // below i want to use OR relationship            'relation' => 'OR',           array(                 'taxonomy' => 'taxonomy4',                 'field' => 'slug',                 'terms' => array( $term4)             ),             array(                 'taxonomy' => 'taxonomy2',                 'field' => 'slug',                 'terms' => 'terms' => array( $term2),                 'operator' => 'IN',             )         )        I know the code above is not working, do I need to use wp_query filter to do it? Any idea?


how to add # before tags?

Like Lifehacker and several other sites, would like to know how to add # before tags displayed on the site. for e.g. instead of a tag like "abc", how about "#abc". - is there a way to automatically add # across all the tags present in the system?


Hide certain widgets from specific user roles in admin

I'm looking for a way to hide certain widgets from specific user types in the admin, `Appearance > Widgets` page? For instance, admins can see all widgets, but authors can only see a select few? I noticed there was a Code Canyon plugin, but it requires a framework with it also which I am not using.


How to Show Category List With Corresponding Links?

i want to do a research in Category List Area. I'll Explain Here... Now I have 4 Categories Like 1,2,3,4. First of all it needs to show in the category pages Horizontally.Next is, While Clicking on Any Category it will show the articles from only that category in this thumbnail format, this also should be in a format that allows for 40 or 50 potential articles to be shown this way.


Does WordPress Allow Blank/Empty Comment Submissions In WordPress?

I've got a great Comment Form and Threaded Comments setup by using the native WordPress functions: `comment_form` and `wp_list_comments`. However, I'm trying to also create a custom Contest Comment template for certain posts. I call `comments_template('/contest-comments.php', true);` conditionally based on whether a certain custom field exists or not. It works great. I'm trying to make it look along the lines of http://2010.sf.wordcamp.org/attendees/ I only want to show the person's name wrapped in a link and their avatar. Therefore, I want my comment form to only show the Name, Email, and URL fields. The text area should be hidden. For the Comment Form, I am passing an empty value for the `comment_field` key in the `$args` array I'm passing into `comment_form`. This makes the comment form look okay, but when someone submits a comment, they get a warning from WordPress saying that their message was blank. Any solutions on how to solve this? Thanks!


Getting a stack trace when an error occurs?

I was told to "get a stack trace" when an error occurs in my WordPress installation. How do I do this? _This is meant to be an easy place to refer others to. Please list plugins, configuration settings, PHP modules... that can do this. Consider that the user might be on a shared host, might want to log to a file instead of the browser, ..._


Transient RSS feeds in wp_options not removed automatically?

I just noticed 55.000 entries(!) in my wp_options table. I had not been there for a while. So I ran:               delete from `wp_options` where `option_name` like '_transient_timeout_rss%'     delete from `wp_options` where `option_name` like '_transient_rss_%'      And... it is now back to 645 entries... How can I have these older RSS entries removed automatically since transient seems to be eternal. Could It be that on my webhost cron is not working?


How to get a post content from another wordpress blog/site?

I have a situation where i need to display posts from a specific category from another wordpress site into my wordpress site. Both are my sites and i thought of creating a page specially for this in site A and calling them through iframe in site B. I thought another way of fetching them feed.. But i dont know how to fetch feed contents from other wordpress and how to create a feed for a specific category.


Editing theme files and access to the Code pages only to super-admin?

When I deal with Multisite installation.Some themes like mystique and aparatus provide the widget areas with in the theme-settings page to enter Advertising codes in the form of HTML or java script .But I want the 'Ad code Boxes' to access only by super admin(Me on my Multisite) and not by Normal admins .Can I make that boxes available only to me?


Check in function on custom page

I have a website about places and attractions in my country. Each place/attraction is a different custom post. On this page, i would like to add a button with the value "Check In" and if clicked by a registered user i would like to save a value in db with the: user id, post id and 1 if the button was pressed. On the user page, i would like to show where he check in and how many times. I have allready the user page, the places pages, etc. I only need to add this feature. It's doable? If yes, can someone help me? LE: I don't expect that someone will just give me the code. Just point me in right direction - how to add for a custom post a custom entry in the db.


Is there an easy way to make a meta box have the tabs like the Categories meta box has?

My question is pretty much summed up in the title. I'm dropping a meta box in the New Post / Edit Post admin page, and I want to be able to set it up with tabs like the Categories meta box has. I assume there's an easy way to hook into this, but I can't remember how. Does anybody know?


How to make a relationship between books and authors?

I have a book category, but now I would like each book could be concatenated with the author profile page. And the tab for the author to show, in addition to text, the list of books he has written.   How can I do it?


meta_query fails to compare on values containing apostrophes

I have WP Query and I am simply comparing by the meta value by = My value contains town names, and seems to work great for the majority of names. However some names contain apostrophes... **Madonna dell'olmo** And the meta values with apostrophes fail to work.    This is my query...               $dealerResults = new WP_Query(array(         'posts_per_page' => -1,         'post_type'     => 'dealer',         'meta_query'    => array(             array(                    'key' => 'dealer_country',                    'value' => $ajaxCounty,                    'compare' => '='             ),             array(                    'key' => 'dealer_location',                    'value' => $ajaxTown,                    'compare' => '='             )         )           ));         I am passing the from a option value through some jquery function and ajax.               foreach($value as $town){         echo "<option class=\"$county_class\" value=\"$town\">$town</option>";     }      -               dealerResults = function () {         var county = $('#dealer-county').val(),             town = $('#dealer-town').val(),             wp_nonce = '<?php echo wp_create_nonce("dealer_search");?>';         if(county != 0 && town != 0){             $.ajax({                 type: 'POST',                 url: '<?php echo admin_url('admin-ajax.php'); ?>?r='+Math.random(),                 data: { varCounty : county, varTown : town, action: 'dealer_search', nonce: wp_nonce },                 success: function(data){                     $(".dealer-wrapper").remove();                     $("#dealer-results").append(data);                       }             });         }     }      -               $ajaxCounty = $_POST['varCounty'];     $ajaxTown = $_POST['varTown'];            My question is how can I get the query to work for my meta values which contain apostrophes?    Thanks in advance


Restrict individual category combinations

While assigning multiple categories to a post, I need to restrict the category choices on a post depending on what other categories have already been assigned to the particular post. For example, lets say we have categories A, B and C.   For any post, we want to restrict having both categories B and C. So posts may have the following assignments:   * A, B, C   * A, B   * A, C  **No post** should have B **and** C. How can I achieve this?


How to update all post at once?

Is there a way to update all post at once? The issue is, when i migrated content from another CMS, some of the permalinks are working fine and some of them are not, when i updated the posts all links are working fine. I have tried some methods to perform this requirement, but it doesn't helped.