What's causing this error? "Warning: Invalid argument"

I noticed today that my error logs are littered with this information. I'm not quite sure what's causing it. Has anyone seen this before? `[Mon Mar 25 17:24:23 2013] [error] [client] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/mysite/wp-admin/includes/plugin.php on line 1290, referer: http://mysite/contact/` Line `1290` is the `foreach` in the following code. I am not sure what's referencing this or where to begin looking.               /**      * Remove a top level admin menu      *      * @since 3.1.0      *      * @param string $menu_slug The slug of the menu      * @return array|bool The removed menu on success, False if not found      */          function remove_menu_page( $menu_slug ) {     global $menu;          foreach ( $menu as $i => $item ) {         if ( $menu_slug == $item[2] ) {             unset( $menu[$i] );             return $item;         }     }          return false;     }      I'm not hooking into `admin_menu` as far as I can tell. Any ideas?


Trying to check and see if a post has a featured image outside of the main loop

I've got a situation where I need to find out if the currently loaded post has a featured image, if it does, I want it to display a different logo than if it doesn't have a featured image associated with the post. This works right now, but doesn't have the check feature I'm looking for:               <?php echo is_front_page() ? '
' : ''; ?>         <a href="<?php echo home_url(); ?>" rel="nofollow"><img src="<?php header_image() ?>" alt="<?php bloginfo('name'); ?> logo" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" />     <?php echo is_front_page() ? '
' : ''; ?>      My issue is that I've looked at the WP documentation for get_posts or starting a new WP_query, but haven't had any luck understanding how I can:   * run a new loop that gets the page ID and sees if it has a featured image   * do a standard if/else statement afterwards My thinking with the if/else would be like this:               <?php echo is_front_page() ? '
' : ''; ?>         <a href="<?php echo home_url(); ?>" rel="nofollow">              <? // IF/ELSE CODE TO EXECUTE IF post_has_thumbnail ?>         <?php if ( has_post_thumbnail() ) : ?>               <img src="<?php header_image() ?>" alt="<?php bloginfo('name'); ?> logo" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" />         <?php else : ?>         <img src="/i/logo-no-feat-img.png" alt="<?php bloginfo('name'); ?> logo" height="120" width="222" />         <?php endif; ?>         <? // end ATTEMPTED IF/ELSE CODE ?>                   <?php echo is_front_page() ? '
' : ''; ?>      **WORKING CODE**                   <?php echo is_front_page() ? '
' : ''; ?>         <a href="<?php echo home_url(); ?>" rel="nofollow">         <? // IF/ELSE CODE TO EXECUTE IF post_has_thumbnail ?>         <?php if (is_home() || has_post_thumbnail(get_the_ID()) ) : ?>               <img src="<?php header_image() ?>" alt="<?php bloginfo('name'); ?> logo" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" />         <?php else : ?>         <img src="<?php echo get_template_directory_uri(); ?>/library/images/logo-without-feat_img.png" alt="<?php bloginfo('name'); ?> logo" height="302" width="203" />         <?php endif; ?>         <? // end IF/ELSE CODE ?>                  <?php echo is_front_page() ? '
' : ''; ?>


insert a warning message into post-new.php

wondered if anyone knew the most elegant way to insert some sort of warning message each time someone tries to create a new post, i.e. 'please remember what you publish is your own responsibility', that sort of thing. I'm thinking I'd like to use the error or warning css wordpress uses if it can't find something or there's an error some place. I'd have thought calling it from the functions file would be best so it doesn't get overwritten each time I update but not really sure what to search to find the reference for it, any ideas?


When to use add_action('init') vs add_action('wp_enqueue_scripts')

In my theme's functions.php, I'm calling an add_action in order to gain a measure of control on where jquery is loaded (in the footer along with my theme's other scripts). The problem I'm having is that when I use add_action('wp_enqueue_scripts'), it only appears to fire if no plugins are loaded. However, the add_action('init') method works in all cases. I can't recall why, but I believe that add_action('wp_enqueue_scripts') is preferred in this case. If that's true, how can I get it to work in all cases? > In functions.php               //if(!is_admin()){add_action('init', 'my_theme_init');} //THIS WORKS ALL THE TIME     //add_action('wp_enqueue_scripts', 'my_theme_init'); //THIS ONLY WORKS WHEN NO PLUGINS PRESENT          if(!is_admin())     {         require_once(TEMPLATEPATH . '/functions_public.php');        }      > In functions_public.php               function my_theme_init()     {          /* PREVENT DUPLICATE COPIES OF JQUERY FROM PLUGINS     **************************************************/     wp_deregister_script('jquery');          /* LOAD THE LOCAL WORDPRESS COPY OF JQUERY AND THEME CUSTOM SCRIPTS IN THE FOOTER     ***********************************************/     wp_register_script('jquery', get_bloginfo('template_directory').'/scripts.mythemescripts.js',false,false,true);          wp_enqueue_script('jquery');          }      The 2nd method, using add_action('wp_enqueue_scripts') apparently does not get executed in conditions where a plugin is present that writes out script dependencies to the theme.


How to completely export and import WordPress?

I exported all posts of a WordPress blog. Then I imported the xml file to another WordPress blog. When I tried to search few posts in the new blog, which are in the old blog, I did not find anything. When I opened the xml file, I found that it's incomplete. The file contains `14,226` lines of code. The size of the file is 1.2 MB. I used default tool of WordPress to export and import. How to export complete list of posts and then import the same? I have another lame idea to do this, if I don't get any good solution. I can delete the posts which are exported and then export again. But this is a stupid time taking process.


WordPress widgets manager option for emulating theme layout

My theme has 6 widget containers. I'd like to be able to offer users a screen, similar to the existing widget manager, that presents these sidebars in a layout that mimics my theme's default layout. For example, I have the following widget containers:   1. Above Header = a widget container that is displayed above the header area   2. Below Header = a widget container that is displayed below the header area   3. Above Content = a widget container that is displayed above the main content area   4. Below Content = a widget container that is displayed below the main content area   5. Sidebar = a widget container that is displayed to the right of the main content area   6. Footer Area = a widget container that is displayed below the main content area and above the footer area So, what I'd like to do is reformat the sidebar manager (or create a custom version of it that can be accessed with a custom admin toolbar link), so that instead of just displaying my widget containers one on top of another in the right sidebar, it actually lays them out according to where they appear in my theme's actual layout. So, the "Above Header" widget container would appear at the top and span the entire width of the screen. I would then have a read-only div that represents my theme's header area below that. Then, below the header area, would be my "Below Header" sidebar container, etc... I would then repurpose the "Available Widget" palette and covert the widgets there to icons. This would allow them to be more easily converted to an "objects" pallete that could be anchored to the screen with expand/collapse toggle via jQuery so that items could be drag/dropped into my container widgets. I'm not looking to reinvent the wheel, so my question is: 1) Does something like this already exist? 1b) Is something similar to this on the drawing board for a future version of WP? Note: since I'm registering my widgets with custom classnames, I already have access to each of them via CSS dom selectors. This gets me part of the way to the proposed layout I'm considering. I could then do the rest of the layout via Custom CSS and jQuery. Just looking to see if the work on this has already been attempted or is on the drawing board for core enhancements.


set_post_thumbnail when user is not logged in

I'm currently using the `set_post_thumbnail()` function to insert a programmatically uploaded image to a post. The problem is that the function works perfectly when the user is logged in only. If the user is not logged in, in the back-end, wordpress says that the file is attached to the post but does not display it as a featured image. I don't have any conditional statement in that function. Does anybody have had the same issue? Is that a normal behavior? Edit: Noticed that the issue showed up since I've upgraded Wordpress from 3.5.1 to 3.5.2 but I really don't know if it's related Edit: Here is a sample of my code               // This part is for testing purpose, the file is well placed with the right permission     $dir = '/home/web/tmpdir';     $data = $_POST['imageCanvas'];     $preview = base64_decode( str_replace( 'data:image/png;base64,', '', $data ) );     $file = '000011.png';      $filename = $dir . '/' . $file;     file_put_contents( $filename, $preview );          // Here I copy the test file directly into the wordpress uploads dir     // After this line I find the file in the uploads dir, so, let's say that for now it works as intended     $wp_filetype = wp_check_filetype( basename( $file ), null );     copy( $filename, '/home/web/wordpress/wp-content/uploads/' . basename( $file ) );     $attachment = array(         "post_mime_type" => $wp_filetype['type'],         "post_title" => preg_replace( '/\.[^.]+$/', '', basename( $file ) ),         "post_content" => '',         "post_status" => 'inherit'     );          // This part worked well until I recently upgraded WP to 3.5.2...     $attach_id = wp_insert_attachment( $attachment, $file, $lastpostID );     require_once( ABSPATH . 'wp-admin/includes/image.php' );     $attach_data = wp_generate_attachment_metadata( $attach_id, $file );     wp_update_attachment_metadata( $attach_id, $attach_data );     set_post_thumbnail( $lastpostID, $attach_id );          // This part returns the right ids in Apache logs...     error_log( 'attachid: ' . $attach_id . ' - postid: ' . $lastpostID );      I can find the file attached to his post into the wordpress media library: ![Wordpress media library](http://i.stack.imgur.com/1kRMy.jpg) But if I open the post, I don't see any featured image. ![Post featured image](http://i.stack.imgur.com/xhrzn.jpg)


Need to execute a cron job

I need a cron job to execute the following url > http://www.mywebsite.com/wp- > admin/admin.php?page=myvideoblog/mvb_main.php&action=processfeed&updatefeed=67 The problem is that it requires to be logged in as admin, what are my options? I've tried a few plugins but they use hooks instead of just executing a url and the cron jobs provided by the control panel does not log in to the website.


Display all existing members

How would I (using a loop) pull in all of the existing users? I'm trying to loop through these users and then pull in meta data for each one.


Custom post type URL with post ID that allows archiving and paging

I'm having a difficult time trying to get my custom post types URLs to work correctly. Every solution I find has crippled another part that needs to work. What I am trying to accomplish is `domain.com/post_type/post_id/post_name`. What I have that works for everything except archives is:               register_post_type('post-type',         array(         'rewrite' => array(         'slug' => 'post-type/%post_id%',         'with_front' => false,         'pages' => true,         'ep_mask' => 1          )     ))      Then I have:               add_filter('post_type_link', 'custom_post_type_link', 1, 3);     function custom_post_type_link($post_link, $post = 0, $leavename = false) {              if ($post->post_type == 'post-type')) {             return str_replace('%post_id%', $post->ID, $post_link);         } else {             return $post_link;         }     }      So I'm trying to find a way to get `domain.com/post_type` to work. It currently throws a 404. I know that if I remove the filter and `/%post_id%` from my rewrite that the archive will work. From there I've tried adding a rewrite rule:               add_action( 'init', 'custom_rewrites_init' );     function custom_rewrites_init(){         add_rewrite_rule(             'post-type/([0-9]+)?$',             'index.php?post_type=post-type&p=$matches[1]',             'top' );     }      Doing it this way the URL wont redirect if someone types in `domain.com/post_type/post_id` and `domain.com/post_type/post_id/post_name/2` doesn't work. Anyone know of the best way to do this?


Set admin body to ltr on a rtl installation

I am using a _rtl_ WordPress installation (Hebrew language) and have the following problem: On the admin interface, most of the plugins I install do not have a _rtl_ stylesheet and therefore the plugin interface is displayed in a distorted way. It can be easily fixed using css - just set the `#wpbody` div to _ltr_ like this:               #wpbody {         direction:ltr !important;     }      But I can't find the right place / css file to make it work. I have tried the following - unsuccesfully:               wp-admin-rtl.css     wp-admin.css     dashboard-rtl.css     dashboard.css      Any idea how to make it work?


Wordpress Theme: replace logo image with title site if file doesn´t exist on server

First at all thanks for helping. I´m trying to make a theme that pick an image from a folder based on the domain name, and if the file do not exist, then place the H3 title site. My code is:               <?php $server_name = preg_replace('/([wW]{3,3}\.|)\.(es|com|net)/', '',$_SERVER['HTTP_HOST']); $imagen = bloginfo('stylesheet_directory').'/images/logos/'.$server_name.'.png'; if (file_exists(get_template_directory(). '/images/logos/' .$server_name.'.png')) { ?>        <a href="<?php echo home_url( '/' ); ?>"><img src="<?php echo $imagen ?>" border="0" width="230px" height="60px" alt="<?php bloginfo( 'name' ); ?>"/>       <?php  }else{ ?>
<?php bloginfo( 'name' ); ?>
       <?php } ?>      When I tested it on RESPONSIVE THEME like:                <?php if (file_exists(get_template_directory(). '/core/images/logos/'.$nombre_servidor = preg_replace('/([wW]{3,3}\.|)\.(es|com|net)/', '',$_SERVER['HTTP_HOST']).'.png')){ ?>        <a href="<?php echo home_url( '/' ); ?>"><img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php bloginfo( 'name' ); ?>"/>       <?php  }else{ ?>
<?php bloginfo( 'name' ); ?>
       <?php } ?>      It works like a charm, but I cannot see what I´m doing bad. May anyone give me a hand? Thanks!


Custom Taxonomy Archive not displaying entries

I have CPT 'movie', with the following taxonomies: genre, director, and actor. The code used to register these is this: http://pastebin.com/yJ9XHCDk I have an archive movie page working using the following code in archie- movie.php:               <?php get_header(); ?>

                              <div id="content" class="<?php echo $bw; ?>">                  <?php get_template_part( 'part-genrenav'); ?>
                 <?php global $post; if(is_archive() && have_posts()) :                         if ( is_post_type_archive() ) { ?>
<?php post_type_archive_title(); ?>
                             <?php } ?>                 <?php endif; ?>

                 <?php get_template_part( 'part-pagination'); ?>             <?php while (have_posts()) : the_post(); ?>                              <?php get_template_part( 'part-movie'); ?>                           <?php endwhile; ?>                       <?php get_template_part( 'part-pagination'); ?>

          <?php get_footer(); ?>      **Taxonomy.php** I've created a taxonomy.php (and a taxonomy-genre.php and so on). Taxonomy.php is being called correctly here, but the loop in that template returns nothing. I've been back and forth through dozens of articles, but can't seem to figure it out. Currently, my taxonomy.php file is made up of this, as you can see it isn't much different than they archive-movie.php file above. I just can't figure out why it doesn't work:               <?php get_header(); ?>

Taxonomy Archive

                 <?php get_template_part( 'part-pagination'); ?>             <?php while (have_posts()) : the_post(); ?>                              <?php get_template_part( 'part-movie'); ?>                           <?php endwhile; ?>                       <?php get_template_part( 'part-pagination'); ?>

          <?php get_footer(); ?>


Nginx with Wordpress not showing template 404 for certain file types

I am using Nginx on Ubuntu to host a Wordpress site and everything is working great except certain file types return the Nginx 404 rather than the Wordpress template 404. For example: http://www.sbbic.org/something.zip shows the Nginx 404 page. While http://www.sbbic.org/2014/06/17/free-english-khmer-dictionary-mac-osx- download2 shows the template 404 page. What am I missing in my configuration of Nginx?


Fluid full window width carousel Image Problem in WordPress

Slider link:- http://coolcarousels.frebsite.nl/c/2/ Here is my HTML script for the slider-

                  <img src="<?php echo get_template_directory_uri(); ?>/images/slider1.png" alt="building1" class="slider_img" />                  <img src="<?php echo get_template_directory_uri(); ?>/images/building2.jpg" alt="building2" class="slider_img" />                  <img src="<?php echo get_template_directory_uri(); ?>/images/building3.jpg" alt="building3" class="slider_img" />                  <img src="<?php echo get_template_directory_uri(); ?>/images/building4.jpg" alt="building4" class="slider_img" />                  <img src="<?php echo get_template_directory_uri(); ?>/images/building5.jpg" alt="building5" class="slider_img" />                  <img src="<?php echo get_template_directory_uri(); ?>/images/building6.jpg" alt="building6" class="slider_img" />

  Book

      But I want to call the images dynamically. I am giving the link dynamically from meta box or option panel something like that-

                  <img src="<?php echo get_post_meta( get_the_ID(), 'slider_img1', true ); ?>" alt="building1" class="slider_img" />                  <img src="<?php echo get_post_meta( get_the_ID(), 'slider_img2', true ); ?>" alt="building1" class="slider_img" />                  <img src="<?php echo get_post_meta( get_the_ID(), 'slider_img3', true ); ?>" alt="building1" class="slider_img" />                  <img src="<?php echo get_post_meta( get_the_ID(), 'slider_img4', true ); ?>" alt="building1" class="slider_img" />                  <img src="<?php echo get_post_meta( get_the_ID(), 'slider_img5', true ); ?>" alt="building1" class="slider_img" />

  Book

      Whather I use loop or not, It never shows the images. It only show the alt tag there sliding. I detect with firebug & see the src tag has no value. But when I print code any other place, I see it throw the image link. Any idea what to do with this?


I want to Add My Product Image to Admin Order Email in Woocommerece

I want to Add my product image (product which is ordered) in a thumbnail form to recognize the product easily by admin, in Admin Order Email.


Display A list of Admins

I have a function that allows me to display ALL users on my site, but I was wondering if there was a way to display Admins and Contributors in a separate loop? My current function:               function contributors() {       global $wpdb;            $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name");            foreach($authors as $author) {         echo "
";         echo "ID;         echo "\">";         echo get_avatar($author->ID);         echo "";         echo '
';         echo "ID;         echo "\">";         the_author_meta('display_name', $author->ID);         echo "";         echo "
";         echo "
";       }     }


Cannot get <p> tags working from a WPAlchemy metabox with wp_editor()

I'm using WPAlchemy on a project. For a template, I need to use a custom metabox which is working fine with a tinyMCE editor. Code to insert the meta box on the template (this is a piece of code from https://github.com/helgatheviking/WP-Alchemy-Holy-Grail-Theme/ because I end up trying it after a looooog search, but _macache_ ).

     <?php $mb->the_field('richfield');          $settings = array(     'textarea_rows' => '10',     'media_buttons' => 'false',     'tabindex' =>2     );          $val = html_entity_decode($mb->get_the_value());        $id = $mb->get_the_name();          wp_editor($val, $id , $settings );          ?>

<button type="submit" class="button-primary" name="save"><?php _e('Update');?></button>

      I have added the following in `functions.php`               /*     * Recreate the default filters on the_content     * this will make it much easier to output the meta content with proper/expected       formatting     */     add_filter( 'meta_content', 'wptexturize' );     add_filter( 'meta_content', 'convert_smilies' );     add_filter( 'meta_content', 'convert_chars' );          //use my override wpautop     if(function_exists('override_wpautop')){     add_filter( 'meta_content', 'override_wpautop' );     } else {     add_filter( 'meta_content', 'wpautop' );     }     add_filter( 'meta_content', 'shortcode_unautop' );     add_filter( 'meta_content', 'prepend_attachment' );      and for the output :
         <?php         global $page_type_richtext;         $page_type_richtext->the_meta(); // don't think I need this line         $richtextcontent = $page_type_richtext->the_value( 'richfield' );         echo apply_filters('meta_content', $richtextcontent );         ?>
      But I never manage to have the `<p>` tags working. I don't understand where i'm wrong. I have tried a lot of different ways, using `the_content` filter, or `wpautop`but it's not working at all. The display is perfect in the custom field itself inside the admin page. That's why I'm getting mad. The content is correctly `wpautop()` when in admin, so I guess the content is properly saved in DB. There must be a way to make it work, but I really don't know. I have find a couple of stack exchange questions about that, like this one but I don't understand how to adapt it. Looks like I should use `wpautop` at the saving of the post, but this is handled by WPAlchemy, and `wp_editor()` doesn't need it, in theory as I understood it. Does anyone give me a hind or a lead ?


Faking the "onSave" event

While a specific use-case, I believe this may benefit others. I am using TurboCSV to mass-import a number of posts into WordPress (which it is doing wonderfully so far). Within that import, I am specifying custom fields to be used in conjunction with Advanced Custom Fields to store/output the data. The post_meta table is being created correctly, but the part that is not working as expected is generating ACF's hidden fields (which work with field relationships). When the import is first done, those database tables are not created until you manually go into each post and re-save them. I was wondering if there is a way to "fake" the onSave event for WordPress for a number of posts. ACF also passes along post information (stored on the post edit screen) to this save function - which makes it a bit trickier - but I'd be interested if anyone has any thoughts. Thanks!


Accept or deny cookies - how to?

As far as cookies privacy policy has been change, i need to make a script which allow to accept (or not) cookies by user for this domain (website) only. Is there a way to do this for one website only. Second thing is this popup window should be displayed only if user came from different domain (so each page have to check it - template/header). How can i do this?


Disable comment rss feeds for pages in wordpress

I am currently working on the completion of a custom template and my last hurdle is to be able to remove the comments feed link being added to the head of the page. For example: in firefox when you open any of the pages on my site there is an rss icon, when clicked I am shown 3 options to add to my reader but the last two are related to comments. The culprits are located in the               <link rel="alternate" type="application/rss+xml" title="Example Title » Comments Feed" href="http://example.com/comments/feed" />     <link rel="alternate" type="application/rss+xml" title="Example Title » Home Page Comments Feed" href="http://example.com/home-page/feed" />      I wish to have the main feed, which contains blog posts from the blog area of the site but do not want any comments, therefore comment feeds are useless to me! I am wondering if there is a way I can remove these via the functions.php or some way through wordpress rather than coming up with another (messier) solution? Thanks, Tristan


How to create directory using username within theme

I have the following code to save the uploaded file to a static directory.               <?php     //set the image size in mb     $max_upload_size='10';     $MAXIMUM_FILESIZE = $max_upload_size * 1024 * 1024;      $uploaddir = './uploads/file/';      $file = $uploaddir . basename($_FILES['uploadfile']['name']);      if ($_FILES['uploadfile']['size']<$MAXIMUM_FILESIZE) {     if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) {        echo "success";      } else {     echo "error";     }     }else{     echo"size_error";     }     ?>      But what I want is to create a username directory under "/uploads/file/". For example if the username is "john", then it should create a folder like "/uploads/file/john/" and saved the file under that folder.


Photos automatically uploaded to Media Library

Here's a bizarre one for you guys. I was using Search RegEx to remove Blogger html formatting that was screwing up my imported posts. Images hadn't been imported, so they were loading from Blogger (and within anchors pointing to that same Blogger image). Then all of a sudden I noticed three of the six post images stopped loading. I looked in the html, and lo and behold, the images had automagically been uploaded to my media library! I checked my FTP and there they were, thumbnail sizes and all! Somehow they had been added a few minutes prior. Any idea how this happened? I do have the "Add Linked Images To Gallery" plugin enabled, but I hadn't touched it yet.


Make wordpress comments work with include templatepath

How can I make the wordpress comments work with:               include(TEMPLATEPATH."/comments.php");      instead of:               comments_template( '', true );      Ay ideas? Ty


How to register images uploaded via FTP in media library?

I'm using my own upload.php file to upload images to:               $upload_dir = wp_upload_dir();     $targetDir = $upload_dir['path'].'/';      It works like it should with this exception that images uploaded to `uploads/2012/08/` don't appear in `Media Library`. Is there any function to "register" them there and in WP's database?


How to update feed only 2-3 times a week (for Feedburner email)?

So many of you know that Feedburner is a great (free) tool for sending out newsletters. The problem is that if you add content everyday, everyday emails will be sent out. I'd like to control on functions.php how I could "update" the feed only 2-3 times a week, so emails from Feedburner would be sent only on these days. I thought about using something with: ` $d=date("D"); if($d=="Fri")... ` But I don't how this could be done with actions. Could someone help? =)


How to display only the parent category in the permalink

How it is possible to display only the parent category of the post. It contains two sub categories and I want to eliminate it. Example: myblog.com/parent_category/post_name This is only what I want.


menu item to point to custom posts list

I have created custom post type. It appears in wordpress admin panel and I can add new custom posts (Post type name = "Videos"). I need to have menu item that will link to all posts from given custom post type ('Videos'). 1) How to add this menu item? What link to use? 2) Should I create some custom php file to show all posts of custom type or this can be handled by wordpress somehow? P.S. I have set permalinks to be localhost/myproj/sample-post (currently I am working on localhost).


Get parent and first child taxonomy terms?

I'm trying to get the parent level and the first child level under that. I tried using get_terms for this but I was unable I'm guessing I need something more extensive. I know I can use get terms running in a foreach but that's a lot of queries to run on page load so I'm hoping for a simpler solution. Any thoughts?


I want to display author gravatar on posts. How to do this?

I just want to add author gravatar near the name of the author. I know that I have to add something in the single.php file, but what to add? Thanks!


Don't post or draft if post already exists

I've got a problem. I don't want duplicate posts. Any way to check if a post already exists and if it does just set the new one to draft? I am using IFTTT to update my blog and sometimes it posts multiple times.


Plugin hook not working on specific Wordpress installation - how to troubleshoot?

I'm trying to write a simple text replacement plugin, but I'm having an issue that I can't figure out how to troubleshoot. This is the test plugin I'm using as a starting point. It works fine on one Wordpress installation running locally (installation A), but on another local installation (installation B), it has no effect on the post content. It's strange because installation b is working fine and I don't see any other bugs/issues.               <?php     /*      * Plugin Name: Thanks for Reading      */     add_filter( 'the_content', 'tfr_the_content' );          function tfr_the_content( $content ) {       return $content . '
Thanks for Reading!
';     }      Any thoughts on how to troubleshoot this?


how to get tax percentage in wp-ecommerce

I need to be able to get the tax percentage for the cart in wp-ecommerce. I have tried using: $wpsc_cart->tax_percentage but it does not return a value. Has something changed in the newer versions of wp-ecommerce?


How to show list of posts by author and category?

Let three categories and their IDs: cat1 = 1 (parent)   cat2 = 2 (child of cat1, parent of cat3)   cat3 = 3 (child of cat2) Let each category has 3 posts, they are: post1, post2, post3. And each posts are written by a specific author whose name is "author" and id is "99". How can I list posts as sub-items of each category? It should look like: # Author Name   * cat1     * Post1     * Post2     * Post3   * cat2     * Post1     * Post2     * Post3   * cat3     * Post1     * Post2     * Post3


Show Subcategory Description

I'm using the following code to show the subcategories of a category within my archive.php page:               <?php if (is_category()) {       $this_category = get_category($cat);       if (get_category_children($this_category->cat_ID) != "") {         echo "

";         wp_list_categories('orderby=name&hide_empty=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID);         echo "

";       }     }?>      The code above returns the name of the category as a link, with the category description as the link title. Can anyone show my how to show the category description within paragraph tags after the category link? Thanks.


Modify youtube video size on one page and show another size on different page

I have to display three videos (custom post type) on my first page. When clicking on the link, the post is displayed and video should be in default width. Can you help to find out how to change width of videos (like youtube)? This is how I display info now, and this displays all content (including video). I need somehow to show just `the_excerpt` + small video.               <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
             <?php the_title(                 '
                     ',                 '
' );             ?>
                 <?php the_content(); ?>

     <?php endwhile; ?>


Specific featured image for each category

I´d like to set specific featured image for all posts in one category. So, if I have category Good Jokes, all posts in category Good Jokes will have the same featured image displayed in front page. My current code in content.php is:               <?php if(trim(get_the_post_thumbnail($post->ID)) != '' and $themolio_options['show_featured']): ?>
         <a href="<?php the_permalink(); ?>">         <?php the_post_thumbnail('themolio-featured-image');?>
     <?php endif; ?>      Can anybody help?


HTTPS for every page except for feeds

Our site has a persistent login form on every page of the site, so of course we need to keep every page served over SSL. However, we've since discovered that Feedburner doesn't like secure feeds. Is there a way to deliver the entire site via https, except for "http://nplusonemag.com/feed"? .htaccess? Action hook? Edit: I should have shared my .htaccess rules. These are obviously not working.               RewriteCond %{HTTPS} off     RewriteCond %{REQUEST_URI} !/(feed|robots\.txt|favicon.ico) [NC]     RewriteRule ^(.*)$ https://nplusonemag.com/$1 [R=301,L]          # Force non-SSL for certain URLs     RewriteCond %{HTTPS} on     RewriteRule ^(feed|robots\.txt|favicon.ico)$ http://nplusonemag.com/$1 [R=301,L]


How can I call specific function if requested URL is not found?

My website is fully API based and builds pages/posts from API data. I was thinking to create something like PHP magic function __call to call specific function when requested URL would return 404, but do it before it happens, so I could send API request and create the page on the fly and return the previously missing page to user. What are the options to do it? I know wp_insert_post is the way to add new post via PHP, but I can't find how to hook into initial request before 404 is thrown to initiate wp_remote_request. Basically I think I miss the filter/action name for it. Thanks for any help.


Is it possible to have users register without having a password?

I'm developing a plugin and I wanted to allow users to just subscribe to a custom user level without having a password sent to them via email. this level will not be able to contribute to the site, so just reading capability. I will use this subscription to add the email to a mailing list and to allow the user to buy on this website, nothing else. Do you have any suggestions on how to build this up?


Adding an existing subfolder site to a fresh multisite in the root, would it cause a problem?

I have a 5 years old subfolder site `example.com/us` and I have nothing in the root site `example.com`. Now I want to setup a multisite in the root site to create a network, then I want to add the existing subfolder site `example.com/us` to the network, would it be a problem? Do I have to do some extra work for that to work? I've tried that in the localhost and it worked fine, but I want to be sure before moving to the Live setup. I don't want to harm my site on Google, neither do I want to lose my link building. This website has thousands of visitors daily from Google, and I don't want to lose all that. Thanks!


Theme Translation?

I've download a theme called Contango from Wordpress Themes Repository. The theme have a folder called "languagues" and have a file called "contango.po". I could open that file and do translation, but nothing changed.   * How could I translate this theme into my own language? Thanks so much and apologize for my newbie question?


Generate sidebar depending on height of post

I'm building a site which features sidebars next to each post/article displaying random thumbnails linking to other posts. Each sidebar should never be longer/bigger than the post it's sitting next to. Now of course the height of the posts vary and I want to find out/calculate the height of each post and then generate a sidebar with more or less thumbnails. What would be the best way to make this happen?   Javascript? Here's a screenshot of the design/sketch (click to enlarge):   ![design sketch](http://i.stack.imgur.com/uZ768m.png) Here is a current live version, but a lot is still to be done, work in progress!


how can i add css class on current page in wordpress wp_nav_menu **For Example I Want To Use It In Wordpress wp_nav_menu**
Home
      **Wordpress Code**               <?php $menu_args = array('menu' => 'Header' ); wp_nav_menu( $menu_args ); ?>      **Using This Function**               function add_nav_class($output) {     $output= preg_replace('/<a/', '<a class="selected"', $output, 1);     return $output;     }     add_filter('wp_nav_menu', 'add_nav_class');      **but this function select only home and not highlight current page item thanks in advance**


Stop users from logging in from multiple locations

We are running a membership site. However, we have a problem with users that subscribe to our content that are sharing there login information with other people, circumventing the need for those users to also need a subscription. Any ideas for plugins that already do this? Or suggestions of how to go about logging people out that login from 2 locations? I assume some use of IP addresses per login or something...?


How to get most recent commented post above new submitted post in Wordpress?

I have this function:               $ids = $wpdb->get_col("SELECT DISTINCT comment_post_ID     FROM $wpdb->comments     ORDER BY comment_date DESC     LIMIT 0 , 30");          foreach ($ids as $id) {       $post = &get_post( $id );       setup_postdata($post); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
       <?php     }     ?>      Which shows the `latest commented posts` in a list, which is fine. What I want to do is give a priority to this one and combine it with a "`get newest post list`". So let's say I commented today on a post called Hello World and someone else submitted a post yesterday... Than I want to get the recent commented post above this new post. The problem is that in my code snippet, there is nothing that says to get the newest posts. How can I **combine** them? **So how to combine most recent commented posts and newest posts with each other?** Is this even possible?


Adding Shortcode to Text Widget

At the moment, I'm running WordPress v3.2.2 (soon to upgrade to v3.4.2), and am trying to insert shortcode to insert Issuu into a text widget on our sidebar. The WordPress plugin I installed and am trying to use is WP Issuu, where it says I simply need to take the embed shortcode off of the article and insert it into any post or page on the site. _The shortcode works on the pages and posts, which means the widget on the website is working._ I've looked at a couple of links, including this link, which told me I had to simply insert this code into the function.php file and the shortcode would be read:               add_filter( 'widget_text', 'shortcode_unautop');     add_filter( 'widget_text', 'do_shortcode');      Instead of showing the viewer in the sidebar, the shortcode is showing on the screen as text like the picture below: ![shortcode showing instead of actual Issuu viewer](http://i.stack.imgur.com/mFtJL.png) On this post: Inserting shortcode [stream /] into a Text widget, I saw he had a similar problem but instead tried to insert the `<?php ?>` tag around the shortcode, looking like below, which didn't work either:               <?php echo do_shortcode('[issuu width=100 height=100 backgroundColor=%23222222 documentId=121205060625-55b37366f5bb447998a5683f7b7ec9af name=di12052012 username=thedailyillini tag=news unit=%]'); ?>      I don't want to resort to another plugin, such as this one to read in the PHP and want to add a simple PHP function to enable the shortcode to be read into the text widget with the code above. Is there another resort beside the add_filter code that could work? Or does this have to do with the version of WordPress being used?


how to refresh index page without reloading browser using ajax

the desire i want is similar on how facebook works; when a new content is being published, it pushes down the old post with the new posts on top.   * New Content (pushes down previous topics without reloading the page)   * Old Content 1   * Old Content 2   * Old Content 3 is that possible in wordpress?


Using a custom 410 page

I've been trying to figure this out without success. In created a 410.php in my theme, and in my nginx config, I added:- `error_page 410 /index.php?error=410` as I'd seen suggested in a few places, but as I saw mentioned in _other_ places, that doesn't work out. I just get the 404 page instead (returned with a 410 response). I saw the mentions of http://wordpress.org/plugins/wp-410/ but this is not what I want - I want to create 410 errors at the nginx level, and have nginx redirect them to a 410 page generated by Wordpress. Can anyone tell me the right way to do this, please? Frankly, if there's a correct way to send 410's to the 404 page, I can customise the 404 page to look at the query parameters and tweak the text accordingly - not ideal, but it would do the job.


How to display the posts belonging to a paticular category

I have to display the posts belonging to a particular category in the home page.As I am new to word press I don't know how to do it.PLease help me


Allowing the SoundCloud player to appear in a post excerpt

I am setting up a website for my music, in conjunction with my SoundCloud account. I plan to post the links to my soundcloud player as blog posts, but I can't figure out how to make the blog excerpts show the player. Check out the top post on the site for my example: http://jonathanperos.com/ I want the post excerpt for "Honeycomb Rainbow" show the player for it.


display all posts in current category

I am trying to display all the content/posts assigned to a certain category. I have a custom post type set up called 'Videos' and within this I have created categories called music, commercial, promo & short film. Now everytime I post under the videos post type and assign it to a category I want to display all the content assigned to that category. My attempt so far:               if ( have_posts() ) while ( have_posts() ) : the_post();         //$args = array( 'post_type' => 'videos', 'posts_per_page' => 20, 'orderby' => 'date', 'order' => 'ASC' );         $ytubeID = get_post_meta($post->ID, '_youtubeID', true);         $vimID = get_post_meta($post->ID, '_vimeoID', true);              if ($ytubeID || $vimID){             if ($ytubeID && in_array($videos_cat_to_check,$videos_categories)){ // CHECK IF CURRENT POST HAS CATEGORY MUSIC                       echo '
';                      echo '';                      echo '';                      } elseif ($vimID){                 echo '
';                 echo '
';                 echo '';                 }//end if yutbeID or vimIDthe_excerpt(); //excerpt added for information                 echo '
';         }                   echo the_content();              $taxonomy = 'category';              // get the term IDs assigned to post.         $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );         // separator between links         $separator = ', ';              if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) {                  $term_ids = implode( ',' , $post_terms );             $terms = wp_list_categories( 'title_li=&style=none&echo=0&taxonomy=' . $taxonomy . '&include=' . $term_ids );             $terms = rtrim( trim( str_replace( '
',  $separator, $terms ) ), $separator );                  // display post categories             echo  $terms;         }          endwhile;               ?>      I am displaying a vimeo/youtube video with a title and description. The user enters the video ID into a custom meta box which then displays the video. I want to display all the videos/posts for the current category. Each category has different videos assigned to them.


How to implement checkbox with Front-end Editor

I can't implement editable post meta checkbox with Front-end Editor plugin (http://wordpress.org/plugins/front-end-editor/) Here is the code:               <?php editable_post_meta( get_the_ID(), 'update_channels', array(                             'type' => 'checkbox',                             'values' => array(                                 'true' => 'Postal',                                 'false' => 'Email',                                  'false' => 'Phone',                                 'false' => 'GSM',                                 'false' => 'Fax'                             )                         ) ); ?>      What am I doing wrong? Is it possible to implement checkbox with this plugin? Thank you.


How can I update a wordpress plugin from a Git repository (github)

is there any way to easily update a plugin installed on multiple sites from a github repo. I know I can do it from the command line of each server using git pull. but is there a way to do it from the wordpress admin similar to how plugins are updated?


Custom Post Type Loop breaking php

My While loop is breaking the rest of my PHP on the site. Below I put my code that is working but again breaking the rest of the site. Any Suggestions `               $query = array( 'post_type' => 'slides', 'orderby' => 'ASC' );     $loop = new WP_Query($query);          while ( $loop->have_posts() ) : $loop->the_post();                  $title = get_the_title();             $image_object = get_field('slides');             $alt = $image_object['title'];             $sizes = $image_object['sizes'];             $image = $sizes['slider'];                  echo '
';             echo '
';             echo '';             echo '
';             echo '
';               endwhile;      `


Set featured link not showing

I created my own custom wordpress theme now i am able to add media to my site but the "set featured" link does not show, please i need some help on this.


Return all wordpress custom posts in specific multidimensional array

How can I get all custom posts (post_type=family_guy) with their ID and all of their tags in multidimensional array? Here is exactly how I would like my array to look like:               $array = array("1" =>   Array(                            "Peter1",                            "Lois1",                            "Megan1"                      ),             "2" =>   Array(                            "Peter2",                            "Lois2",                            "Megan2"                      ),           "3" =>   Array(                             "Peter3",                             "Lois3",                             "Megan3"                      ),          "4" =>   Array(                             "Peter4",                             "Lois4",                             "Megan4"                      )           );      In this array, keys will be custom posts IDs, and values will be all tags of that custom post. Thanks in advance.


How can I add Google ads to my home page?

Guys I know this is the stupid question but need a little help, I need to put ads on my homepage as I have on my post page: ![alt text](http://i.stack.imgur.com/mNARR.jpg) These are the ads I get on my post page (i.e `single.php`). I also want the same thing on my home page over here: ![alt text](http://i.stack.imgur.com/mfAh2.jpg) I tried using a `<div>` tag like I did on `single.php`, but it is not working.


add dynamic ID for wp_nav_menu after and before

I have menu like this:

                     [something]

                     [something]

      and I've try this:               $args = array(         'theme_location' => 'my-theme-location',         'menu' => '',         'container' => '',         'container_id' => '',         'menu_class' => '',         'menu_id' => '',         'echo' => true,         'before' => '
',         'after' => '
',         'link_before' => '',         'link_after' => ''     );          wp_nav_menu( $args );      I need every element inside menu item can have class [or ID is also okay] dynamicly like class="buttons-5" and other class="button-6" an so on just like my example. How can I get dynamicly my buttons class? Sorry for my bad english.


Making the category & tag Description textarea bigger

Which files do i edit to make the textarea for tag & cat description bigger? Or maybe there's an easier way through functions.php to save having to do it every-time i update wp? Thanks


need jquery help

i have a form which is displayed after every post, so i coded it in single.php, but the form is too long so i thought of putting it in jquery section, where if the user wants then he/she can click on open and the form will slide down for this purpose i used slide up/down jquery http : //api . jquery . com/slideDown/ i integrated the jquery in proper order in header.php, here is my header.php jquery code               <?php wp_enqueue_script("jquery"); ?>     <?php wp_head(); ?>     <script type="text/javascript" src="<?php bloginfo("template_url"); ?>/functions/js/jquery-1.4.4.js"></script>           <script>           $(document.body).click(function () {           if ($("h6:first").is(":hidden")) {           $("h6").slideDown("slow");           } else {           $("h6").hide();           }           });           </script>     <?php woo_head(); ?>      and this is my single.php code, `               <div class="post">          <p><h6>          <?php echo do_shortcode("[contact-form 2]"); ?></h6>          </p>          </div>      ` but after doing all this thing my sidebar i.e woo_tabs is not proper you can check the image http://i52.tinypic.com/2gxe90p.jpg here my woo tabs instead of coming side by side, it is coming down, is my code right?


Host wordpress on a subdirectory of a Rails application

I would like to know if it is possible to host a wordpress blog on the subdirectory of a rails application: For instance: I would like to have domain.com/blog instead of having my blog on a subdomain: blog.domain.com . I'm currently using lighttpd, but I can switch to something else if there is a solution. Thanks


Rogue current menu item class in wp_nav_menu()

I am working on a 'from scratch' theme which has a simple wp_nav_menu call;                wp_nav_menu(Array('menu_class' => 'nav', 'container' => FALSE));       On standard posts, archives and pages this produces the HTML I am expecting. I have an issue when the active page/current menu item is a custom post type archive/single, wp_nav_menu generates the expected _current-menu-item_ class for the active menu item, however it also generates a *current_page_parent* for the Blog link. The blog simply cannot be a page parent for a custom post type archive/single. Some related images to help: http://bloke.org/uncategorized/untitled-post/ So how or why is this happening?


Get current post's child page?

Is it possible to find out what page a post is contained in? Im in my single.php template and im listing child pages in a sidebar using wp_list_pages, I want the page (not category) that the post is visible in to be highlighted, or add current_page_item to it, is this possible? It works everywhere else at the moment except for the single.php template.


Importing Concrete5 content to WordPress

Are there any tools out there to convert content from a Concrete5 database to something WordPress can use? I have a client that may switch over, and would like to avoid manually copying content over if possible.


How do I minify '@import' css files with wp-minify?

I am trying to use wp-minify to minify my js/css on the fly. I can get the 'direct' css files to be minified, but I can't seem to get wp-minify to minify the 'linked' css files. My theme is a child theme off of twenty-ten, so my child theme's styles.css gets minified, but not twenty-ten's styles file.


pagination for blog landing page

I have a blog page at: mysite.com/blog. On this page I have this loop:               <?php          $args = array (       'pagination'             => true,       'paged'                  => 'pages',       'posts_per_page'         => '5',       'ignore_sticky_posts'    => true      );     ?>          <?php $query = new WP_Query( $args ); ?>          <?php if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); ?>          <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>          <?php the_title('
', '
'); ?>
       <?php the_author_posts_link(); ?> |        <abbr class="published" title="<?php the_time(__('l, F jS, Y, g:i a', 'example')); ?>"><?php the_time(__('F j, Y', 'example')); ?>       <?php edit_post_link(__('Edit', 'example'), ' | ', ' '); ?>

       <?php the_content(); ?>       <?php wp_link_pages('before=
' . __('Pages:','example') . '&after=
'); ?>

       <?php _e('Posted in', 'example'); ?> <?php the_category(', '); ?>       <?php the_tags(' | ' . __('Tagged', 'example') . ' ', ', ', ''); ?>        | <?php comments_popup_link(__('Leave a response', 'example'), __('1 Response', 'example'), __('% Responses', 'example'), 'comments-link', __('Comments closed', 'example')); ?>
      Which works as expected, however I cannot get pagination to work. I have tried a variety of options. Any help is appreciated.


One step picture upload

Each time I upload an image by drag & drop in the Media uploader of Wordpress, I get the options window (text-align, alt, picture name etc...). The fact is I always use the default settings and click ok as it is always good as it is. Is there a way, via the functions.php, to avoid showing the option window and automatically close the media uploader after the drag & drop (with Wordpress validating the default settings) ? Thank you.


Index page redirecting to custom post type page

Every time I go to the index page of the website, it redirects me to a single custom post type page.   This url: `http://example.com/`   Redirects you to this url: `http://example.com/custom-post-type/custom- tax/post-name/`   which is a URL that I've been working on changing from this structure:   `http://example.com/custom-post-type/post-name/` The index page is redirected to the same `post-name` page every time. **Possible reasons for this happening:**   1. I use `add_rewrite_rule()` to create these redirects:               add_rewrite_rule('^custom-post-type/([^/]+)/([^/]+)/?', 'index.php?custom_tax=$matches[1]&custom_post_type=$matches[2]', 'top')      Although I don't see at all how this has to do with the index page's redirection. I've removed the line of code and the problem persists.   2. This website also has the "Redirect" plugin (apparently this is a common problem with this plugin). These are the steps I've taken against plugin:      * Deactivated/Reactivated     * Disabled Tracking/Modified Posts through the database     * Deleted all rows in the `redirection_items` table where the `url` column was `/`.     * Viewed the logs in the `redirection_logs` table and found this:   `[url] => /`   `[sent_to] => /custom-post-type/custom-tax/post-name/` For whatever reason the "Redirection" plugin isn't showing its settings page in the admin (Tools > Redirection). When I try to access it from the plugin page, it says I do not have sufficient privileges though my account's level is Super Admin. So I edited the Tracking/Modified Posts options programmatically.   3. The only other thing I've edited in the code today was adding a custom taxonomy:               $singular = 'Custom Taxonomy';     $plural = 'Custom Taxonomies';     $taxonomy_args = array(         'rewrite' => array(             'slug' => self::CUSTOM_TAXONOMY_SLUG,             'with_front' => FALSE,             'hierarchical' => FALSE         )     );     // Register taxonomy ...      It seems to clearly be that the plugin is the issue, as it has logged a redirect from the index to that custom post type. I'm hesitant to delete all of its data though, because the site depends on many of its redirects. So before I make this decision, is there anything else that may be causing this? Thanks for all help :)


Saving Revision of post meta key/value on each update_post_meta event

I have some code that updates a meta-key's value by incrementing...                   $post_id = $wpdb->get_var( $query );         $meta = get_post_meta( $post_id, 'stuff', TRUE );         $meta++;         update_post_meta( $post_id, 'stuff', $meta );      I want to create and save a revision of the meta key/ value each time it is updated, so I can determine how many updates took place last week, last month, last year, etc. I am looking at this code here, but I don't want to do it from the edit post screen, it needs to happen when I update the post meta.


Echo all meta keys of a custom-post TYPE

Is there a way to dump a list of all meta keys being used by all posts belonging to a custom post type? I.e., a post-type named foods, each food (ham, spaghetti, chicken), can have a different meta key, which is generated dynamically. I can't know which meta keys have been added, but I'd like to be able to use a list of all of them.


How to set order for attachment form field?

I'm adding some fields to attachment edit form by add filter to "attachment_fields_to_edit". The added fields work fine but they are not rendered as the order I added them. Is there a way to order the fields?


Moved blog - galleries don't work

I moved my client's blog with nearly 800 posts from an ancient installation of WordPress to another host and a new version of WordPress. Now, several months later, we noticed that she had a few posts with gallery tags, and those tags are no longer working. I need to fix that, but I can't find any way to determine what images were used in the respective galleries. the posts just have something like this:               [gallery link="file" columns="4" orderby="ID"]      I do have a full export of the database (and all files) from the old site and looked through it, but can't find any info. However, it is quite possible I just don't know where to look. The images do not show as attached to the specific posts in the media ui. For instance, one of her galleries was in a post where she picked a bunch of images from other posts. Can anyone tell me how to find out what images were used in the galleries?


add_filter to apply_filters that exists within class

I'm still new to Classes. I have a WordPress issue where I can only use add_filters within a class on a apply_filters command that exists within the same class. Here's an example class that successfully adds a filter:               $CTAExtensions = new CTALoadExtensions;          class CTALoadExtensions     {         public $definitions;         public $template_categories;              function __construct()         {                    $this->add_core_definitions();             $this->load_definitions();           }                   /* collects & loads extension array data */         function load_definitions()         {             $wp_cta_data = $this->template_definitions;             $this->definitions = apply_filters( 'wp_cta_extension_data' , $wp_cta_data);         }              /* filters to add in core definitions to the calls to action extension definitions array */         function add_core_definitions()         {             add_filter('wp_cta_extension_data' , array( $this , 'add_advanced_settings') , 1  );              }              function add_advanced_settings()         {             echo 1;exit; works!         }     }      If I try to add the filter outside of the class like this... I have no luck:               add_filter( "wp_cta_extension_data", "wp_cta_bt_meta_boxes" , 10 , 1 );     function wp_cta_bt_meta_boxes( $wp_cta_data )     {         echo 1; exit; //does not work outside of class.              return $wp_cta_data;     }      I've even tried extending the class and adding the filter to see if it will work but without success:               $wp_cta_bt = new CTABehavioralExtend;          class CTABehavioralExtend extends CTALoadExtensions      {         function __construct(){             add_filter( "wp_cta_extension_data", array( $this , "add_advanced_settings" ) , 10 , 1 );         }              function add_advanced_settings( $wp_cta_data )         {             echo here;exit; // does not work.                                 return $wp_cta_data;         }     }      Does anyone have any insight to what I am not understanding?


RSS/XML of all Categories and/or Tags

Is it possible to get an RSS / XML feed of all WordPress Categories and/or Tags? I've searched the Codex, which was very helpful in giving examples on how to access specific, individual RSS feeds, but have not been able to find any source on how to display all Categories of a site. Using examples from the Codex, specific Categories can be found with the following structure: > example.com/category/categoryname/feed I'm looking for something along the lines of: > example.com/ **category/*/feed** OR > example.com/ **categories/feed** Any thoughts? Solutions? Suggestions? * * * **EDIT:** I'm not looking for a feed of posts, rather a feed of all actual categories or tags. Ideally, this feed would contain only the categories themselves, no specific post data. Using the categories in the feed, however, I'd be able to then gather posts as needed by looking at each of the categories specific RSS feeds. An example of what I'm looking for would be a feed that returned the following list: >   * Category 1 >   * Category 2 >   * Category 3 >   * Category 4 > Iterating over that, when needed, could give me the posts for each.


user_has_cap filter allows edit but will not allow save

## Problem I'm working on a website where we need to be able to put a username in the custom field of a custom post type, and allow the user specified to make changes to that post and only that post. I thought `user_has_cap` would be the filter hook to use but weirdly it doesn't seem to be allowing a user to update the post. The user can see the edit screen for the post and only that post which implies my filter is working correctly, but clicking update gives the error `You are not allowed to edit posts as this user.` which contradicts this. The post type has `capability_type => post` so I feel that shouldn't be the issue. ## Code               function event_cap_filter($all, $cap, $args) {         // if not requesting edit post then return caps         if('edit_post' != $args[0]) return $all;         // if user can already edit others posts then return caps         if($all['edit_others_posts']) return $all;              // if user is the post author then return caps         $post = get_post($args[2]);         if($args[1] == $post->post_author) return $all;              // query to find user in custom field         // and therefore if they are allowed to edit this post              if($can_edit) {             foreach($cap as $c) {                 $all[$c] = true;             }         }              return $all;     }     add_filter('user_has_cap', 'event_cap_filter', 10, 3);      ## Question If my user can edit the post where he is specified in the custom field I check for, why can he not save his changes? Am I overlooking something?


Edit default comments page in WP Admin

I need to make major changes on the way the comments are rendered in backend, from the following file: wp-admin/includes/class-wp-comments-list-table.php I know editing the WP Core files directly is a bad idea... Is there a way to create an edited version of this file with custom plugin and let wordpress use the file inside the plugin and not the default class-wp- comments-list-table.php ? Thank you.


How does WP custom post types fare compared to Drupal's?

In Drupal you have the GUI to create whatever type you want. How about in WP, do I still have to code to create one?


How to redirect to a passworded page based on password entered on login screen

So I'm looking for something like peter's login redirect, but slightly different. I want to build a client portal for a photography website, and I figured the best way would be to add a custom post type for clients and use advanced custom fields to add all of the extra functionality needed for the CPT. When a new client is added, a new URL will be created for the client's access page. Seems simple. Then, we can just password protect each page and send the password to the client. This is all great, however I also want to accompany this with a "login" button in the site's main navigation. When someone clicks this button, I want them to be presented with a password form where they can enter the password we sent them in the email. Based on the password they enter, they'll be redirected to the appropriate CPT page. Anyone have any ideas on how I can go about this? I assumed I could somehow run a query to pull posts based on password, but I'm not sure if the encryption used in the DB would allow for that. Any insight would be greatly appreciated.


Plugin options not appearing on options page using tabbed navigation

I've modified the plugin options page for my plugin to use tabs, using the existing WordPress system for this. However, The actual options are not appearing on the screen - just the tabs and the "Save Changes" button. Here is the code for the options page. What am I missing?


How to Display Details page of future (scheduled) posts

My question here is to display all the single detail page of future scheduled posts. It is returning 404 page. How can this be done in wordpress? What I have used so far is               $args =  array(                 'posts_per_page'   => 10,                  'category__in'     => $category->term_id,                 'orderby'          => 'post_date',                 'meta_key'         => 'starttime',                 'order'            => 'ASC',                  'post_type'        => 'post',                  'post_status'      => array('publish','future'),                  );             $loop1 = new WP_Query( $args );      From this code I get published, and scheduled posts. The permalink of the published post is working fine. But it is not working for scheduled posts, and redirecting to 404 page error.


Create a dropdown with Custom Post Types as option in admin

I need to create a dropdown menu with " **posts** from a custom post type" as option. This dropdown will be placed as custom meta box. For example, I want all posts with the custom type "Video" as option in the select.               <select>        <option>post title n°1<option>        <option>post title n°2<option>        ....     </select>      Thanks


Pretty Permalink for Search Queries Not Working

As the title suggests I am trying to create pretty permalinks for search queries, but unfortunately I cant get them to work. I am trying to achieve the folllowing:               website.com/search/something+searched      will go to the following               website.com/?s=something+searched      I have tried the following rewrite rule within the 'init' action.               add_rewrite_rule('^search/([^/]*)/$','?search=true&s=$matches[1]','top');      This doesn't work, although 'website.com/search/something' will go to the search page but not pass the var. As does the below code:                     function search_rewrite( $wp_rewrite ) {         $feed_rules = array(             'search/(.+)'    =>  'index.php?s='. $wp_rewrite->preg_index(1)         );         $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;     }     // refresh/flush permalinks in the dashboard if this is changed in any way     add_filter( 'generate_rewrite_rules', 'search_rewrite' );      I believe I'm missing something on my search.php file but I'm not sure what. Is there a reason for search queries / rewrites to behave differently to other rewrites? Thanks in advance for any assistance. Cheers Noel


What is the most efficient way to create multiple versions of the same template?

I am currently building a WordPress theme that will give users the option to select different layouts for the same template. This will mainly pertain to the home and blog page. I'm thinking like one of the larger commercial themes that have multiple home page layouts. I know from experience that these themes can be quite bloated and load very slowly. What would be the best way to create multiple versions of the same template? Should I use `template_include` (link)?


A pagination-sort-of-thing on single.php view for the custom post type

First, a quick demonstration of what I need to achieve: ![enter image description here](http://i.stack.imgur.com/NbhNQ.png) It would work similarly to `<?php previous_post(); ?>` and `<?php next_post(); ?>`, but also include an actual "reel" indexing all entries in a specific taxonomy. Yes, I see the major flaw in this - in case of 100 entries the list would be !@#$long, however, the number of entries will be strictly monitored by a client. This solution is so far from optimal, that I can't even see it, but it needs to be done, one way or another. Additionally, I've created a custom post type for this, displaying single images (being Featured Images) and their titles and it's divided into four taxonomies. All four taxonomies need to be displayed on four separate "gallery" pages, so I can't use a single template for that, unless I make a big `if` loop checking the taxonomy of the first entry displayed. **EDIT:** I think I may have figured that out, sort of. By setting the custom post type to hierarchical, I can `wp_list_pages()` whole taxonomy and fiddle with that.


Image load issue with custom page template on Internet Explorer

I have created a website http://demo.tennis-florida.com/ and it is using custom theme that I built when I am opening this on Internet explorer.   * Images in custom post grid are not showing up (perfectly showing up in source code) but they are working fine with other browsers.   * On internet explorer 8 and below the main slider is displaying in half.


Check the Version of an Enqueue'd External Library

I want to use an external font library in my plugin, but I want to do a version check first to determine if I should bother enqueue'ing my version or not. I know I can see if a library is already loaded -- `wp_script_is()` -- but I don't know how to check the library's version. Any ideas?                   if ( wp_script_is() || wp_script_is( 'registered' ) ) {             \\ version check here         }


Should I save this mulit dementional arary as one post meta?

I have several blocks of data to save into post meta, including 'file_property', 'workspace_property', 'user_property','access_type', 'usage_tracking'. Each block in itself is an array. Should I save them all as one post-meta, or save each single data sepeartely? I feel the post-meta table might be a bit too long if one post has 20 to 30 meta-key, but if all in one, I'm not sure if it's convinient when query or update, so to ask.


How to wrap this Link with an Image?

im working on default wordpress theme twenty eleven, i just wanted to know how can i wrap this previous and next anchor with an image or next/previous button?               <?php previous_image_link( false, __( '← Previous' , 'twentyeleven' ) ); ?>     <?php next_image_link( false, __( 'Next →' , 'twentyeleven' ) ); ?>


Disable editing profile for second time

Hi and thanks every one . i wonder if there was any way to disable editing profile for users of my site for a second time . because after i approve a user he/she changes his avatar to inappropriate photo ! any suggestion really appreciated .


Add Field To All Pages

I'm trying to add a custom field to the built in Page content type. I've found lots of tutorials on how to do this for a single page, but I want to do this for all pages in my theme. Please point me in the right direction.


Rewrite rules causing hole

I am using rewrite rules to catch /events/date/* Events is the custom post type I am working with. So archive-events.php, is normally my index, but with my rewrite rules, I need to identify a specific pagename. Do I have to duplicate that specific file, or is there a way I can point to archives-events.php? see below...               function add_events_rewrite_rules($aRules) {         $aNewRules = array('events/date/([^/]+)/?$' => 'index.php?pagename=events&_events_date=$matches[1]');         $aRules = $aNewRules + $aRules;         return $aRules;     }     add_filter('rewrite_rules_array', 'add_events_rewrite_rules');


Custom Post Type template for homepage

I'm writing a squeeze page plugin and I've hit a bump. The plugin needs to be able to display custom post types with a custom template and also be able to be used for the homepage. So I've got the code to set a template for the custom post type:               add_filter('single_template', 'my_custom_template');          function my_custom_template($single) {     global $wp_query, $post;          if ($post->post_type == "squeeze_page"){         if(file_exists(ABSPATH . '/wp-content/plugins/wpsqueezr/squeeze_page.php'))             return ABSPATH . '/wp-content/plugins/wpsqueezr/squeeze_page.php';     }     return $single;     }      That works fine for displaying the custom post type. Adding it to the Reading settings works:               add_filter( 'get_pages',  'add_my_cpt' );          function add_my_cpt( $pages )     {          $my_cpt_pages = new WP_Query( array( 'post_type' => 'squeeze_page' ) );          if ( $my_cpt_pages->post_count > 0 )          {              $pages = array_merge( $pages, $my_cpt_pages->posts );          }          return $pages;     }      Now here's where it gets messy. That all works fine, but if you set the custom post type to the homepage, it redirects to the custom post type page, no good. I found this code which adds the custom post type to the frontpage, but it doesn't show the custom template I've setup for single pages:               function enable_front_page_stacks( $query ){         if(( ! isset($query->query_vars['post_type']) || '' == $query->query_vars['post_type']) && 0 != $query->query_vars['page_id'])             $query->query_vars['post_type'] = array( 'page', 'squeeze_page' );     }     add_action( 'pre_get_posts', 'enable_front_page_stacks' );      I need to show the custom template for the custom post type on the homepage, not the custom post type in the homepage template. I tried the home_template filter but that didn't do anything. Any ideas? Edit: Worked it out, just add a page_template filter as well as a single_template filter. I hope this helps someone else! Cheers!


Media player with branding

Please suggest any good media player plugin,Which allows embedding from major video sharing sites, & also allows customization so i can add branding / my own LOGO.


Display the link of a custom taxonomy

I'm trying to manually display the link of a custom taxonomy term that I have created. The taxonomy is 'event-themes' and the term is 'Boat'. Here's my code:               <?php $themeOne = array(                 'tax_query' => array(                     array(                         'taxonomy' => 'event-themes',                         'field' => 'slug',                         'terms' => 'boat-theme'                     )                 )             );             ?>
<img src="<?php bloginfo('template_directory'); ?>/images/eventSearch/theme-onFoot.png" /><?php echo $themeOne; ?>
      I'm not very familiar with PHP so I guess I'm probably missing something very obvious here, but my main aim is to simply 'handpick' the taxonomy term I want, and display a link to the page displaying all posts/pages under it. Thanks


Custom user profile, registration, login page with theme

WordPress user profile page uses the administration interface, and its user registration / login page is not part of the theme. I would like to   1. change it into the custom theme of my site   2. customize login / registration page, hopefully with a custom form, and captcha   3. remove the top bar when the user is logged on   4. retain this top bar functionality, and administration interface access for administrators and contributors (because I'm using 'Debug Bar' plugin, which is a part of the top bar)   5. for the rest of regular users, just hide the dashboard (technically make it inaccessible even if URL is entered), and use the profile page with site theme. How do I achieve this? I'd like to use filters/hooks and maybe create a custom plugin. I prefer not to change the code of WordPress itself. Thank you.


Managing updates when Wordpress is in your own svn repo

I download and configure Wordpress for a development environment and a production environment. After it's set up on one server we check it into a subversion repo and then go and check it out on the production server. Deployment complete. The trouble is when I have to update. I'm supposed to delete wp-includes and wp-admin but if I do that svn goes crazy. What are some strategies for dealing with Wordpress, subversion, and multiple deployment environments?


Query var removed after rewrite

I have a WordPress blog that uses custom post types, which I'm creating using the WCK plugin. One of which is the post type **shows**. A permalink to a specific show, then, appears as:               http://my-website.com/wordpress/shows/show-slug/      This is all done through the current functionality of WP and the WCK plugin. However, I am trying to add another "level" of detailed information to be displayed on that single show page. For this, I am using the URL query variable **item** to designate this. So, for example, if I want to view the list of episodes for a certain show, I could visit the URL:               http://my-website.com/wordpress/shows/show-slug/?item=episodes      These "items" vary per-show and are more or less arbitrary, but I already have the logic on the single-shows.php template to determine whether or not the item provided in the URL query is a valid one for that show. Anyway, I want to use the rewrite functionality to make the URLs a little bit nicer, with the format:               http://my-website.com/wordpress/shows/show-slug/episodes      This is where I'm running into problems. Here is my PHP script in my theme's functions.php file to register that URL query var and the rewrite rule:               function shows_item_tag_registration() {         global $wp;          $wp->add_query_var('item');      }          function shows_item_rule_registration($rules) {         $newrules = array();         $newrules['^shows/([^/]+)/([^/]+)/?$'] = 'index.php?pagename=shows/$matches[1]&item=$matches[2]';         return $newrules + $rules;     }          add_filter( 'rewrite_rules_array','shows_item_rule_registration' );     add_action( 'init','shows_item_tag_registration' );      I am not flushing the rewrite rules myself, as I do not want to lose the rules being written by the Permalinks settings in the WP Admin. Instead, as you can see, I am adding my rule to the "current list" in the **rewrite_rules_array** filter. To apply changes, I re-save the Permalinks settings in the WP admin, and that seems to be doing the trick as far as that goes. Frustratingly, it almost works, but when I try to visit the URL with the item at the end, like so:               http://my-website.com/wordpress/shows/show-slug/episodes      It simply redirects me to:               http://my-website.com/wordpress/shows/show-slug/      And removes the item from the query altogether. I found this Stack Exchange question that seemed pretty similar, but I was not able to resolve my issue with the answer from there.


Set or change default text in hyperlink popup in post editor

When writing a post or page in the post editor (not the Visual editor but the HTML editor) and clicking on the "link" button, a popup appears with `http://` already prefilled. Is there a way to change this default text? For example, since I usually link internally to my own site I would want to use my base URL because then I could either quickly type the rest of the URL, or just overwrite it if I was hyperlinking somewhere else. `http://www.myurl.com/` I swear I saw a blog article on how to do this but I cannot locate it through searching the web. Thanks in advance for any help.


Strange font-style / font-weight on CPT list columns screen

As you can see below, for some reason the "Author" column displays extremely strange (like non-anti aliased) in Chrome. I added the snippet from the dev tools bar to show that I can't see any difference. Do you know why this happens? ![enter image description here](http://i.stack.imgur.com/RHkbL.jpg)


OG:Audio facebook meta tags

Does anyone have any Idea how to populate the attached audio file URL into meta elements? Just as you would featured image or something Here's what I tried:               <meta property="og:audio" content="<?php $meta_values = get_post_custom($post->ID);     if(isset($meta_values['meta_audio_attachment'][0])){ $url =$meta_values['meta_audio_attachment'][0]; } ?>" />     <meta property="og:audio:title" content="Test" />     <meta property="og:audio:artist" content="Test" />     <meta property="og:audio:album" content="Test Album" />     <meta property="og:audio:type" content="application/mp3" />      Facebook populates all the rest of the meta's except the audio url?


How to best create a jQuery Slider to display a native wordpress gallery?

It seems there must be a plugin for this, but I can't find it. I'd like to enable a jQuery slider in a post, using the images I've added to the gallery for that post. Does anyone know of a plugin? And if not, what would be the smartest way to implement this? Again it's important that it calls from that posts gallery - using the native WordPress gallery. Thanks in advance!


Not getting an ajax readystatechange on my page

I've been trying to get a stand alone web page I use rebuilt as something that can be accessed as a page in my blog. Following advice I've created a new template for this page and do all my work there. The page remembers $_SESSION correctly and the php works well. On this page there are drop down boxes that update other drop downs. If I update them manually all is well with the world. When I attempt to introduce my ajax calls things go wonky. At the moment update.php just echos back "hello".               <script>     function changeFn( ) {       var newOpt = document.createElement('option');       var oldSel = document.getElementById('slight');       while ( oldSel.length > 0 )         oldSel.remove(oldSel.options.length-1);              var ajaxRequest;     alert("start req"); // I observe this alert         try {         // Opera 8.0+, Firefox, Safari         ajaxRequest = new XMLHttpRequest();         } catch (e) {         try {         // Internet Explorer Browsers         ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");         } catch (e) {         try {         ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");         } catch (e) {         // Something went wrong         alert("Your browser isn't supporting XML HTTP requests.");         return false;         }         }         }              // Create a function that will receive data sent from the server         ajaxRequest.onreadystatechange = function () {        alert("state change: "+ajaxRequest.readyState);  // I never observe this         if (ajaxRequest.readyState == 4) {           if (ajaxRequest.status == 200) {     alert(ajaxRequest.responseText);             //extract( ajaxRequest.responseText, "one" );           } else {             alert("There was an error retriving the data");           }         }       }          alert("trying"); // I observe this alert       var url = "http://myurl/update.php";       var params = "CID="+classID+"&GID="+genreID;       ajaxRequest.open("POST", url, true);       ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");       ajaxRequest.setRequestHeader("Content-length", params.length);       ajaxRequest.setRequestHeader("Connection", "close");       ajaxRequest.send(params);               alert(" hi"); // I never see this alert     newOpt.text="got this far";       newOpt.value= -1;            document.getElementById("slight").add(newOpt, null);       return true;     }     </script>      Some alerts fire, but the ones associated with the callback function do not. PS I am not trying to access anything that is specific to the wordpress site itself, I'm accessing an entirely different database.


Set Default Listing "View" in Admin

I'm looking for a way to set the default "View" options under post types in the admin area. For example, by default Posts will default to a "list" view instead of "excerpt" - I'd like to change this to excerpt by default - what would be the best way to achieve this? I've done a bit of searching on this, but am stuck in the mud thus-far. Any help would be greatly appreciated. Thanks!


Allow User Can See His Post on his dashboard

I want to allow user that Post option display on his dashboard. Where User's Can Show only his post. How I manage this. Please Help me.


What's the best way to create a new design for other pages?

I want to create a different design for all new and existing pages, with the exception of the frontpage. The new design includes another subheader, container, and an extra subfooter. My guess was to edit footer.php/header.php in my child theme directly, and create seperate subheader/footer/container for these pages, and apply them as follows:               <?php if ( is_home() || is_front_page()){

                                      }     else {

     } ?>      Is this a correct way of applying a new design, or could this be done simpler?


New post notification plugin

I need a plugin that makes a menu item to start flashing on the frontend if there is a new post / or lets say the will be green button that will turn to red. and stops flashing the menu item/button if we turn it off manually. Thanks a lot


get_user_meta() to Return User Meta Only for Current Blog in Multi Site

I've written a plugin that allows users to bookmark their favorite posts, but have run into a small problem when using it on a multisite network. Each time a post is bookmarked, the ID of that post is stored in an array of IDs in the current user's meta table. This all works great, until it's used on a MS setup. If viewing the site that the bookmarks were created on, everything works great, but when viewing a different site, I get a list of post IDs that belong to the other site. This is because the user meta table is shared between sites. So, what I need to do is retrieve only the user meta for the current site. Is there a way to do this? I don't think there is, so if anyone has some insight, that'd be great.


Runng Cron Job for Plugin With No CronTab Access

I have a site running WordPress and the Twitter Wordpress plugin (http://community.plus.net/opensource/twitter-wordpress/) My host does not provide access to crontab, so I am looking for a way (plugin?) to run the Twitter Wordpress update automatically on a scheduled basis. According to the plugin website, this is possible: > If users wish to have regular/automatic updates of their Twitter account > tweets, then that is achievable through creating a crontab entry, or similar > automation mechanism, to execute the supplied “runTwitterScript.php” file. The question is: how can I do this without cron access?


Display only a single CPT

I have used the CptUI plugin to create a 'Products' CPT. The admin side of things seems to work fine but I can't quite get the front end to display how I'd like. For example I create a product, say "Guitars" and another called "Drums". Their permalinks in admin are dispay as `http://mysite.com/products/guitars` and `http://mysite.com/products/drums` respectively which looks great. However, when I navigate to one of the URLS, I see a page that lists all the current products. This makes sense considering my `single-products.php` contains the following:               <?php      /*Template Name: Products Template      */          get_header(); ?>

         <?php         $mypost = array( 'post_type' => 'products', );         $loop = new WP_Query( $mypost );         ?>         <?php while ( $loop->have_posts() ) : $loop->the_post();?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                         <?php the_post_thumbnail( array( 100, 100 ) ); ?>
                          Name: <?php the_title(); ?>

<?php the_content(); ?>

              <?php endwhile; ?>

     <?php wp_reset_query(); ?>     <?php get_footer(); ?>      What I'd ideally like is for `http://mysite.com/products/guitars` to display only the single CPT with the guitars content, (the same for the drums) and then `http://mysite.com/products` to display all the products (As it currently does for `http://mysite.com/products/guitars`). Is this possible and if so, how?


register user only with specific Host name

Hii i want to that whenever any user register at my wordpress that just accepet email of specific host for example if I want to accept only User register with username@gmail.com this email format otherwise that show some error that you can only register with @gmail.com so how to apply this condition and in which file thanks


Query posts from different categories in multisite

In my planed multisite installation, I want the members to be able to post in one of two different categories.   Members in A can post in 1. Members from B can post in 2. All members can comment everything. Then, I plan to create a custom page template to the blogs index, and I hope to query all posts from members in 1 and 2, and display title and a minor excerpt (along with avatar image) in separate columns (widgets). Is this possible? (I am not planning to use Buddypress).


How to disable the editing of the time and date published?

I would like to ask how to disable the editing of time and date published? Also, I would like to ask if it's possible for people who doesn't own the blog to post, not just comment, but post their own posts in the blog. Please and thank you.


Show last post from multiple categories using wp_list_categories

I have the following code that lists out the children categories on a separate page when you click on its parent category. The code renders a list like so: Home › Archive for IQ Issue 7   * Journal   * news   * world view However I would like to retrieve the latest post from each of these categories and print underneath the category name. How could I achieve this within the loop below? I have tried several foreach loops but none seem to print the correct info. Thanks in advance. category.php               <?php $this_category = get_queried_object();          // if parent is 0, category is top level     if( 0 == $this_category->parent ) :              // top level category,         // show child categories of this issue         $args = array(             'child_of' => $this_category->term_id,             'title_li' => '',             'hide_empty' => 0         ); ?>              <!-- output a list of child cats for this issue         see also get_categories or get_terms if you wish to use your own markup-->                   <?php wp_list_categories($args); ?>                              <?php else :              // child category,         // show articles in this subcategory, etc.         echo 'child category';          endif; ?>


which page Shop template use?

I am finding the template to edit but don't know where to look in woocommerce directory? I want to edit the page that displays all category when someone click on shop, more specifically i am looking to remove the item count show in brackets.


Pagination working everywhere but the index page

No idea why but pagination on my homepage isn't working although it works in every other place..custom templates, archive, searches. I've tried every version of pagination possible it seems. I've used wp_query, query_posts, get_posts. I've tried the method of setting temp wp_query and wp_query to null and then adding it again after the pagination. I've tried just setting paged to $paged. The odd thing to me is the same loops works on an older theme I have but not on mine. It works on a page I've created using the exact same loop. So I'm looking for some hints on what might be causing this. Here is my loop.                global $wp_query;      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;      $args = array(         'meta_key' => 'rating',         'meta_value' => 0,         'meta_compare' => '>',         'orderby' => 'meta_value_num',         'order' => 'DESC',         'cat' => -1,         'posts_per_page' => 16,          'paged' => $paged,         'post_type' => array( 'post','videos','articles'  )      );     $wp_query = new WP_Query($args);     while ( $wp_query->have_posts() ) : $wp_query->the_post();       get_template_part( 'loop', 'contents' );     endwhile;     ?>     <div class="infinitescroll">       <?php next_posts_link('next posts'); ?>     </div>      I've tried setting `global $paged`. I've tried setting the `get_query_var` to page instead of paged. No dice.


If two users attempt to modify a page, does Wordpress still work correctly?

I am worried about allowing more than one user of my Wordpress installation use Wordpress at the same time. What if one user updates a page or deletes a page while the other user is editing it? How robust is Wordpress under this multi-user case? I am talking about users who are logged into Wordpress as editors.


WPDB is not working when trying to run a custom query

I'm developing a WordPress plugin, and have no other plugins installed. The logging function is as simple as               function log($message){         global $wpdb;         $message = $wpdb->escape($message);         $wpdb->query("INSERT INTO {$this->db['log']} (message) VALUES ('{$message}');");      }      Since the `$wpdb->query` didn't do anything but`@mysql_query( $query, $this->dbh );` did, I'm not sure if this question is about wordpress. source code http://xref.yoast.com/trunk/nav.html?wp-includes/wp- db.php.source.html#l1053 Plugin workflow: 1) Gather a list of events. 2) Loop the list. 3) Process each event. The function log will be invoked here when someting important should be logged such as "file is saved in /path/". 4) Stop The whole work flow will take about 2 minutes to finish. The log function is invoked 75 times while running. However, no log entry is found in the database while running. When the plugin completes execution, those log entries are inserted and can be seen from database table. What can I do that will insert log entry to database on the fly? Thanks in advance.


How to create Sub Sub domain Multi User blogs?

Hi to all I would like to create a big Wordpress network with this structure:   * sitename.com (Main website)     * cat1.sitename.com (sub website)       * cat11.cat1.sitename.com (sub-sub website)       * cat12.cat2.sitename.com (sub-sub website)     * cat2.sitename.com (sub website)       * cat21.cat1.sitename.com (sub-sub website)       * cat22.cat2.sitename.com (sub-sub website)     * cat3.sitename.com (sub website)       * cat31.cat1.sitename.com (sub-sub website)       * cat32.cat2.sitename.com (sub-sub website) Is it possible using only one wordpress installation with subdomains? If it is not is it possible to share userdatabase (and why not also posts and all the stuff) between all the websites? Is there anyone that already did it and can help me to achieve this? Thank you very much!


Use plugin multiple times

I have a site for a booking agency for entertainers. Each entertainer has their own page. The sidebar currently contains the advanced twitter profile widget for the agency's twitter account. Each of the entertainers' pages needs the same widget in their sidebar with their own account id. Question is: Is it possible to use the same plugin with different id's? Or: Must I create multiple sidebars (20 +) and hard code the plugin using the different account id's? The hard code I have used that is suppose to mimic this plug falls short on functionality and cannot be styled to look identical to the widget. Any help is appreciated.


Math notation on WordPress.com?

I am a new user with WordPress, and I would like to use mathematical formulas. I have been reading the mathjax pages for hours, such as this one and quite a few others. This may be a bad question, but can someone please help me? All I want to do is enable Latex, and I am hopelessly lost. My most recent attempts have been trying to find the "header file" so that I can copy and paste in               <script type="text/javascript"         src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">     </script>      I have tried looking for it, and looked over a whole bunch of forum posts about where to find this header file, but I just do not understand. A step by step explanation of how to make mathjax work in the simplest way possible would be extremely appreciated!! (Also, don't worry about leaving in too many steps!)


Chance post id into post name

I´d like to echo the post name instead post id. My code shows just the id.               <?php      global $post;     $customlink = get_post_meta( $post->ID, 'clink', true );      echo $customlink;     ?>      Thanks   Ogni


A reliable AdSense plugin. Does it exist?

I've tried a bunch of AdSense plugins but I can't seem to make any work. Can someone recommend something that is known to work? My requirements are simple: display an ad under the header.


wp_list_tables bulk actions

How to fire on bulk actions inside of an extended WP_List_Table. I have been adding the following bulk actions to may table's select box but on Apply won't really happens anything here are how I added my bulk actions               function get_bulk_actions() {       $actions = array(                  'delete'    => 'Delete',                  'parsing'    => 'Parsen'       );            return $actions;     }      and here is the check box column               function column_cb($item) {              return sprintf(                      '<input type="checkbox" name="record[]" value="%d" />', $item['Round']             );              }