How to import data from another website using an API link?

I have an API link (`$content` bellow), and I need to display the content fetched from this link in the dashboard. I don't have slightest idea how to do this.               if( !class_exists( 'DevMind_DashboardWidget') ) {         class DevMind_DashboardWidget {             function devmind_dashboard_widget() {                 // External Iframe Widget                 echo '<script src="//www.gmodules.com/ig/ifr?url=http://widgets.getclicky.com/igdash/clicky.xml&up_siteName=www.ejobindia.com&up_siteID=100542361&up_siteKey=a16e8cf0a5a195e5&up_resultLimit=10&up_showKeywords=1&up_showEngines=1&up_initalSelection=0-summary&up_showPercent=1&synd=open&w=320&h=250&title=Clicky&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>';                      //$content contains the original xml which I need to transfer into data table                  $content= 'http://serpbook.com/serp/api/?viewkey=dw8628r&auth=678a498d500a203885191bdd16c70190';             }                  function devmind_add_dashboard_widget() {                 wp_add_dashboard_widget(                      'devmind-custom-widget',                      'Campaign Manager',                      array( 'DevMind_DashboardWidget', 'devmind_dashboard_widget' )                  );             }                }              add_action(              'wp_dashboard_setup',                  array(                      'DevMind_DashboardWidget',                      'devmind_add_dashboard_widget'                  )              );     }


Anyway to hide a Category in the Categories section when adding/editing a post in WP Admin?

I have a Category that I would like to hide in the WP Admin so the author can never check it when adding or editing a post. Is there anyway I can prevent it from showing up by modifying my function.php file?


WordPress not auto saving custom posts

I am custom post types in WordPress. I have also added several new input box other than the WordPress default ones. But the problem is WordPress is only auto-saving input box created by it and ignores all the fields created by me. When I refresh page all of them get cleared other than WP title box. So how can I add those fields to WP autosave too?


How can I remove page titles without removing the link in the navigation bar in twentyeleven?

I 'd like to remove the titles from every page in my blog. But the title in de navigation balk must stay of course. Any idea? Please explain as easy as possible :-) cause I 'm taking my first steps in the Wordpress world. Thanks.


How can I remove the title "leave a reply" in the comment box in twentyeleven?

I would like to remove "leave a reply" in the comment form in twenty eleven. How can I do this? Thanks in advance.


Creating an online account & ordering system

Is it possible to create an account & ordering system with online payment (via paypal) for WP? Are there any kind of plugins for this? We'd require some basket functionality so products can be added, an account area that could include order history and online payment to pay via paypal.


Admin taking a very long time to load

Logging into my site's Wordpress admin backend take several minutes. The site indicates that it is loading and then just hangs for many minutes before finally loading. It smells like something is timing out, I suspect a plugin, but I can't for the life of me figure out what. In order to troubleshoot this, what steps would you take if confronted with such a problem? Turn plugins on and off and see which is the culprit? The problem with this approach is that after the initial slow loading, everything loads normal. Check php max execution times in php.ini? Somehow monitor outgoing connections to see what's trying to reach something and timing out (how would you do this)? Any suggestions welcome.


How to remove wordpress admin bar in dashboard

I would like to rebrand wordpress. Can anyone tell me how to remove it from dashboard? Is there any hook available. Or I should edit core files. If i should edit core file can anyone tell me which file? I edited `wp-includes/admin-bar.php` and removed this action               add_action( 'admin_footer', 'wp_admin_bar_render', 1000 );      It actually removed the admin bar. But it doesn't remove admin bar style sheet. I see empty space instead of admin bar. I mean i see padding in the top. Can anyone point me in the right direction? Thanks


Creating your own widgets: using cache?

I'm in the process of making my own widget but I don't like it to fully generate the content each time since the process is quite lenghty. I can easily create my own caching mechanism but I'm wondering if there is something that already exists in the wordpress core when it come to caching widgets. Ideas? Thanks! Dennis


How to organize products by collections with collections description?

I have products in my store sorted by categories. (Braslets; Rings; Earrings) It was not difficult to adapt my theme for listing products by categories. But now I need to organize my products by collections. I have collections for example 'Spring surprise', 'Smoky winter' etc. First time I thought to assign tags to products, but I also need to show collections description, this means to show tag's description. How can you advice me to organize products by collections? Does wp-e-commerce allow to set up a tag description? PS. I'm newbie in wp-e-commerce and it seems to be hard for understanding.


301 redirects in Headway based WordPress Site

I have a site built with Headway theme. Currently, URL of each of my blog posts is simply               http://example.com/blog-post-name      I'd like to add a folder so the URL would be:               http://example.com/blog/blog-post-name      If I add that folder, will the existing URLs automatically redirect to the new URLs which include that folder name, or would I have to manual create 301 redirects for each one?


Is there some way to refator this jQuery wrapper?

I have a script which looks like this                 $(function(){            ... Jquery Code in Here            });      and I want to wrap it to make it compatible with WordPress. Do I have to do ...               (function($){            $(function(){            ... Jquery Code in Here            });          })(this.jQuery);      It works but it seems like there might be a more concise version. Is there?


Custom Taxonomy Not Showing in Menu

Using Wordpress 3.7.1 and PHP 5.4.12 I am trying to create a Custom Post Type called "News" and an associated Taxonomy Called "Subject". I generate the code from Generate WP site as below: After running the code I figure out that the Taxonomy is not showing in the Menu! ![enter image description here](http://i.stack.imgur.com/ivDHD.png) after struggling with code Little bit I updated the code Hook action by removing the "0" parameter as: ![enter image description here](http://i.stack.imgur.com/fqOat.png) to: ![enter image description here](http://i.stack.imgur.com/tWLNx.png) Surprisingly , this time it worked! and the Subject Taxonomy appears in the Menu ![enter image description here](http://i.stack.imgur.com/EWfCd.png) BUT I can not add any Terms to the taxonomy as I am encountering with this red box error ![enter image description here](http://i.stack.imgur.com/huYCu.png) Can you please let me know what I am doing wrong here?               <?php     // Register Custom Post Type     function custom_post_type_news() {     $labels = array(         'name'                => 'News',         'singular_name'       => 'news',         'menu_name'           => 'News',         'parent_item_colon'   => 'Parent News:',         'all_items'           => 'All News',         'view_item'           => 'View News',         'add_new_item'        => 'Add New News',         'add_new'             => 'Add New News',         'edit_item'           => 'Edit News',         'update_item'         => 'Update News',         'search_items'        => 'Search News',         'not_found'           => 'No News Found',         'not_found_in_trash'  => 'No News Found in Trash',     );     $args = array(         'label'               => 'news',         'description'         => 'News Information Pages',         'labels'              => $labels,         'supports'            => array( 'title', 'editor', ),         'taxonomies'          => array( 'subject' ),         'hierarchical'        => false,         'public'              => true,         'show_ui'             => true,         'show_in_menu'        => true,         'show_in_nav_menus'   => true,         'show_in_admin_bar'   => true,         'menu_position'       => 5,         'menu_icon'           => '',         'can_export'          => true,         'has_archive'         => true,         'exclude_from_search' => false,         'publicly_queryable'  => true,         'capability_type'     => 'post',     );     register_post_type( 'news', $args );          }          // Hook into the 'init' action     add_action( 'init', 'custom_post_type_news',0);          // Register Custom Taxonomy     function custom_taxonomy_subject()  {          $labels = array(         'name'                       => 'Subjects',         'singular_name'              => 'Subject',         'menu_name'                  => 'Subject',         'all_items'                  => 'All Subjects',         'parent_item'                => 'Parent Subject',         'parent_item_colon'          => 'Parent Subject:',         'new_item_name'              => 'New Subject Name',         'add_new_item'               => 'Add New Subject',         'edit_item'                  => 'Edit Subject',         'update_item'                => 'Update Subject',         'separate_items_with_commas' => 'Separate Subject with commas',         'search_items'               => 'Search Subjects',         'add_or_remove_items'        => 'Add or remove Subjects',         'choose_from_most_used'      => 'Choose from the most used Subjects',     );     $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,     );     register_taxonomy( 'subject', 'news', $args );          }     // Hook into the 'init' action     add_action( 'init', 'custom_taxonomy_subject', 0 );


"Theme without sidebar.php is deprecated"

I'm building a custom wordpress theme. When I turn on debug, I get this message: Notice: Theme without sidebar.php is deprecated since version 3.0 with no alternative available. Please include a sidebar.php template in your theme. in /var/www/wp2/wp-includes/functions.php on line 2968 However, I do have sidebar.php in my theme. It's copied and unedited, from wp- includes/theme-compat What am I doing wrong?


Sort post by category using HTML Select tag

Good day wordpress dev. Just want to ask if it is possible to sort, filter or query post using HTML Select tag? This is the design I am trying to develop. http://i255.photobucket.com/albums/hh140/testament1234/sort_post_zps7415de5e.png I have been searching for solutions on how to accomplish this and the closest thing i can find is the Select query solution. Sorry if i cannot provide any code right now since i'm still searching for a solution and this kind of feature is unknown to me


Clarify: Enqueueing scripts within shortcode only loads in footer?

Each time I enqueue scripts inside the shortcode handler, it ends up in the footer. It doesn't matter whether I register them first and set it to load in the header, if I enqueue inside the shortcode it goes in the footer. From what I understand this is the correct behavior - am I right? Is there any possibility to enqueue a script from within the shortcode handler that will go in the header? Typically I'd let it load in the footer but some JS's just refuse to work in the footer and I have to fall back on strpos or regex to look for the shortcode before enqueueing. I'm just trying to find a more efficient way. Thanks! --Update-- As requested, here were my methods.   1. Register script              add_action( 'wp_enqueue_scripts', 'ftrjs_admin_init' );     function ftrjs_admin_init() {     wp_register_script( 'lwtcountdown', get_stylesheet_directory_uri().'/lwt/js/jquery.lwtCountdown-1.0.js', array('jquery') );     }        2. Shortcode              add_shortcode( 'ftrjs', 'ftrjs_callback' );     function ftrjs_callback( $atts ) {     wp_enqueue_script('lwtcountdown');     wp_enqueue_script( 'lwtcounter' );     wp_enqueue_style( 'lwtstyle' );          $out = "";     $out .= "<script type='text/javascript'>     jQuery(document).ready(function($)     function set_by_date() {     $('#countdown_dashboard').stopCountDown();     $('#countdown_dashboard').setCountDown({         targetDate: {         'day':      15,         'month':    1,         'year':     2014,         'hour':     12,         'min':      0,         'sec':      0     }     });     $('#countdown_dashboard').startCountDown();     }     )};     </script>";     return $out;     }      In doing this exercise, I see now why it doesn't work because my shortcode outputs Javascript inline, before the plugin loads in the footer. Once I pulled that out and put it into a separate JS file and enqueue that file it works. So now, if I need to pass variables I have to use wp_localize_script.


What is wrong with my page.php?

I hard coded the html from resources.php from a site into page I created the wordpress admin, which used the default page template. Then I entered the following code into the page.php template. The result is http://strategichospitalitysearch.com/blog/resources.
<?php the_title(); ?>
               <?php           $page_id = 98;           $page_data = get_page( $page_id );           $content = apply_filters('the_content', $page_data->post_content);           $title = $page_data->post_title; // Get title          echo $content; // Output Content          ?>

           My Problem is that it may not work for other pages in the future and the subpages for resources. What is the best approach to this?


MySQL Replication Latency Issues in wp-admin pages

I have an environment running WP 3.0.1 with a Master db and two slaves. I am using HyperDB to force all writes to go to the Master, and all reads to read from the two slaves. I am experiencing a variety of issues in wp-admin pages where data is being written to the master, and WordPress attempts to read from a slave, and the data has not reached the slave yet. An example of this is when I hook ' **dbx_post_advanced** ' to preset some category and custom taxonomy terms on new posts. I have verified that when I configure HyperDB to read and write from the Master alone, the ' **dbx_post_advanced** ' hook works fine. I'm currently looking into the following options to resolve this issue:   * Dedicate only one web server to all wp-admin traffic      * Configure that server to read and write to/from the Master db only     * Configure the load balancer to route all /wp-admin url's to that web server   * Configure HyperDB to read/write against the Master only for wp-admin pages   * Setup MySQL Semisynchronous Replication      * http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html     * This solution will most likely not work, however, because semisynchronous replication will only wait until ONE slave has completed its writes, not both slaves in my case Let me know if you have any advice for this issue. Thanks, Dave


Errors when using CDN Sync Tool plugin

Now that wp-supercache has some built in support for CDNs, I've tried using the CDN Sync Tool to do an initial upload of files to Cloudfront. But, I'm getting 2 sets of errors when syncing (I'm having to use force upload, as for some reason CDN Sync Tool thinks all my files have been uploaded already).   1. cURL error: Failed to open/read local data from file/application (26) This error isn't actually preventing the files from being uploaded though   2. [function.fopen]: failed to open stream: Too many open files in /var/www/xxxxx/wp-content/plugins/cdn-sync-tool/lib/awssdk/lib/requestcore/requestcore.class.php This error does stop files from being uploaded -> S3. So, the 2nd error occurs after a certain (changeable) number of files have been uploaded, and then affects all remaining uploads. Any ideas why or what can be done? [Update] After updating to version 0.9, am now getting the following errors repeatedly (after about 2000 files have been synced) > Warning: fclose(): supplied argument is not a valid stream resource in > [filepath]/lib/awssdk/lib/requestcore/requestcore.class.php on line 276 > > The stream size for the streaming upload cannot be determined. done > > Syncing [2411/4732] img2343435.jpg > > Warning: fopen(/var/www/xx/wp-content/uploads/2010/12/mg2343435.jpg) > [function.fopen]: failed to open stream: No such file or directory in > [filepath]/lib/awssdk/lib/requestcore/requestcore.class.php on line 527


Plugins not activated after update?

I recently noticed that after manually updating any plugin it is left deactivated. Is this the correct operation? Or might there be a problem with my install? Thanks


Attach File Funcion for Common people

How can i allow my visitors that they can attach files like word text pdf with their comments or can allow attach file to register users is their any plugin or any other way for achieving this task ?


Display only author posts in dashboard all posts panel

I would like to display only authors own posts in dashboard all posts section. As of now it displays everything. I found some code here which is written by @t31os Its working correctly.               function posts_for_current_author($query) {         global $user_level;              if($query->is_admin && $user_level < 5) {             global $user_ID;             $query->set('author',  $user_ID);             unset($user_ID);         }         unset($user_level);              return $query;     }     add_filter('pre_get_posts', 'posts_for_current_author');      But user_level is deprecated. So can anyone modify the code for new version? Thanks


get_users meta_query

I can't get meta_queries working correctly on get_users(). For the life of me can't figure out what I'm doing wrong.                   $args = array(             'meta_query'   =>                      array(                     'relation' => 'AND',                      array(                     'key' => 'minbeds',                     'value' => $rooms,                     'compare' => "<=",                     'type' => 'numeric'                 ),                 array(                     'key' => 'maxbeds',                     'value' =>  $rooms,                     'compare' => "=>",                     'type' => 'numeric'                 )                array(                     'key' => 'minprice',                     'value' => $price,                     'compare' => "<=",                     'type' => 'numeric'                 ),                 array(                     'key' => 'maxprice',                     'value' => $price,                     'compare' => "=>",                     'type' => 'numeric'                 )              )         );              $users = get_users( $args );


Trigger renewal order emails for WooCommerce subscriptions for testing

I have a WooCommerce site to sell subscription products. I customized the emails and want to test them out in my email client. Currently I have created a test subscription that renews every day (24 hours). This means I need to wait 24 hours to test my renewal emails. How can I trigger these emails so that I can speed up my development and testing process?


Jetpack Infinite Scrolling For Multiple Columns On Same Page?

Enabling infinite scrolling is as simple as adding this snippet to the theme's functions.php file (where 'content' is the `id` of the container that wraps the posts):               add_theme_support( 'infinite-scroll', array(         'type' => 'scroll',         'container' => 'content',         'footer' => false,     ) );      But what should I do if my website has a multiple column layout where, for instance, one column shows the latest posts, and the other column lists the latest posts from a tag (highlights)? i.e. essentially there are two containers. I tried these two snippets (see below), and either way, infinite scrolling is only enabled for one column/container.               add_theme_support( 'infinite-scroll', array(         'type' => 'scroll',         'container' => 'content',         'footer' => false,     ) );          add_theme_support( 'infinite-scroll', array(         'type' => 'scroll',         'container' => 'highlights',         'footer' => false,     ) );      and               add_theme_support( 'infinite-scroll', array(         'type' => 'click',         'container' => array( 'content', 'highlights' ),         'footer' => false,     ) );      What am I doing wrong? **NOTE:** If the fact that installing Jetpack requires a wordpress.com account is holding you back, please try Slim Jetpack. It even works on a local install of WP, and doesn't require a wp.com account.


Including categories in search results

I am trying to include categories in search results. I've been searching for hours now with no solution. By "including categories" I don't mean search in a certain category, I mean let's say I have a bicycle store and have many companies included in the site; a user searched for `BMX mountain cross` for example. It will return the category BMX first (by clicking you'll be sent to the category page) and the posts related to the search term like WordPress normally does. Does anyone have any clues or could point me to the right direction?


How to get the Date Format and Time Format settings for use in my template?

This is a strange question, but I want to know how I can access the Date and Time settings               Admin > Settings > General > Date Format     Admin > Settings > General > Time Format      I am using the Any+Time jQuery plugin as a date/time selector for the editor view for a custom post type. It allows you to specify a date and time format ~~using the same settings WordPress does~~. **Edit: Turns out it doesn't use the same Date part tokens that WordPress does. Lame.** http://www.ama3.com/anytime/#AnyTime.Converter.format Ideally I want to do something like this...               <?php        $wpDateFormat = get_admin_settings('DateFormat');       // $wpDateFormat now holds something like "F j, Y"     ?>          <script>         $("#datetime").AnyTime_picker({           format: '<?php echo $wpDateFormat ?>'         );     </script>      What I don't know is... is there such a function like `get_admin_settings()` ?


How do I make a custom field choose an image?

I need a way to create a custom field that will let me pick an image from the media gallery. How do I do that? The custom field should have a button that when clicked will take me to the media gallery and place the src destination url within a input text box. looking for a plugin or online tutorial and I'm having little luck.


Allowing Two Developers Access to a Plugin on the WordPress.org Plugin Repository?

The question is " ** _How to Allow Two Developers Access to a Plugin on the WordPress.org Plugin Repository?_** " This question was asked on the wp- hackers list and _@EAMann_ answered it nicely and it's a great question to have here so I'm posting it for Eric to answer here.


Is it possible to define the data type of a Custom Field?

I am adding a new "Custom Post Type" named "Seminar". I am defining three custom fields   1. Location   2. StartTime   3. EndTime StartTime and EndTime are going to store dates (surprise, surprise). I am wondering if there's any way to tell WordPress to treat these like dates so that I can sort by them and stuff. I am very new to WP, so forgive me if this is a dumb question.


Loop for custom-post-type comparing taxonomy terms for "related" posts?

I have a custom-post-type named `my_projects` and a custom-taxonomy called `project_tags`. I want to write a function that is returning 5 posts of this post-type based on a given taxonomy term. So I want to call `<?php get_related_projects("Car"); ?>` and get 5 posts that also share the `tag` car returned. **This is my current attempt (that doesn't work)**               function get_related_projects( $term ) {         echo '
';              $args = array(             'post_type' => array('my_project'),             'order' => 'DSC',             'post_count' => 5,             'meta_key' => 'project_tags',             'meta_compare'   => $term,         );              $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();             global $post;             ?>

                     <?php if ( has_post_thumbnail()) : ?>                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >                         <?php the_post_thumbnail(); ?>                                              <?php endif; ?>

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

             <?php         endwhile;              wp_reset_postdata();         echo '
';     }      Since I'm not an expert when it comes to custom loops I wonder what I'm doing wrong here? Thank you for your help. **UPDATE:**               <?php if ( get_related_projects( "Car" ) ):  ?>             Related Projects             <?php get_related_projects("Car"); ?>     <?php endif; ?>


Walker gives additional taxonomy name?

I'm a beginner at Wordpress, so I would appreciate it if any of you could nudge me in the right way. Anyway, what irks me is how wp_list_categories (and similar functions) produce a lot of unnecessary classes and stuff I don't need. I tried creating my own walker class based on Walker_Category, and I seem to get it working. All I need as a class is that a "current" class appears when it is the current category, but when it is not, I don't want any classes at all to show up. However, for some reason I'm getting an additional class by my taxonomy name. I've looked over my walker class a gazillion times but can't seem to be seeing where it is indicated that the taxonomy name should be stored in $class. I also looked in the original Walker class, but haven't gotten much out of it. Please help? :)                class Meow_Walker extends Walker_Category {              var $tree_type = 'category';         var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');         function start_lvl( &$output, $depth = 0, $args = array() ) {             if ( 'list' != $args['style'] )                 return;                  $indent = str_repeat("\t", $depth);             $output .= "$indent
\n";         }         function end_lvl( &$output, $depth = 0, $args = array() ) {             if ( 'list' != $args['style'] )                 return;                  $indent = str_repeat("\t", $depth);             $output .= "$indent
\n";         }              function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {             extract($args);                  $cat_name = esc_attr( $category->name );             $cat_name = apply_filters( 'list_cats', $cat_name, $category );             $link = '';             $link .= $cat_name . '';                  if ( !empty($feed_image) || !empty($feed) ) {                 $link .= ' ';                      if ( empty($feed_image) )                     $link .= '(';                      $link .= 'term_id, $category->taxonomy, $feed_type ) ) . '"';                      $link .= '>';                      if ( empty($feed_image) )                     $link .= $name;                 else                     $link .= "';                      $link .= '';                      if ( empty($feed_image) )                     $link .= ')';             }                  if ( !empty($show_count) )                 $link .= ' (' . intval($category->count) . ')';                  if ( 'list' == $args['style'] ) {                 $output .= "\t
taxonomy );                     if ( $category->term_id == $current_category )                         $class .=  'current';                     elseif ( $category->term_id == $_current_category->parent )                         $class .=  'current-parent';                 }                 $output .=  ' class="' . $class . '"';                 $output .= ">$link\n";             } else {                 $output .= "\t$link
\n";             }         }              function end_el( &$output, $page, $depth = 0, $args = array() ) {             if ( 'list' != $args['style'] )                 return;                  $output .= "
\n";         }          }      **Edit:** I found a workaround, but I'd still like to know where $class gets its taxonomy name from...


Resizing thumbnails retrospectively

I have a Custom Post Type called `species` - fishkeeping species profiles. Each species profile can have as many media attachments as it needs, plus a separate `featured image`. I've dealt with this by storing it in the `postmeta` table under the key `attached_media` and it'll look something like this: `a:3:{i:0;i:10081;i:1;i:10082;i:2;i:10083;}`. This is an array of `post_ID`s of image files. This website is a redevelopment of an existing one and to pull the information across - including images - I've written a script which communicates with both old and new databases. **This has worked, to an extent**. The images are in place, but they're displaying at full size even when I've used the following code:               $size = "species-thumb";     wp_get_attachment_image( $attachment_id, $size, $icon, $attr );      The `species-thumb` size is set correctly as if you create a new species profile, any uploaded images are resized to the correct size. > If I create a new species profile, all of the image sizes are correct. > Having done my database import however, only the full size images appear. This is _presumably_ because WordPress hasn't created the new image sizes (200*x for `species-thumb`) for these images. I thought that I could simply run the AJAX Thumbnail Rebuild plugin, but it doesn't appear to work. The plugin works - it runs through all of the images (and displays each one on the screen), but then I can't find any images with names like `filename-200x78.jpg`. > **Q:** What's the best way to go about producing these images' thumbnails? > **It may be worth noting that there are over 4,000 images**. Thanks in advance,


link a custom page into menu

Ok i have a file which named,               page-allpost.php      now I have a menu item called "all post" and in that menu I want to call the page-allpost.php which will display all the post. how to do that? hope someone here could help, thanks.


How to create a custom url for a category

I took over a site that displays the category in the URL three different ways. For some categories it shows " **?category_name=blah** ". (Not ideal, but I can live with it) For newly created categories it show the " **?cat=####** " structure. (I don't want this) Yet for two categories displayed on the home page, it doesn't even show the word "category". It doesn't even show the category slug...it shows a completely different word. Specifically, the category is "first-column", but the URL shows "sitename.org/latestposts". The page title shows "first-column". The other category is "staff-blog" and the URL shows "staff-blog" as well. HOW DID THEY DO THIS? and How can I get the new categories to stop show the "?cat=####" format? I read all the notes about permalinks, and the htaccess file seems to be allowing me to make updates. I can't find any references to changing the category name in the php files. I'm over a week trying to figure this out on and off. The original guys won't respond to my emails, so I'm getting really frustrated. Any help is greatly appreciated!


Get post info inside modal window?

**What I'm Trying To Do** I have set up a custom post type for 'movies' and below is how I set up the template. Basically, I am trying to get `a.thickbox` (in the code below) to open a modal window with more info on the movie. Notice the addition of `&pid=<?php echo $post->ID; ?>` at the end of the `href`.               <?php get_header();?>

Our Movies

                      <?php                     $c=0;                     $i=1;                          $temp = $wp_query;                     $wp_query = null;                     $wp_query = new WP_Query();                     $wp_query->query('post_type=movies' . '&paged=' . $paged . '&posts_per_page=6');                          while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;                          $custom = get_post_custom($post->ID);                     $movie_info = $custom["movie_info"][0];                      ?>                      <li id="movie-<?php the_ID(); ?>">                      <?php if (!empty($movie_info)) { echo $movie_info ?>                      <a class="thickbox" href="<?php bloginfo('url'); ?>/movies-modal?KeepThis=true&TB_iframe=true&height=820&width=610&pid=<?php echo $post->ID; ?>">View more info
                      <?php                     endwhile;                     my_paginate_links();                     $wp_query = null;                     $wp_query = $temp;                     wp_reset_query();                 ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>      **My (Failed) Attempt** What I tried to do was create a separate template (below), create a page called "Movies Modal" in the dashboard, and attribute the template to the page. Then, I tried to grab the `POST ID` from the `a.thickbox` link from the template above (`&pid=<?php echo $post->ID; ?>`) so _only_ that post's info will show in the modal template below with this line: `$wp_query->query( 'post_type=movies&p=' . $_GET['pid']);`               <?php     /*     Template Name: Movies (Modal)     */     ?>          <?php get_header('thickbox'); ?>              <?php             $c=0;             $i=1;                  $temp = $wp_query;             $wp_query = null;             $wp_query = new WP_Query();             $wp_query->query( 'post_type=movies&p=' . $_GET['pid']);                  while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;                  $custom = get_post_custom($post->ID);             $movie_info = $custom["movie_info"][0];             $actor_bio = $custom["actor_bio"][0];             $actor_info = $custom["actor_info"][0];              ?>
              <?php if (!empty($movie_info)) { echo $movie_info ?>              <?php if (!empty($actor_bio)) { echo $actor_bio ?>              <?php if (!empty($actor_info)) { echo $actor_info ?>
              <?php             endwhile;              $wp_query = null;             $wp_query = $temp;             wp_reset_query();         ?>                     All this did, however, was bring up a modal window with the info for all posts and not _just_ the info for the post the link is in, like this: ![modal window](http://i.stack.imgur.com/iowtN.gif) I can't figure out how to get the info for _only_ the post I clicked on. Can someone please help me out or push me in the right direction? **Updates**               pid is not set\ngettype: NULLpid intval: 0Array     (         [post] => post         [page] => page         [attachment] => attachment         [revision] => revision         [nav_menu_item] => nav_menu_item         [product] => product         [product_variation] => product_variation         [shop_order] => shop_order         [shop_coupon] => shop_coupon         [wpcf7_contact_form] => wpcf7_contact_form         [movies] => movies         [psdtv] => psdtv     )     Wordpress version: 3.5      Changed this block:               <li id="movie-<?php the_ID(); ?>">         <?php if (!empty($movie_info)) { echo 'Summary: '. $movie_info .''; } ?>         <a class="thickbox" href="<?php bloginfo('url'); ?>/movies-modal/?KeepThis=true&TB_iframe=true&height=820&width=610&pid=<?php the_ID(); ?>">View more info


Use quicktags toolbar on any textarea

reading the quicktags.dev.js i see in the comments                * Run quicktags(settings) to initialize it, where settings is an object containing up to 3 properties:      * settings = {      *   id : 'my_id',          the HTML ID of the textarea, required      *   buttons: ''            Comma separated list of the names of the default buttons to show. Optional.      *                          Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close';      * }      *      * The settings can also be a string quicktags_id.      *      * quicktags_id string The ID of the textarea that will be the editor canvas      * buttons string Comma separated list of the default buttons names that will be shown in that instance.      which seems like i should be able to call the javascript functions quicktags(), pass it at least the ID of a text area and I should get the quicktags editor created just before any textarea. (i'm working in a metabox). however, if i put the following in my code:               try { quicktags( '_repeating_textareas_meta[repeating_textareas][0][textarea]'); } catch(e){}      which I essentially copied from bit of javascript that WP has it in the source and added my metabox's ID. it prints out the div where the quicktags toolbar _should_ be but doesn't make any buttons

       console.log doesn't show any errors. and i swear that this time i have undone all potential tampering to source code. **EDIT:** i've isolated the problem down to where the script appears in the source... using Fred Rocha's function works great (and much like i anticipated) if it runs on the admin_print_footer_scripts but not on after_wp_tiny_mce... it results in the same empty toolbar i was getting. other parts of my jquery plugin need to run after the tinymce settings are initialized (since i'm straight borrowing the existing settings), so why would it work properly on the one hook but not on a later hook?


Wordpress framework

It's not a question that can be answer wit a single BEST answer, but i like to know wich framework outthere could solve most of de problem of creating a site from PSD to html. What i am looking to is. HTML5, CSS3, jQuery, SEO build in, Drag and drop interface, Font replacement (cufont), microformat, responsive, mobile friendly, 960px wide, boilerplate. This list of next generation framework feature could be longer, but wich framework do you suggest me, that include the most of the request above... BTW, i code psd to wp theme from hand coding, or use headway.... both situation not perfect neither fast !. I have heard a lot of good thing about genesis... but never tried it ! -- As being said, it's not a clear question... here is what i like to know. What interface/addin you could install OVER wordpress basic installation to make it a nive platform to convert a PSD to a live site, with the lates technology like html5 and jquery.. that ca be view on mobile device without too much fuss


Echo Permalink in Attachment outside of loop?

I have some code showing an image attached to a post, an image in a li list, works fine shows the image as its should. I need the image to link through its main single post though and have tried the code below.               <?php                 $args = array(                    'post_type' =>  'attachment',                    'numberposts' =>  -1,                    'post_status' =>  null,                    'post_parent' =>  $post->ID                   );                        $attachments = get_posts( $args );                      if ( $attachments ) {                         foreach ( $attachments as $attachment ) {                            echo '
  <a href="<?php the_permalink() ?>" title="Permanent Link to<?php the_title_attribute(); ?>">';                            echo wp_get_attachment_image( $attachment->ID, 'full' );                            echo '
';                           }                      }     ?>      Unfortunately this doesn't print the permalink into the link. :( Any ideas can it be done? Thanks for looking.


WordPress dashboard is slooow. Front end is fast

Every aspect of my dashboard is slow--it can take 30-60 seconds to get a list of pages, or to updated a post. Yet, the front end is fast. I checked all the plugins--no problem there. I deactivated all the features of JetPack--no problem there. I tried different browsers--no problem there. I checked with my ISP and they confirmed there was no down time. This problem is ongoing. What makes WordPress dashboard slow and how do I fix it? Thanks


whats happening with my index page?

I'm working on my first wordpress blog site and I think I'm doing pretty good. This is my site so far but I need some help with a couple things as I'm not sure why this is happening. I've styled my blog the way I want to (with the clickable title and the dark red background for the "POSTED ON:" date stamp, however when I styled that, ALL my pages got that styling too (I only want that styling on the blog not).I want my pages to just look like regular pages. I understand CSS & HTML, and a SMALL bit of PHP but I'm not understanding why my index is picking up that styling. I do understand, through using firebug, that the styling class is the same as the blog posts but I don't want that. How do I change it is the only code on my index page is this...
             <?php while ( have_posts() ) : the_post(); ?>             <?php get_template_part( 'content', 'page' ); ?>             <?php endwhile; // end of the loop. ?>
      I don't understand where it's picking the styling up and which php page to change it on. If anyone can help me I'd appreciate it. @Brad Farleigh (or really anyone who can help me): I made a copy of the index.php page and called is page.php PAGE.PHP

 <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                   <?php if (have_posts()) : ?>                    <?php while (have_posts()) : the_post(); ?>                        <?php the_content(); ?>                    <?php endwhile; ?>          <?php endif; ?>
      A referenced page in the index page like this.
                               <?php while ( have_posts() ) : the_post(); ?>                          <?php get_template_part( 'page' ); ?>                               <?php endwhile; // end of the loop. ?>
      So my pages seem to be working the way I want them to. Calling the content and titles, however now when I got to my blog it's all messed up. Understandably content-page.php has to be called from somewhere but where? I very much appreciate the help.


Redirecting all old links from previous EE site to new WP site in one go?

I'm about to migrate from an old Expression Engine website to a new WordPress site on the same domain. Is there anything I should be aware of with respects to redirecting old links? The old site is quite well indexed in Search engines and linked to from other sites, but because the domain name is the same, I'm unsure of how to redirect all those old links in EE to the homepage of my new WP site without having to copy-paste all the existing individual URLs in .htaccess 301 redirects. Any ideas? Thanks, osu


Extending xml rpc - best practice

I need to add custom methods to the Xml-Rpc file and have found the following:                           // Custom plugins     add_filter('xmlrpc_methods', 'custom_xmlrpc_methods');                              function custom_xmlrpc_methods($methods)     {         $methods['myMethod'] = 'my_function';         return $methods;     }      ` Questions:   * Is it possible to have the callback function in another file and if yes then how do you do that in the code?    * If I have lots of custom methods what is the best approach to handling this? Thanks Michael


How can I get more out of `$post` in an `add_action` callback?

I have the following action callback set up:               function abc_save_post($post_id, $post)     {         // do stuff              echo '<pre>'.print_r($post,true).'</pre>';     }     add_action('save_post', 'abc_save_post', 10, 2);      The thing is that `$post` is a very trimmed down version of `$_POST` and is missing lots of data that I want to get at. How can I get more data into `$post`?


Is there a browser plugin or method to find which php template an item is coming from?


ajax - why multiple calls to wp_create_nonce() return same value?

I've some trouble getting nonces working with my ajax submit form. First of all i create a nonce and pass it to my registered script, i'll later send it to ajax-handler packed with my form fields:               wp_localize_script( 'roll_script', 'Roll', array(                         'postRollNonce' => wp_create_nonce('nonce-roll')));      In my ajax-response handler i verify the nonce, do my stuff and try to create a new nonce to send back to js, for later submit:                       function on_ajax_roll(){                 if (!wp_verify_nonce($_POST['postRollNonce'], 'nonce-roll' )) die ('No allowed!');     // nonce is valid! do some stuff...                      $r = array('postRollNonce' => wp_create_nonce('nonce-roll'));                            $response = json_encode($r);                 header( "Content-Type: application/json" );                 echo $response;                 die();         }      ...but, back to my js, the new nonce is exactly the same as the old one! Since nonce is supposed to change with time, why a second call to wp_create_nonce return the same string?


Custom Post Type Archives by Date (stored as meta value) WP3.1

I would like to implement date-based archive functionality (similar to original WP Archives widget functionality) for custom post type (CPT). What makes it difficult is the fact that I need to group and **archive events** not by published date, but **by`event_date` stored as a meta value**. For example, I have `event` CPT registered as following:               $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'has_archive' => 'past-events',         'rewrite' => array('slug' => 'event','with_front' => false),         'query_var' => true,         'capability_type' => 'post',         'hierarchical' => false,         'show_in_nav_menus' => false,         'menu_position' => 15,         'supports' => array(           'title',           'editor',           'author',           'revisions'                )       );       register_post_type('event',$args);      I would like to generate archive links like `/past-events/2011/04`, similar to the functionality of WP Archives widget. However, my events should be archived by the `event_date` meta value. Also, if, say for April 2011, there are more events than my `Blog pages show at most` setting, I would like to have a correct pagination for pages. And ideally, when viewing a single event I would have correct previous and next event links within that archive page. Hope that makes sense. I'm using WP3.1 I've gone as far as specifing `has_archive` setting for the CPT. I did look around, but got confused how to proceed. Is that something I have to write myself or it could be done with WP functions or plugins? Would really appreciate any help and tips. Many thanks, Dasha


meta box & callback function

### Situation I got a class where i add a meta box to the post edit screen. **EDIT:** This is the working version now               /**      * Calls the class on the post edit screen      */     function call_someClass()      {         return new someClass();     }     if ( is_admin() )         add_action( 'load-post.php', 'call_someClass' );          /**       * The Class      */     class someClass     {         public function __construct()         {             add_action( 'add_meta_boxes', array( &$this, 'add_meta_box' ) );         }              /**          * Adds the meta box container          */         public function add_meta_box( /* $args */ )         {             add_meta_box(                   'post_format_box'                 ,__( 'Post Format Content', self::LANG )                 ,array( &$this, 'render' )                 ,'post'                  ,'advanced'                 ,'high'             );         }                   /**          * Render Meta Box content          */         public function render( /* $args */ )          {             return '
TEST ME NOW
';         }     }      ### Problem The meta box is showing, and the meta box callback functions output get's rendered inside my meta box... but inside an error message. Seems that i'm too tired to get around this: **Error Message** (exact display as in the meta box) > Warning: call_user_func() expects parameter 1 to be a valid callback, > function ' TEST ME NOW ' not found or invalid function name in > R:\development\xampp\htdocs\wordpress\wp-admin\includes\template.php on line > 963


How can i get the last post from wp multisite?

I have to get the last post from my Multisite network on WordPress. For now I use this code for display the last updated post after a cycle on each `blog_id`:               <?php          $blogs = get_last_updated(' ', 0, 1);     foreach ($blogs AS $blog);         switch_to_blog($blog["blog_id"]);             $lastposts = get_posts('numberposts=1&orderby=date');             foreach($lastposts as $post) : setup_postdata($post);?>      But if I want to get the last post -- not the last post updated -- how can I do that? Because if I change and refresh a post I get the post like the last on main page. But this is not the real last post. **Update** \- This is the full version, i have also used the restore_current_blog():               <?php              $blogs = get_last_updated(' ', 0, 1);         foreach ($blogs AS $blog);             switch_to_blog($blog["blog_id"]);                 $lastposts = get_posts('numberposts=1&orderby=date');                 foreach($lastposts as $post) : setup_postdata($post);?>
          <a class="anteprima_princ" href="<?php echo get_page_link($post->ID); ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_post_thumbnail('immagine-principale'); ?>

<a href="<?php echo get_page_link($post->ID); ?>" title="<?php echo $post->post_title; ?>"><?php the_title(); ?>

<?php the_content_rss('...', FALSE, '', 40); ?>

<a class="lt" href="<?php echo get_page_link($post->ID); ?>" title="<?php echo $post->post_title; ?>">LEGGI TUTTO

                   <?php endforeach ; ?>                                  <?php restore_current_blog(); //switched back to main site ?>


Where to put code to get custom taxonomy term id?

Let me preface this by saying that I am new to Wordpress customization and don't know how to write code, but I can stumble through customizations involving simple copy/paste instructions. So, this question is _very_ basic. Sorry. I'm using a plugin that asks for the term id for the custom taxonomy that I've created. I have found some posts that explain how to do this and give little php snippets (e.g. http://wordpress.org/support/topic/how-to-echo-custom- taxonomy-id). But I really have no idea where to put this code. Could you please help? UPDATE: I do know how to create php files via copy/paste and upload to my server, basic stuff like that...


Allow spiders to crawl my site (selectable option in wp)

I was creating a site for testing and i selected an option when setting up wp that essentially disallows my site from being indexed/crawled. I would now like it to be crawled like normal, but i cant find the option within wordpress. I am running wp 3.5WP Thanks in advanced.


Create subdomains for tags and categories

I'd like to find a way to make subdomain addresses work for some of my important tags and categories. For instance foo.thesite.com would show content for thesite.com/category/foo. I've been trying to make this working using my .htaccess file and the DNS but I can't get it to work properly. Making the subdomain forward to the right URL is just a matter of the right DNS settings, but then I also want to make sure the site shows it as foo.thesite.com. Can anyone provide some ideas on how to make this work? **Update - April 6:** I found one partial solution. If you have full domain DNS control and you have the CURL DNS option you can add a subdomain and point it to the category or tag page. The catch is that when I did this, clicking links leaves the URL as foo.thesite.com, and the title somehow doesn't work-- instead of a title I get the URL as the page title. Any thoughts on this, alternatives, or ideas on how to format the .htaccess rules?


Disable WooCommerce action

I'm customizing a WooCommerce theme and am going to be moving the title. There is an action in `content-single-product.php` called `do_action( 'woocommerce_single_product_summary' );` in the `woocommerce_hooks.php` file the title action is `add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );` I can easily comment this out and place the title function where I need to. I'd prefer to disable the title using a function in my themes functions file so I don't have to worry about modifying core files. What would the function be to disable this title action? Thanks


How to select posts from multiple categories and metavalues?

I need to select posts who are in multiple categories and have certain post metavalue. I can select multiple categories with               query_posts( array( 'category__and' => array(1,2,3) ) );      But also I need from those selected categories, select only those posts who have certain meta_value from wp_postmeta table. This task I can do with sql query:               SELECT DISTINCT (     p.ID     ), p . *     FROM wp_posts AS p     INNER JOIN wp_postmeta AS p1 ON ( p.ID = p1.post_id )     CROSS JOIN wp_postmeta AS p3     USING ( post_id )     WHERE p3.meta_key = 'length'     AND convert( p3.meta_value, signed )     BETWEEN '".$min_length."'     AND '".$max_length."'     AND post_status = 'publish'     $subSelect     ORDER BY p.ID DESC      I don't understand how can I select for example only those posts who has category 1 AND 2 AND 3 AND postmeta meta_key length is BETWEEN $min_length AND $max_length?


What are the pros and cons of using a custom front-end to retrieve content from a Wordpress back-end

I've been building wordpress sites for a few years now and have noticed a few things that bother me. **1\. It's fairly slow** _(awful blanket statement, I apologize)_ My initial desire to create a custom front-end came from an observation. The Wordpress sites I was building weren’t quite as fast as I wanted them to be (3-5 seconds, sometimes longer). @Kenrik - They certainly were deployed on oversold shared-hosting, but they got good Yslow scores. I tried it out and found the sites to be approximately three times faster when I didn’t load the WP overhead. Same machine, same Yslow score, 3 times faster. I’m no expert on Wordpress CPU usage, but I’ve read that it’s pretty intense, so I was not surprised by the speed gains I achieved. **2\. It's often overly complex for the needs of a simple website** Just a note: I’m mostly building sites for fashion lines and portfolio management, complex in front-end interaction, but with relatively little data. These sites are never going to be huge and they require very little code to retrieve the necessary content. My question is therefore largely theoretical. I think that Wordpress is a fantastic platform and that it has few limits for growth, however I think that loading all of its resources is overkill for a lot of smaller projects, destined to be served from shared hosting. **3\. It has a lot of security issues (especially when using plugins)** Concerning security, I can see how my question was ambiguous and contradictory. What I meant is that from my understanding, a Wordpress site, beyond any actual security holes, is vulnerable because attackers know that it is a Wordpress site. This creates a challenge (to breach a popular platform) and an inherent cheat sheet (Wordpress vulnerabilities are well documented). So, sure a custom solution might have more actual security holes, but I’m wondering if it this wouldn’t be balanced by the fact that it makes the inner workings anonymous. As @Kenrik said, “they most likely wont even bother because who cares about hacking a single site with iffy custom code?” **4\. It's difficult to optimize page-load times** What I meant by the difficulty of page-load optimization is that if one achieves interactive functionality via lots of plugins, many scripts are loaded and it becomes more tedious to go back and combine, modify, customize or optimize them. I find it easier to include jQuery plugins outside of Wordpress and not have to deal with how they hook into wp_head. So recently I decided to go about my development differently and use Wordpress as only a back-end tool. I use the admin space to update content and populate the database but I use a custom data access layer and custom functions on the front-end to retrieve and display the content. For pages where login is needed, I include the blog-header file and use wordpress' credential management functionalities. As I see it, the pros of this independent front-end solution are that it makes development easier (you only write what you need, and it's all your own work), it's easier to optimize page-loads (you have better control over what scripts are used and how to combine them in optimal ways), you are not alerting the entire hacking world to the existence of a wordpress install (because the files aren't loaded from a theme anymore) and more. Potential Cons: Security, lack of scalability, lack of developer support for custom solutions... Anything else ? I really enjoy creating sites outside of the wordpress constraints, I'm just worried I might be overlooking some major issues with this approach. Please let me know if this is the case. Cheers To retroactively conclude: I’m 100% sure that my sites are faster in the exact same environment when I don’t use the native Wordpress front-end. I’m doubt that my code is as safe as Wordpress, but I think that I can lock it down and the fact that it has an anonymous front-end might make it less of a target. I’m sure that I can code functionalities a lot faster when I deploy an extremely simple custom front-end solution. So I’m just wondering, given my environment and my constraints whether doing this is still just a bad idea. And if so, what are the main reasons. I’m sure there are other curious, ambitious, under-educated coders out there who might be wondering the same thing. They will likely benefit from whatever you have to say about the subject. Thank you all


How do I create a sort capability by Title, Category, Author, Date?

How do I create a sort capability where User can Sort by Title, Category, Author, Date? I would like it to work almost identically to this site.


How can I automatically set a post slug based on the post title during post publish?

When you create a post in WP, if you don't specify a title rapidly, WP generates a default slug on autosave, based on the post ID. Then, when you add the title later, unless you modify the slug by editing it, it remains the same (based on post ID) What I'm trying to do is add an action on post publish, that generates and saves the post slug, based on the post title.


Hide content box with Custom Post Type?

Ive created a custom post type and I want to hide the main textarea content in the publish/edit page. Is it possible ? Thanks!


How to load plugin before the wordpress jquery?

I'm fixing a wordpress plugin that uses a 1.0.0 version of jquery. The jquery version automatically included in wordpress is 1.11.0. In a test site, the plugin is dependent on the 1.0.0 jquery and doesn't work on the latest version. However, it works on a test site because the plugin is loaded BEFORE the wp- includes/js/jquery/jquery.js and it uses it's own jquery library version before the script is overwritten by the latest jquery version. It doesn't produce any errors in the console. But in the production site, it loads all the plugins after the wp- includes/js/jquery/jquery.js So, how do I force the plugin to load, before wordpress loads the wp-includes/js/jquery/jquery.js file? This is the code in the plugin:               add_action('init', 'myplugin_init');          function myplugin_init() {     wp_enqueue_script('jquery.min', plugins_url(MYPLUGIN_FOLDER . '/js/jquery.min.js'), array(), '1.0.0', false);     wp_enqueue_script('highcharts', plugins_url(MYPLUGIN_FOLDER . '/js/highcharts.js'), array(), '1.0.0', false);     wp_enqueue_script('exporting', plugins_url(MYPLUGIN_FOLDER . '/js/exporting.js'), array(), '1.0.0', false);     }      I already tried, for testing purposes, to force the enqueue of plugin scripts right before `wp_head();` but it still loads the plugin files AFTER the wp- includes/js/jquery/jquery.js.               <?php         wp_enqueue_script('jquery.min', plugins_url(MYPLUGIN_FOLDER . '/js/jquery.min.js'), array(), '1.0.0', false);         wp_enqueue_script('highcharts', plugins_url(MYPLUGIN_FOLDER . '/js/highcharts.js'), array(), '1.0.0', false);         wp_enqueue_script('exporting', plugins_url(MYPLUGIN_FOLDER . '/js/exporting.js'), array(), '1.0.0', false);          wp_head();         ?>      Any help is much appreciated. Thanks.


PHP 5+ stream wrappers with the underlying WordPress File API?

I followed the gsoc project last year from Jon Stacey with great interest only to find out that this project was just the 'base' for a working solution. http://gsoc2010.wordpress.com/tag/stream-wrappers/ Sadly, it seems the project is not part of gsoc this year so the project is somewhat orphaned right now. Question: Is anyone aware of any completed php stream wrapper for wordpress?


Basic do shortcodes question

I used WordPress codex page to code. As you can see I have 2 PHP codes in my line. The page is able to get the code's value but it doesn't obey the CSS rules, which I believe, because I inserted my PHP codes in the wrong way. Can you take a look at the following code and suggest to what the problem might be?               <?php echo do_shortcode('[groups_non_member group="VPS"]' ."
"   . the_field('run_t') . "MIN | $". the_field('price_per_r') ."
". '[/groups_non_member]'); ?>


Multiple 404.php templates based on a post_type

Is it possible to have different 404 templates based on the post_type? So when `page` is not found `404.php` will be used, when `post` is not found `404-post.php` will be used. Or alternative, I would like just to display different message when blog post (`post_type=post`) is not found than when page is not found (`post_type=page`). Is there any hook I can use? Codex did not give me any usable hints on this.


does wordpress auto update work without a cron job?

I'm a bit on a loss here. Since WP 3.7 you can update your wordpress automatically. Since then it's more hit and miss on several servers here. I would like to understand, if it is enough to enable automatic updates described here and how this would work without a cron job. I'm under the impression right now, that the upgrade is only started, when ever someone logs into the backend, is this correct? If so, is there a way to automate the updates via a cron job?


Sidebar login widget with error print, returns an error

i'm building a widget to login from the sidebar and print errors if any, so everything is working fine except that when i login it returns an error:   Warning: Cannot modify header information - headers already sent..... the code of the widget:               <?php     // Custom Login/Meta Widget     function widget_artdev_meta() { ?>          <?php global $user_ID, $user_identity, $user_level ?>     <?php if ( $user_ID ) : ?>

Control Panel

Identified as <?php echo $user_identity ?>.
        <?php if ( $user_level >= 10 ) : ?>
<a href="<?php bloginfo('url') ?>/wp-admin">Dashboard
        <?php endif // $user_level >= 10 ?>             <?php if ( $user_level >= 1 ) : ?>
<a href="<?php bloginfo('url') ?>/wp-admin/post-new.php">Write an article
        <?php endif // $user_level >= 1 ?>
<a href="<?php bloginfo('url') ?>/profile">Profile & personal options

<a href="<?php echo wp_logout_url( $_SERVER['REQUEST_URI'] ); ?>" title="Exit">Exit

          <?php elseif ( get_option('users_can_register') ) : ?>          <?php     if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' ) :      global $error;      $login = wp_login( $_POST['log'], $_POST['pwd'] );      $login = wp_signon( array( 'user_login' => $_POST['log'], 'user_password' => $_POST['pwd'], 'remember' => $_POST['rememberme'] ), false );     endif;     ?>

Identification
           <?php if ( $error ) : ?>
        <?php echo $error; ?>
      <?php endif; ?>

       <form action="<?php the_permalink(); ?>" method="post">        Customer ID         <input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="22" class="input_text_login alignright" />                Password         <input type="password" name="pwd" id="pwd" size="22" class="input_text_login alignright" />                 <input type="submit" name="submit" value="Login" class="button" style="margin-right:35px; width:70px;" />         <input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me         <input type="hidden" name="action" value="log-in" />         <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>       </form>

<a href="<?php bloginfo('url') ?>/wp-login.php?action=lostpassword">Recover password

<a href="<?php bloginfo('url') ?>/register">Register

          <?php endif // get_option('users_can_register') ?>     <?php }     if ( function_exists('register_sidebar_widget') )     register_sidebar_widget(__('→ Login/Meta Widget','artdev'), 'widget_artdev_meta');     ?>      anyone out there can help? i can't understand where the problem is...! thanks a lot!   Philip


How to Create Dynamic Fields in a Meta Box?

Could someone explain me with a little example how create a button that creates a new custom field dynamically? I'm working on a plugin and using `add_meta_box`, I need an input box (administration-side) and a button that when clicked will create a new input box, after saving the previous data (on a custom database).


Can I create a loop with multiple post types and specify different $args for each post type?

I'd like to create a custom loop that includes all Post types: Post and Video. Then I'd like to specify to show all posts of the post type Video, but only show posts that are in the category "Videos." Here's what I'm thinking:               <?php         $args=array(             'post_type'=> array('video', 'post')                      if( get_post_type() == 'post' ) {                     'category_name' => 'videos'                      }               );         $video_post_query = new WP_Query($args);         ?>      I know it sounds strange but this is a work around because the custom post types are new and it's going to take time before I'm able to take all the old video posts and put them into the custom post type. **Even if I didn't have this issue I still think it would be useful to know how to define a multiple post type loop that specifies different parameters for each post type.**


get_post_meta() problem again

i asked this question previously, which solved my problem, but further i am having still problem with it, i have a function to display tweets of a user which fetch from a custom field, the custom field code is working perfect, cause when i `echo the get_post_meta` in my single.php i get the value which is input now the question is when i try to fetch the value from custom field to a twitter function the tweets are not coming, here is my code:               function tweet(){          $doc = new DOMDocument();          if ( $meta =get_post_meta($post->ID, 'dbt_Username', true) ) {      $feed = "http://twitter.com/statuses/user_timeline/$meta.rss";      $doc->load($feed);        $outer = "
";       $max_tweets = 5;                $i = 1;       foreach ($doc->getElementsByTagName('item') as $node) {         $tweet = $node->getElementsByTagName('title')->item(0)->nodeValue;                   $tweet = substr($tweet, stripos($tweet, ':') + 1);                      $tweet = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@',                '$1', $tweet);                   $tweet = preg_replace("/@([0-9a-zA-Z]+)/",                "@$1",                $tweet);              $outer .= "Twiter Updates by:".get_option('tweetID')."
". $tweet  . "
\n";                   if($i++ >= $max_tweets) break;       }        $outer .= "
\n";       return $outer;       }     }          add_action('admin_menu', 'tweet_fetch1');          function append_the_content1($content) {          $content .= "

".tweet(get_post_meta($post->ID, 'dbt_Username', true))."

";           return $content;           }     add_filter('the_content', 'append_the_content1');


Problems excluding a custom post-type from the loop

Morning all, I'm having some issues with excluding my custom post-type 'events' from my index.php loop for my Blog page. I simply want to display the posts from my actual Blog, which I assume come under the post-type 'post', but when I try to display the 'post' type it also shows my 'events' post-type. Here's my loop code:               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

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

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

Posted in <?php the_category(', '); ?>

                      <?php if (has_post_thumbnail( $post->ID )): ?>                         <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>                         <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/thumbs.php?src=<?php echo $image[0]; ?>&w=615&h=200&zc=1" alt="<?php the_title(); ?>" />                      <?php endif; ?>                                                  <?php the_excerpt(); ?>
            <?php endwhile;?>            <?php else : ?>                  <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
Not Found

                 <?php endif; ?>      I've also tried this, with no luck:               <?php $loop = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 5 ) ); ?>             <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

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

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

Posted in <?php the_category(', '); ?>

                      <?php if (has_post_thumbnail( $post->ID )): ?>                         <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>                         <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/thumbs.php?src=<?php echo $image[0]; ?>&w=615&h=200&zc=1" alt="<?php the_title(); ?>" />                      <?php endif; ?>                                                  <?php the_excerpt(); ?>
            <?php endwhile;?>      Thanks


List related terms + taxonomies

I have a set of main categories for a set of products. All these products has additional taxonomies associated with them. On a product category page, is there a way I can get all terms in use for that particular category? I believe it can be done by looping through all products, but that seems a bit convoluted…


Getting "Internal Server Error" when enabling 'Set expires header' in W3 Total Cache

As soon as I enable the option Performance --> Browser cache --> 'Set expires header' to true I get a 500 Internal Server Error. Then I have to SSH into the server and delete the new entries to make the site work again. I have googled a lot and it seems nobody has this problem. ANd yes I have already sudo a2enmod expires **Update:** Here is the log file, your help is appreciated, as I can't find anything on Google.               [Wed Jan 11 07:29:35 2012] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.11 with Suhosin-Patch mod_ssl/2.2.14 OpenSSL/0.9.8k configured -- resuming normal operations     [Wed Jan 11 07:29:38 2012] [alert] [client xxxxx] /var/www/xxx/wp-content/w3tc/min/.htaccess: ExpiresActive not allowed here     [Wed Jan 11 07:29:42 2012] [alert] [client xxxxx] /var/www/xxx/wp-content/w3tc/min/.htaccess: ExpiresActive not allowed here     [Wed Jan 11 07:33:36 2012] [alert] [client xxxxx] /var/www/xxx/.htaccess: ExpiresActive not allowed here, referer: https://www.xxx.com/wp-admin/admin.php?page=w3tc_browsercache     [Wed Jan 11 07:33:36 2012] [alert] [client xxxxx] /var/www/xxx/.htaccess: ExpiresActive not allowed here      Please help! Thanks


Create a Metabox that behaves Like a Taxonomy Box

I need to show all my custom articles on an archive page but grouped/sorted by subject. So that the result is somewhat like Subject A:   * A Sample Post    * Another Sample Post Subject B:   * List item A Post About Bacon and so on? I've read some related posts on here 17155 and 14306 and have come to the conclusion that this type of grouping must be done with post meta. However a simple metabox with a text input isn't as friendly as the checkboxes of the category metabox.... nor the tag box with its (choose from most popular tags option). So I am looking for advice, what is the best way to get the best of both worlds? I'd like to enforce selection into only 1 subject, but I'd like to be able to see what other subjects have already been used. Can I replace the category metabox so that it uses radio buttons instead of checkboxes and then save the category info as post meta on save? where to start?


How to centre menu items on horizontal nav bar? (e.g. make margins equal)

I'm currently working on building this site: http://2013.whitehallrow.com/ I would like to centre the menu items so that there isn't the large gap after "Row Club" on the right. I've tried to locate the section in style.css that deals with the menu, but I can't find it... how do I do this?


Shortcode content does not show in feed discription/excerpt

I have a shortcode for my content. This shortcode organizes a couple of things in my posts on the frontend. However, when I look at my feed, the content in the entirely leaves out any content from my shortcode and only starts after the shortcode content. When I take the content outside of my shortcode it shows up in the Why is my shortcode content not showing in the description of the feed? It worked great before I introduced the shortcode! I have found a similar issue here with no resolution: http://wordpress.org/support/topic/execute-shortcodes-in-feed-content **Update:** So I just read that shortcodes are being stripped by wordpress. How can I prevent this behaviour? I have also tried this without any luck: the_excerpt and shortcodes


Saving custom taxonomies to post as checkbox on frontend

I am trying to save custom taxonomies by choosing checkboxes. Normally if it is selectbox, there is no problem. But when I use checkboxes to choose terms it doesn't save. I am suspected that it is an array problem but I could not solve. I request your very kind help. Sorry my bad English. Thank you. Here is the part to add the post; `               // ADD THE FORM INPUT TO $new_post ARRAY     $new_post = array(     'post_title'        =>  $title,     'post_category'     =>  array($_POST['cat']),  // Usable for custom taxonomies too       'post_status'       =>  'publish',           // Choose: publish, preview, future, draft, etc.     'post_type'         =>  'post',  //'post',page' or use a custom post type if you want to     'tax_input'         =>  array( 'genre' => array($_POST['genre']) )  // support for custom taxonomies.        );      ` And This is saving the post, ` //SAVE THE POST $pid = wp_insert_post($new_post, $wperror); wp_set_post_terms($pid,array($_POST['genre']),'genre',true); ` The code below is for my custom taxonomy, genre will be something like music type. `               <?php     $genres = get_terms('genre', 'orderby=id&hide_empty=0');     $counter = 0;     foreach ($genres as $genre) {     $counter++;     $option = '<input type="checkbox" name="genre[]" id="'.$genre->name.'" value="'.$genre->name.'">';     $option .= '<label for="genre">'.$genre->name.'</label>';     echo $option;     }     ?>      `


my theme automatically adds new pages to menu

I have a theme that has a problem. When I add new page in it, it automatically adds two menu item of that page. Here is my code from functions.php               <?php          if ( function_exists('register_sidebar') )         register_sidebar(array(                 'name' => 'Left Sidebar',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));          if ( function_exists('register_sidebar') )         register_sidebar(array(                 'name' => 'Right Sidebar',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));                    if (function_exists('add_theme_support')) {         add_theme_support('menus');     }        // Enable support for post-thumbnails          add_theme_support('post-thumbnails');          if ( function_exists('add_theme_support') ) {         add_theme_support('post-thumbnails');     }          function my_function_admin_bar(){         return false;     }     add_filter( 'show_admin_bar' , 'my_function_admin_bar');     ?>     <?php     function new_excerpt_more($more) {            global $post;         return '...
ID) . '">Read More
';     }     add_filter('excerpt_more', 'new_excerpt_more');     function new_excerpt_length($length) {         return 65;     }     add_filter('excerpt_length', 'new_excerpt_length');     ?>     <?php     $themename = "my power theme";     $shortname = "mpt";     $options = array (         array( "name" => $themename." Options",                "type" => "title"),         array( "type" => "open"),         array( "name" => "Logo URL",                "desc" => "Enter the link to your logo image",                "id" => $shortname."_logo",                "type" => "text",                "std" => ""),         array( "name" => "Google Analytics Code",                "desc" => "Paste your Google Analytics or other tracking code in this box.",                "id" => $shortname."_ga_code",                "type" => "textarea",                "std" => ""),         array( "name" => "Feedburner URL",                "desc" => "Paste your Feedburner URL here to let readers see it in your website",                "id" => $shortname."_feedburner",                "type" => "text",                "std" => get_bloginfo('rss2_url')),         array( "name" => "Twitter ID",                "desc" => "Your Twitter username",                "id" => $shortname."_twitterid",                "type" => "text",                "std" => ""),         array( "name" => "Facebook Page",                "desc" => "Link to your Facebook page, with http://",                "id" => $shortname."_facebookid",                "type" => "text",                "std" => ""),              array( "type" => "close"));     function mytheme_add_admin() {          global $themename, $shortname, $options;          if ( $_GET['page'] == basename(__FILE__) ) {          if ( 'save' == $_REQUEST['action'] ) {          foreach ($options as $value) {     update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }          foreach ($options as $value) {     if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }          header("Location: themes.php?page=functions.php&saved=true");     die;          } else if( 'reset' == $_REQUEST['action'] ) {          foreach ($options as $value) {     delete_option( $value['id'] ); }          header("Location: themes.php?page=functions.php&reset=true");     die;          }     }          add_menu_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');          }     function mytheme_add_init() {       $file_dir=get_bloginfo('template_directory');       wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");       }           function mytheme_admin() {          global $themename, $shortname, $options;          if ( $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

';     if ( $_REQUEST['reset'] ) echo '

'.$themename.' settings reset.

';          ?>

<?php echo $themename; ?> Settings

This theme includes jQuery Nivo Slider. To work, you must create a new category with name Featured, and include your images in a custom field named as nivoimage.

I suggest that you include 490x280 images only.

Thumbnails are not automatically added in your post. You must use your images as "featured images" when you upload any image (this theme suppports WP thumbnails feature).
          <form method="post">          <?php foreach ($options as $value) {     switch ( $value['type'] ) {          case "open":     ?>
          <?php break;          case "close":     ?>

          <?php break;          case "title":     ?>

<?php echo $value['name']; ?>

          <?php break;          case 'text':     ?>
     <?php echo $value['name']; ?>	     <input style="width:400px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" />

     <?php echo $value['desc']; ?>

          <?php     break;          case 'textarea':     ?>
     <?php echo $value['name']; ?>	     <textarea name="<?php echo $value['id']; ?>" style="width:400px; height:200px;" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?></textarea>

     <?php echo $value['desc']; ?>

          <?php     break;          case 'select':     ?>
     <?php echo $value['name']; ?>	     <select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php foreach ($value['options'] as $option) { ?><option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?></select>

     <?php echo $value['desc']; ?>

          <?php     break;          case "checkbox":     ?>
     <?php echo $value['name']; ?>	     <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?>     <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />

     <?php echo $value['desc']; ?>

          <?php break;          }     }     ?>
     <input name="save" type="submit" value="Save changes" />     <input type="hidden" name="action" value="save" />
     </form>     <form method="post">
     <input name="reset" type="submit" value="Reset" />     <input type="hidden" name="action" value="reset" />
     </form>
     <?php     }add_action('admin_menu', 'mytheme_add_admin');     add_action('admin_init', 'mytheme_add_init');     ?>     <?php     /***** Numbered Page Navigation (Pagination) Code.           Tested up to WordPress version 3.1.2 *****/          /* Function that Rounds To The Nearest Value.        Needed for the pagenavi() function */     function round_num($num, $to_nearest) {        /*Round fractions down (http://php.net/manual/en/function.floor.php)*/        return floor($num/$to_nearest)*$to_nearest;     }          /* Function that performs a Boxed Style Numbered Pagination (also called Page Navigation).        Function is largely based on Version 2.4 of the WP-PageNavi plugin */     function pagenavi($before = '', $after = '') {         global $wpdb, $wp_query;         $pagenavi_options = array();         $pagenavi_options['pages_text'] = ('Page %CURRENT_PAGE% of %TOTAL_PAGES%:');         $pagenavi_options['current_text'] = '%PAGE_NUMBER%';         $pagenavi_options['page_text'] = '%PAGE_NUMBER%';         $pagenavi_options['first_text'] = ('First');         $pagenavi_options['last_text'] = ('Last');         $pagenavi_options['next_text'] = 'Next »';         $pagenavi_options['prev_text'] = '« Previous';         $pagenavi_options['dotright_text'] = '...';         $pagenavi_options['dotleft_text'] = '...';         $pagenavi_options['num_pages'] = 5; //continuous block of page numbers         $pagenavi_options['always_show'] = 0;         $pagenavi_options['num_larger_page_numbers'] = 0;         $pagenavi_options['larger_page_numbers_multiple'] = 5;              //If NOT a single Post is being displayed         /*http://codex.wordpress.org/Function_Reference/is_single)*/         if (!is_single()) {             $request = $wp_query->request;             //intval � Get the integer value of a variable             /*http://php.net/manual/en/function.intval.php*/             $posts_per_page = intval(get_query_var('posts_per_page'));             //Retrieve variable in the WP_Query class.             /*http://codex.wordpress.org/Function_Reference/get_query_var*/             $paged = intval(get_query_var('paged'));             $numposts = $wp_query->found_posts;             $max_page = $wp_query->max_num_pages;                  //empty � Determine whether a variable is empty             /*http://php.net/manual/en/function.empty.php*/             if(empty($paged) || $paged == 0) {                 $paged = 1;             }                  $pages_to_show = intval($pagenavi_options['num_pages']);             $larger_page_to_show = intval($pagenavi_options['num_larger_page_numbers']);             $larger_page_multiple = intval($pagenavi_options['larger_page_numbers_multiple']);             $pages_to_show_minus_1 = $pages_to_show - 1;             $half_page_start = floor($pages_to_show_minus_1/2);             //ceil � Round fractions up (http://us2.php.net/manual/en/function.ceil.php)             $half_page_end = ceil($pages_to_show_minus_1/2);             $start_page = $paged - $half_page_start;                  if($start_page <= 0) {                 $start_page = 1;             }                  $end_page = $paged + $half_page_end;             if(($end_page - $start_page) != $pages_to_show_minus_1) {                 $end_page = $start_page + $pages_to_show_minus_1;             }             if($end_page > $max_page) {                 $start_page = $max_page - $pages_to_show_minus_1;                 $end_page = $max_page;             }             if($start_page <= 0) {                 $start_page = 1;             }                  $larger_per_page = $larger_page_to_show*$larger_page_multiple;             //round_num() custom function - Rounds To The Nearest Value.             $larger_start_page_start = (round_num($start_page, 10) + $larger_page_multiple) - $larger_per_page;             $larger_start_page_end = round_num($start_page, 10) + $larger_page_multiple;             $larger_end_page_start = round_num($end_page, 10) + $larger_page_multiple;             $larger_end_page_end = round_num($end_page, 10) + ($larger_per_page);                  if($larger_start_page_end - $larger_page_multiple == $start_page) {                 $larger_start_page_start = $larger_start_page_start - $larger_page_multiple;                 $larger_start_page_end = $larger_start_page_end - $larger_page_multiple;             }             if($larger_start_page_start <= 0) {                 $larger_start_page_start = $larger_page_multiple;             }             if($larger_start_page_end > $max_page) {                 $larger_start_page_end = $max_page;             }             if($larger_end_page_end > $max_page) {                 $larger_end_page_end = $max_page;             }             if($max_page > 1 || intval($pagenavi_options['always_show']) == 1) {                 /*http://php.net/manual/en/function.str-replace.php */                 /*number_format_i18n(): Converts integer number to format based on locale (wp-includes/functions.php*/                 $pages_text = str_replace("%CURRENT_PAGE%", number_format_i18n($paged), $pagenavi_options['pages_text']);                 $pages_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pages_text);                 echo $before.'
'."\n";                      if(!empty($pages_text)) {                     echo ''.$pages_text.'';                 }                 //Displays a link to the previous post which exists in chronological order from the current post.                 /*http://codex.wordpress.org/Function_Reference/previous_post_link*/                 previous_posts_link($pagenavi_options['prev_text']);                      if ($start_page >= 2 && $pages_to_show < $max_page) {                     $first_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['first_text']);                     //esc_url(): Encodes < > & " ' (less than, greater than, ampersand, double quote, single quote).                     /*http://codex.wordpress.org/Data_Validation*/                     //get_pagenum_link():(wp-includes/link-template.php)-Retrieve get links for page numbers.                     echo '1';                     if(!empty($pagenavi_options['dotleft_text'])) {                         echo ''.$pagenavi_options['dotleft_text'].'';                     }                 }                      if($larger_page_to_show > 0 && $larger_start_page_start > 0 && $larger_start_page_end <= $max_page) {                     for($i = $larger_start_page_start; $i < $larger_start_page_end; $i+=$larger_page_multiple) {                         $page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);                         echo ''.$page_text.'';                     }                 }                      for($i = $start_page; $i  <= $end_page; $i++) {                     if($i == $paged) {                         $current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']);                         echo ''.$current_page_text.'';                     } else {                         $page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);                         echo ''.$page_text.'';                     }                 }                      if ($end_page < $max_page) {                     if(!empty($pagenavi_options['dotright_text'])) {                         echo ''.$pagenavi_options['dotright_text'].'';                     }                     $last_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['last_text']);                     echo ''.$max_page.'';                 }                 next_posts_link($pagenavi_options['next_text'], $max_page);                      if($larger_page_to_show > 0 && $larger_end_page_start < $max_page) {                     for($i = $larger_end_page_start; $i <= $larger_end_page_end; $i+=$larger_page_multiple) {                         $page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);                         echo ''.$page_text.'';                     }                 }                 echo '
'.$after."\n";             }         }     }     add_action( 'init', 'register_my_menus' );          function register_my_menus() {     register_nav_menus(     array(     'menu-1' => __( 'Menu 1' ),     'menu-2' => __( 'Menu 2' )     )     );     }          if ( function_exists( 'add_image_size' ) ) {         add_image_size( 'relatedPost', 120, 180, true );     }          if ( function_exists( 'add_image_size' ) ) {         add_image_size( 'sliderimg', 53, 80, true );     }     ?>      Please help me how can I rectify this problem. Thanks


Use shortcodes in terms description?

Anyone knows a way of using shortcodes on terms description? This is possible?


How can I remove the image attachment ALT field?

I've been using the technique described in this post to remove the caption and description fields in the uploads modal window, thus eliminating unused clutter for users. Since the title field is already required when uploading images in WordPress, it's easiest for my users to dispense with the alt field altogether and just pull the alt text from the title field when displaying images on a website. From what I'm seeing in the media.php file, I should be able to unset the alt field by adding this to my function: `unset($form_fields['image_alt']);`, but it's not working. Any suggestions as to what I might be doing wrong?


including Zend Gdata library path error

I'm trying to include the Zend Gdata module into a plugin, but this error appears on plugin activation: include_once(Zend\Gdata\YouTube.php) [function.include-once]: failed to open stream: No such file or directory in \Zend\Loader.php on line 146 any help appreciated, thanks I have the main plugin file in the root and then a Zend subfolder which contains the module. This was just copied from the demo app which works fine on the same XAMPP installation, so it's something to do with how WordPress includes files?               /**     * @see Zend_Loader     */     require_once 'Zend/Loader.php';          /**     * @see Zend_Gdata_YouTube     */     Zend_Loader::loadClass('Zend_Gdata_YouTube');


How to include code only on specific pages?

I'm learning about plugins and shortcodes. I noticed that when I activate my plugin its code gets loaded on all of my pages-- even pages that don't have my shortcode. (I don't mean content vs. admin pages). On some content pages, I use a particular shortcode and on other content pages, I don't-- but in any case, the plugin's code is loaded. How do I make it so that the the plugin is included only on pages where the shortcode is used? More Detail: Let's say I've got a plugin that makes a lightbox. I activate the plugin. On my "Cool Images" page, I use shortcode to make a lightbox. When I check View Source on my "About" page, which doesn't use the lightbox shortcode, I see that the lightbox plugin's code has been loaded. My pages will load faster if I write my plugin so that its code is only loaded on the pages where it's needed. Is this possible? Otherwise, I'll have code for lots of plugins loaded on pages unnecessarily. Any ideas?


Is it appropriate to remove custom posts and terms on plugin uninstall?

This is more of a "best practices" than a question, but I was wondering, what to people typically remove when their plugin is removed? I have a plugin that does the following:   * registers custom post types    * registers custom taxonomies    * uses custom options Right now my plugin removes all of the custom options as they are installed by the plugin and used mostly internally. Since the posts for the custom post type and terms for the custom taxonomy are added by the user, would be be appropriate to remove these?


Remove inline styles from the_content?

Is there a way to remove any inline styles made by the WP Editor i.e. Font Size?


Multiple WP install with same users database

I am creating a e-commerce website. I am using woocommerce with some cool extensions I bought. I need to make 2 websites, but store the users database (purchases, subscription purchases, etc) as well as products in a single database. The rest of the content should be different (pages, posts etc) so the administrator can see purchases from site1 and site2 while logging in to the one site. Is this possible? Sorry for my bad english.


Need help with Custom Post Types and Taxonomies


jQuery Hoverintent plugin in TwentyEleven Menu

The default menu in the TwentyEleven theme is quite nice, pure CSS, but unfortunately, way too responsive and quick. It would be so nice to have it respond the same exact way with which the admin bar menu responds, that is instant drop-downs, but with a bit of delay on mouse out to let the visitor come back to the menu should his cursor slide out of the menu. What would be the most efficient way to implement the HoverIntent jQuery Plugin into the default TwentyEleven menu? Thanks Pat


Display meta data from a custom field within plugin Category Grid View Gallery

I am using this plugin, which creates a gallery of posts, fetching a thumbnail and the titles of the posts displayed in it. I have enabled Custom Fields, and have created (and filled in values) a field for the posts I want displayed in the gallery. I know that I have to put `<?php the_meta(); ?>` within the loop for the meta data from the fields to show, which I have done and it works. Now what I am wondering is: Can I somehow show the meta data from the fields within the plugin? Specifically, beneath (or instead of) the post title which the plugin already fetches and displays?


How to detect and display a page only for IE?

I have a theme that does not work in IE so I would like to be able to detect the browser and redirect to a "sorry this doesn't work for your browser" type or what ever solution you guys can suggest for this. Any ideas on the best way to go about this?