How can i create a tag with the template's name like below, and what is the purpose of using them?

I saw these in a lot of WordPress themes, what are they used for and how can I create my own? I mean for example the "twentythirteen" tag at the end, what contains the actual theme's name.               get_comments_number(), 'comments title', 'twentythirteen'     edit_post_link( __( 'Edit', 'twentythirteen' )


Can't Access Sessions or Variables through pages

So I'm trying to use a session to move a variable through pages. For some reason I literally cannot access anything from index.php to archive. I declare my session at the very top of my header.php like:               <?php         if(!isset($_SESSION))         {             $_SESSION['catID'] = 3;         }     ?>      Then I move to the archive.php which pulls in the header via `<?php get_header() ?>` and my session is suddenly gone. I try to echo it out and get nothing. Same thing happens with normal variables - like it's out of scope. Anybody else have a similar problem or a solution?


How to spam-filter a custom content type with the Akismet plugin?

I have several inputboxes and no textareas in my custom content type. Can I use Akismet that comes with WP for that? If I can, how to do that? E.g. If I have 5 inputboxes like: name, address, city, telephone, email in my form that is saved from the front page and is used for further processing. How to use Akismet on that? Is it possible? if the names of the inputbosex are: name, address, city, telephone and emai, how would you set up the Akismet plugin. What should be done so no spams are saved in my db? (I need to filter the data before being saved to data using akismet in my function in functions.php. So if I get the values like e.g.               $name = $_POST['name'];     $name = $_POST['address'];     $name = $_POST['city'];     $name = $_POST['telephone'];     $name = $_POST['email'];          // here I need if condition to use akismet database to redirect back to the post without executing the rest of my code in my function.      How to do such condition using the Akismet plugin that comes with Wordpress?


Can't install new plugins because of the error "Could not create directory"

A faculty member is having difficulties with a instructional wordpress install. Fixing individual permission problems has been hit and miss, and have become a perennial pain, so I'll ask here. What can I do to make WP Just Work? The kinds of errors they get: > Installing Plugin: Lightbox 2 2.9.2 Downloading install package from > http://downloads.wordpress.org/plugin/lightbox-2.2.9.2.zip… Unpacking the > package… Could not create directory. /home/CIM140/public_html/wordpress/wp- > content/upgrade/lightbox-2.tmp When I su as www-data (the user apache runs as in Ubuntu), I can make that directory just fine. My test wp instance installs this plugin just fine, so I'm at a loss as to why it fails for them.


WP Customer Reviews - Doesn't process form submission on home page?

I've scoured the internet for hours and cannot find any way to accomplish this. Am I missing something obvious or simple? I have installed the WP Customer Reviews plugin on the latest wordpress. It seems to work fine on every page but the home page. The one I'm using is the home.php one, not a custom page chosen in the wordpress admin for the home page. It displays fine, and shows the button, but when I fill it out and submit it, the page refreshes and the form becomes blank and nothing happened at all - no customer review was added. I've tried using the shortcodes listed in the config page in various ways, I've tried adding it right into the home.php with do_shortcode();. I've gone so far as to try adding a post_meta table row in my wordpress database using wpcr_enable set to 1 for the post id of 0 (if I go to [myurl.com]/?p=0 I get the home page), but that didn't work. Any help will be very appreciated. Thanks for your time!


Echo Category Nicename

I am trying to echo the category nicename to reference a category image stored in my images folder in another folder called categories. I am using this code:               $category = get_the_category();     echo 'category_nicename.'.png">';      But all it returns is this:                     What I want is:                     I haven't been able to figure out what is wrong with my code. Can I get some help please? Thanks!


Can I lock a post in position, so it always appears on the homepage?

I'm a complete noob when it comes to Wordpress, but I've joined a company who use it as their website and they need an answer quickly. I want to know if I can I lock a post in position, so it always appears on the homepage ? I don't want to use a plug-in (preferably) Any suggestions or advice is greatly appreciated. Thanks


How to create a page that isn't accessible via menus?

I need to create a page in my site that I am able to access via url, but that won't be included in any of the navigation menus which are generated using `wp_list_pages()` on my site. How can I accomplish this?


Why does akismet prevent jetpack comments from appearing in my moderation queue?

On the blog I run, when I have Akismet activated, it somehow prevents comments posted via Jetpack from appearing in the moderation queue. I know it's Akismet because I have disabled every plugin but jetpack and received comments in the moderation queue successfully. When I have both jetpack and aksimet activated simultaneously, however, the comments do not appear in my moderation queue.


What is this instance variable doing in the Widgets class

The lack of documentation for the WP_Widget class is driving me mad. Here is what I have salvaged off the codex:                   public function form($instance){             ?>                  <label for="<?php echo $this->get_field_id('title'); ?>">Title:              <input type="text" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" id="<?php echo $this->get_field_id('title'); ?>" />             </label>                  <?php         }      What is this `$instance` variable? The docs say it is `The settings for the particular instance of the widget`. But then why isnt it just another property of `$this`. Why does `$this->get_field_name('title')` seem to know something about a title and suddenly when we want the goddamn title I have to start going into this `instance` variable. What am I missing here. Can you explain me where the `$title` is held, what the hell the `$instance` is different from `$this` and why we are using the title to get the field name? Thanks loads!


Slick Social Share Buttons plug-ins with Responsive theme - number of tweets link problem

I've just installed latest version of Slick Social Share Buttons on top of Responsive theme. In the settings page in Twitter Username I provided my twitter username. The number of the times the link was hared shows fine in the widget, but if I click on the link, I'm taken to URL `https://twitter.com/search/realtime?q=http%3A%2F%2Fwww.mysiteurl.com`, which it not found. I assume the proper url it needs to take me to should be something like `https://twitter.com/search/realtime?q=MyTwitterUsername` Am I missing something or its something wrong with plugins ? ![enter image description here](http://i.stack.imgur.com/jAKJT.png) **Clicking on number 1 takes me to page :** ![enter image description here](http://i.stack.imgur.com/2wzsQ.png) ![enter image description here](http://i.stack.imgur.com/L2Zjd.png)


Copy post to separate database with "add_action(....)"

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure how to reference the actual post that's being published.               function run_when_post_published($post_ID)     {         echo "Hellooooo? Steve?";         echo "<br /> POST ID: " . $post_ID; // Won't even display "POST ID" with $post_ID in the string.         $con = new wpdb("password", "_________admin", "_______wp", "_______.com");         if (!$con)         {             die('Could not connect: ' . mysql_error());         }              mysql_select_db("wp", $con);              $result = mysql_query("INSERT INTO ________wp.featured_posts (post_domain, post_author, post_title, post_content)     VALUES ('3', '2', 'Sent from hook','Hello')");              mysql_close($con);     }          add_action('new_to_publish_featured', 'run_when_post_published');            add_action('draft_to_publish_featured', 'run_when_post_published');          add_action('pending_to_publish_featured', 'run_when_post_published');          add_action('new_to_publish', 'run_when_post_published');             add_action('draft_to_publish', 'run_when_post_published');           add_action('pending_to_publish', 'run_when_post_published');      I'd like to have the whole post just basically copied. Also I'd need to do this with attachments using:               add_action('add_attachment',....);      Again I've gotten the add_attachment action hook to add a row in the database, but I just don't know how to reference the attachment that the hook is being initiated from.


AJAX hash change problem

I am using **All AJAX** theme by Cheris Coyier. But I want to change the URL. Current URL `http://localhost/wordpress/#/wordpress/sample-page/` and I want to replace `#/wordpress/sample-page/..`. My code for AJAX query (actually written by Coyier). I need help here:               $(function() {          $("#s").focus(function() {         if ($(this).val() == "Search...") {             $(this).val("");         }     });          if ($(".widget_categories li").length%2 != 0) {         $(".widget_categories ul").append("

");     }          if ($(".widget_tag_cloud a").length%2 != 0) {         $(".widget_tag_cloud").append(" ");     }          $(".home li.home").removeClass("home").addClass("current_page_item");     $("#column-wrap").append("");          var $mainContent = $("#main-content"),         URL = '',         siteURL = "http://" + top.location.host.toString(),         $internalLinks = $("a[href^='"+siteURL+"']"),         hash = window.location.hash,         $ajaxSpinner = $("#ajax-loader"),         $el, $allLinks = $("a");          function hashizeLinks() {         $("a[href^='"+siteURL+"']").each(function() {             $el = $(this);                  // Hack for IE, which seemed to apply the hash tag to the link weird             if ($.browser.msie) {                 $el.attr("href", "#/" + this.pathname)                 .attr("rel", "internal");             } else {                 $el.attr("href", "#" + this.pathname)                  .attr("rel", "internal");             }         });     };          hashizeLinks();            $("a[rel='internal']").live("click", function() {         $ajaxSpinner.fadeIn();         $mainContent.animate({ opacity: "0.1" });         $el = $(this);         $(".current_page_item").removeClass("current_page_item");         $allLinks.removeClass("current_link");         URL = $el.attr("href").substring(1);         URL = URL + " #inside";         $mainContent.load(URL, function() {             $el.addClass("current_link").parent().addClass("current_page_item");             $ajaxSpinner.fadeOut();             $mainContent.animate({ opacity: "1" });             hashizeLinks();            });     });          $("#searchform").submit(function(e) {         $ajaxSpinner.fadeIn();         $mainContent.animate({ opacity: "0.1" });         $el = $(this);         $(".current_page_item").removeClass("current_page_item");         $allLinks.removeClass("current_link");         URL = "/?s=" + $("#s").val() + " #inside";         $mainContent.load(URL, function() {             $ajaxSpinner.fadeOut();             $mainContent.animate({ opacity: "1" });             hashizeLinks();            });         e.preventDefault();     });          if ((hash) && (hash != "#/")) {         $("a[href*='"+hash+"']").trigger("click");     }          });


Where do you add code in custom fuctions so it works on a specific page?

Thanks for replying but I still can't get it to work. Is anything wrong with this code?                  <?php          class custom_loop extends thesis_custom_loop {     function page() {     if(is_page( array('career-work','happiness'))) {           global $thesis_design;     $thesis_design->home['body']['content']['features'] = 0;     $thesis_design->display['archives']['style'] = 'teasers';     $thesis_design->image['thumb']['y'] = 'after-headline';     $thesis_design->teasers['options']['date']['show'] = 0;     $thesis_design->teasers['options']['excerpt']['show'] = 1;           global $wp_query;         $saved_query = $wp_query;         thesis_loop::page();         wp_reset_query();         $args = array('category_in' => array(59,'62));         $loop = query_posts("cat=59,62");         thesis_loop::home();         wp_reset_query();         $wp_query = $saved_query;     } else         thesis_loop::page();     }     }     $custom_loop = new custom_loop();      The code above is to show teasers on a specific page. It obviously works for one page but where do I add this code, or what do I change it to, in order for it to work for any page I specify? I've tried creating a new PHP file in my theme and copying and pasting the code (changing the category ID etc) but it won't work. Thanks


Can I query posts by taxonomy conditionally based on post type?

I have a query based on multiple post_types and taxonomies that works well, however I would like to add a level of complexity and query a taxonomy only for a specific taxonomy. This query works as expected:               Array     (         [topic] => global-reach         [sections] => programs-and-services         [regions] => ghana         [post_type] => Array             (                 [0] => publications                 [1] => media_releases                 [2] => page             )         [posts_per_page] => 10     )      Now I would like to select only the 'pages' that have the taxonomy 'options' set to 'set-as-news-item' ... here is a somewhat unlogical pseudo query of what I would like to accomplish, but it should get the idea across.               Array     (         [topic] => global-reach         [sections] => programs-and-services         [regions] => ghana         [post_type] => Array             (                 [0] => aucc_publication                 [1] => aucc_media                 [2] => Array                           (                            [post_type] => 'page',                            [options] => 'set-as-news-item'                          (             )         [posts_per_page] => 10     )      I could use the first query above and filter out unwanted posts as I loop them, but then I could not use Wordpress' built-in pagination. I'm asking for too much out of WP_Query right?


Gravity forms how to display list of submitters on the post submitted page

* I am wondering if this could be done, we have thousands of restaurants on the wordpress site as a blog posts and one small request quote form on the bottom of every restaurant post page where job applicants asks for the job, they fill in the personal info about them and they send it to the author of the post and to the administrator via confirmation emails.    * For that purpose I have created job applicant's custom post type = portfolio and all submissions is also displayed on those portfolio CPT pages,    * After succesfull submission every job applicant's name is a title of every custom post type portfolio something like   URL: http://www.mywebsite.com/portfolio/petra-newman/ Title: Petra Newman   * I would like to display those names = titles of the custom post   types portfolio on those restaurants post pages where the form was submitted,   * **Purpose:** Other applicants can see how every virtual restaurant is   requested.   * I was thinking to create custom post field for every restaurant and   there store those submitters, so   * **Question is:** How can I tell to gravity form to store job applicants names = submitted form titles in those custom fields? Does exist any other option? How can I create list of submitters on every submitted post page?   * **Conclusion:** On every restaurant page where the form were submitted should be a list of applicant's names with links to every applicant portfolio.


Custom post type taxonomies URL rewrite

What I want to achieve is an online listing catalog with a URL like this:               www.example.com/drawing-tools/brand/type/material/color/      In this example, I have a custom post type named "drawing-tools" with 4 custom taxonomies for it: "brand", "type", "material", "color" When a user access a URL like:               www.example.com/drawing-tools/rotring/mechanical-pencil/plastic/black/      it gets all the items that match those criteria. The tricky part is that all of the taxonomies are required to be in a URL. So something like this:               www.example.com/drawing-tools/plastic/black/      would simply return an 404 error page. So my main question is: How exactly can I have all of the taxonomies in the URL in that form and return an 404 error page if one taxonomy is missing? I was thinking to write a rewrite rule that would take those uri segments and pass them as arguments to a query based on the 'Query Multiple Taxonomies' plugin and return that 404 error if one segment is missing. But I don't know how to accomplish this. Is there any solutions that you can give me? **[Update 1]** The rewrite rule would basically take this URL:               www.example.com/drawing-tools/rotring/mechanical-pencil/plastic/black/      and make it into:               www.example.com/?drawing-tools_name=rotring+mechanical-pencil+plastic+black      The above structure is required by the 'Query Multiple Taxonomies' plugin. **[Update 2]** I've given up to the Query Multiple Taxonomies plugin and instead I've switched to WP 3.1. Now, with the help from this previous question I've managed to get to work those taxonomies like I wanted. Here is the full code:               register_post_type('drawing-tools', array(         'labels' => array(                 'name' => __( 'Drawing Tools' ),                 'singular_name' => __( 'Drawing Tool' ),                 'add_new' => __( 'Add New' ),                 'add_new_item' => __( 'Add New Drawing Tool' ),                 'edit' => __( 'Edit' ),                 'edit_item' => __( 'Edit Drawing Tool' ),                 'new_item' => __( 'New Drawing Tool' ),                 'view' => __( 'View Drawing Tools' ),                 'view_item' => __( 'View Drawing Tool' ),                 'search_items' => __( 'Search Drawing Tools' ),                 'not_found' => __( 'No items found' ),                 'not_found_in_trash' => __( 'No items found in trash' ),                 'parent' => __( 'Parent Drawing Tool' ),                 ),         'public' => true,         'publicly_queryable' => false,         'show_in_nav_menus' => false,         'exclude_from_search' => false,         'show_ui' => true,         '_builtin' => false,         '_edit_link' => 'post.php?post=%d',         'capability_type' => 'post',         'hierarchical' => false,         'rewrite' => array("slug" => "drawing-tools/%brand%/%type%/%material%/%color%"), // Permalinks format         'has_archive' => false,         'menu_position' => 5,         'supports' => array('author')     ));            register_taxonomy('brand',array('drawing-tools'), array(         'hierarchical' => false,         'labels' => array(             'name' => _x( 'Brands', 'taxonomy general name' ),             'singular_name' => _x( 'Brand', 'taxonomy singular name' ),             'search_items' =>  __( 'Search Brands' ),             'all_items' => __( 'All Brands' ),             'parent_item' => __( 'Parent Brand' ),             'parent_item_colon' => __( 'Parent Brand:' ),             'edit_item' => __( 'Edit Brands' ),              'update_item' => __( 'Update Brand' ),             'add_new_item' => __( 'Add New Brand' ),             'new_item_name' => __( 'New Unit Brand' ),             'menu_name' => __( 'Brands' ),                     ),         'show_ui' => true,         'query_var' => true,         'rewrite' => array( 'slug' => 'drawing-tools' ),       ));            register_taxonomy('type',array('drawing-tools'), array(         'hierarchical' => false,         'labels' => array(             'name' => _x( 'Types', 'taxonomy general name' ),             'singular_name' => _x( 'Type', 'taxonomy singular name' ),             'search_items' =>  __( 'Search Types' ),             'all_items' => __( 'All Types' ),             'parent_item' => __( 'Parent Type' ),             'parent_item_colon' => __( 'Parent Type:' ),             'edit_item' => __( 'Edit Types' ),              'update_item' => __( 'Update Type' ),             'add_new_item' => __( 'Add New Type' ),             'new_item_name' => __( 'New Type' ),             'menu_name' => __( 'Types' ),                     ),         'show_ui' => true,         'query_var' => true,         'rewrite' => array( 'slug' => 'drawing-tools/%brand%' ),       ));           register_taxonomy('material',array('drawing-tools'), array(         'hierarchical' => false,         'labels' => array(             'name' => _x( 'Materials', 'taxonomy general name' ),                 'singular_name' => _x( 'Material', 'taxonomy singular name' ),             'search_items' =>  __( 'Search Materials' ),             'all_items' => __( 'All Materials' ),             'parent_item' => __( 'Parent Material' ),             'parent_item_colon' => __( 'Parent Material:' ),             'edit_item' => __( 'Edit Material' ),              'update_item' => __( 'Update Material' ),             'add_new_item' => __( 'Add New Material' ),             'new_item_name' => __( 'New Material Name' ),             'menu_name' => __( 'Materials' ),                     ),         'show_ui' => true,         'query_var' => true,         'rewrite' => array( 'slug' => 'drawing-tools/%brand%/%type%' ),       ));           register_taxonomy('color',array('drawing-tools'), array(         'hierarchical' => false,         'labels' => array(             'name' => _x( 'Colors', 'taxonomy general name' ),             'singular_name' => _x( 'Color', 'taxonomy singular name' ),             'search_items' =>  __( 'Search Colors' ),             'all_items' => __( 'All Colors' ),             'parent_item' => __( 'Parent Color' ),             'parent_item_colon' => __( 'Parent Color:' ),             'edit_item' => __( 'Edit Color' ),              'update_item' => __( 'Update Color' ),             'add_new_item' => __( 'Add New Color' ),             'new_item_name' => __( 'New Color Name' ),             'menu_name' => __( 'Colors' ),                     ),         'show_ui' => true,         'query_var' => true,         'rewrite' => array( 'slug' => 'drawing-tools/%brand%/%type%/%material%' ),       ));                 function filter_post_type_link($link, $post)     {         if ($post->post_type != 'drawing-tools')             return $link;              if ($cats = get_the_terms($post->ID, 'brand'))             $link = str_replace('%brand%', array_pop($cats)->slug, $link);              if ($cats = get_the_terms($post->ID, 'type'))             $link = str_replace('%type%', array_pop($cats)->slug, $link);              if ($cats = get_the_terms($post->ID, 'material'))             $link = str_replace('%material%', array_pop($cats)->slug, $link);              if ($cats = get_the_terms($post->ID, 'color'))             $link = str_replace('%color%', array_pop($cats)->slug, $link);               return $link;     }          add_filter('post_type_link', 'filter_post_type_link', 10, 2);      Now, when a user access the link:               www.example.com/drawing-tools/rotring/mechanical-pencil/plastic/black/      everything works as expected. The problem is that the user can also access a partial structure like this               www.example.com/drawing-tools/rotring/      and still get results according to those taxonomies. How can I restrict a user from accessing such a URL and instead returning a 404 error message?


Create a category archive page in TwentyTen Child Theme

I would like to create a page that will show all the posts from one particular category. I want to show the post title with the post thumbnail and content and nothing else ..no other meta ..no post date, no author, no excerpt , nothing I have tried to follow various answers/tutorials without success leading me to feel somewhat confused. Do I create a loop-category.php and add an if-category() statement for that category?? If so what statement please ?? please could someone explain clearly step by step Thank You


List of categories instead of dropdown menu selector in admin options

I am using the following code for in admin area for theme options               $categories = get_categories('hide_empty=0&orderby=name');       $tz_wp_cats = array();       foreach ($categories as $category_list ) {           $tz_wp_cats[$category_list->cat_ID] = $category_list->cat_name;           }       array_unshift($tz_wp_cats, "Choose a category");          // ==========================//     //             Start the theme options!                  //     // ==========================//              $themename = "Hype";         $shortname = "tz";              $options = array (              array(  "name" => __("selected", 'framework'),         "id" => $shortname."_selectedtab",         "std" => "",         "type" => "hidden"),              array(  "type" => "opentab"),              array(  "type" => "open"),                   array(  "name" => __('Logo and Favicon Settings', 'framework'),         "id" => $shortname."_logo_settings",         "type" => "title"),              array(  "name" => __("Upload Logo", 'framework'),         "desc" => __("Enter the full URL of an image you would like to use as a logo e.g http://www.example.com/logo.png", 'framework'),         "id" => $shortname."_logo_url",         "std" => "",         "type" => "file"),              array(  "name" => __("Enable plain text logo",'framework'),         "desc" => __("Check this box to use a plain text logo rather than an image. Info will be taken from your WordPress settings.", 'framework'),         "id" => $shortname."_plain_logo",         "std" => "false",         "type" => "checkbox"),              array(  "name" => __("Favicon URL", 'framework'),         "desc" => __("Enter the full URL of your favicon e.g. http://www.example.com/favicon.ico", 'framework'),         "id" => $shortname."_favicon_url",         "std" => get_bloginfo('template_directory')."/favicon.ico",         "type" => "file"),              array(  "type" => "close"),              array(  "type" => "closetab")              );              /*Add The Theme Options Page*/         function mytheme_add_admin() {              global $themename, $shortname, $options;              if ( $_GET['page'] == basename(__FILE__) ) {                  if ( 'save' == $_REQUEST['action'] ) {                          $url = $_REQUEST['tz_selectedtab'];                     if ($url == ''){                         $url = 'themes.php?page=theme-options.php&saved=true&tab=1';                     } else {                         $t = substr($url, -1);                         $url = 'themes.php?page=theme-options.php&saved=true&tab='.$t;                     }                          foreach ($options as $value) {                         if ( ($value['id'] != 'tz_logo_url') && ($value['id'] != 'tz_favicon_url') ){                             update_option( $value['id'], $_REQUEST[ $value['id'] ] );                          }                        }                          foreach ($options as $value) {                         if ( ($value['id'] != 'tz_logo_url') && ($value['id'] != 'tz_favicon_url') ){                             if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); }                          }                     }                           // If files has been uploaded, move them to the /uploads dir and update the option value                 if (  (isset($_FILES['tz_logo_url'])) && ($_FILES['tz_logo_url']['error'] == UPLOAD_ERR_OK)  ) {                     $overrides = array('test_form' => false);                      $file = wp_handle_upload($_FILES['tz_logo_url'], $overrides);                     $urlimage = $file['url'];                     update_option('tz_logo_url', $urlimage);                 }                      if (  (isset($_FILES['tz_favicon_url'])) && ($_FILES['tz_favicon_url']['error'] == UPLOAD_ERR_OK)  ) {                     $overrides = array('test_form' => false);                      $file = wp_handle_upload($_FILES['tz_favicon_url'], $overrides);                     $urlimage = $file['url'];                     update_option('tz_favicon_url', $urlimage);                 }                          header("Location: ".$url);                     die;                  } else if( 'reset' == $_REQUEST['action'] ) {                      foreach ($options as $value) {                     delete_option( $value['id'] ); }                      header("Location: themes.php?page=theme-options.php&reset=true");                 die;                  }         }              add_theme_page($themename." Options", "Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');         }              function mytheme_admin() {              global $themename, $shortname, $options;              if ( $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

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

'.$themename.' settings reset.

';          ?>             <?php // now style the actual theme options page ?>

<?php _e('Theme Options', 'framework') ?>
                      <form method="post" action="" enctype="multipart/form-data" style="overflow:hidden;">                 <input type="hidden" name="selectedtab" id="selectedtab" value="0"/>

<?php _e('General', 'framework') ?>

<?php _e('Navigation', 'framework') ?>

<?php _e('Homepage', 'framework') ?>

<?php _e('Post Settings', 'framework') ?>

                          <?php                      $tab = 1;                     foreach ($options as $value) {                      switch ( $value['type'] ) {                          case "opentab": ?>                     <div id="tabs-<?php echo $tab;?>">                     <?php                      $tab++;                     break;                          case "closetab": ?>
                     <?php                     break;                          case "open": // style the opening                     ?>
                          <?php                      break;                          case "note": // style the notes                     ?>

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

                          <?php                      break;                          case "title": // style the titles                     ?>
<?php echo $value['name']; ?>

                                  <?php break;                          case "hidden": ?>                          <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="hidden" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(htmlspecialchars(get_settings( $value['id'] ), ENT_QUOTES)); } else { echo $value['std']; } ?>" />                               <?php break;                          case "text": // style the text boxes                     ?>

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

                             <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(htmlspecialchars(get_settings( $value['id'] ), ENT_QUOTES)); } else { echo $value['std']; } ?>" />
<?php echo stripslashes(htmlspecialchars($value['desc'])); ?>

                          <?php break;                          case "colour": // style the text boxes                     ?>

                             <?php echo $value['name']; ?>:
                         <div id="colourpicker-<?php echo $value['id']; ?>">

                             <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(htmlspecialchars(get_settings( $value['id'] ), ENT_QUOTES)); } else { echo $value['std']; } ?>" />
<?php echo stripslashes(htmlspecialchars($value['desc'])); ?>

                               <?php break;                          case "file": // style the upload boxes                     ?>

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

                                     File:	                                     <input type="file" name="<?php echo $value['id']; ?>" class="tz-upload" size="40" border="0" />

<?php _e('Current file:', 'framework') ?> <?php echo get_option($value['id']); ?>

                               <?php break;                          case "textarea": // style the textareas                     ?>

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

                     <textarea name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>"><?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(htmlspecialchars(get_settings( $value['id'] ), ENT_QUOTES)); } else { echo $value['std']; } ?></textarea>
<?php echo stripslashes(htmlspecialchars($value['desc'])); ?>

                               <?php break;                          case "checkbox": // style the checkboxes                     ?>

<?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 stripslashes(htmlspecialchars($value['desc'])); ?>

                               <?php break;                          case "select": // style the select                     ?>

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

                     <select 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 stripslashes(htmlspecialchars($value['desc'])); ?>

                               <?php break;                          case "close": // style the closing                     ?>

                             <input name="save" type="submit" class="button" value="Save Settings" />                                 <input type="hidden" name="action" value="save" />
                          <?php break;                     }                  }                 ?>

                           </form>                 <form method="post" action="">
                         <input name="reset" type="submit" class="button" value="Reset" />                         <input type="hidden" name="action" value="reset" />                         <?php _e('Caution: will restore theme defaults', 'framework') ?>
                 </form>
              <?php         }                    add_action('admin_menu', 'mytheme_add_admin');               // ==========================//     //             END the theme options!                   //     // ==========================//          ?>      So it looks like this example I would like to list all categories and generates unique ID automatically. I am only able to make dropdown selector but I need to list all categories; i.e. Something like               array(  "name" => __("Categories", 'framework'),     "desc" => __("Category color #1", 'framework'),     "id" => $shortname."_cat_color#1",     "std" => "#",     "type" => "text"     "desc" => __("Category color #2", 'framework'),     "id" => $shortname."_cat_color#2",     "std" => "#",     "type" => "text"     "desc" => __("Category color #3", 'framework'),     "id" => $shortname."_cat_color#3",     "std" => "#",     "type" => "text"),      Any suggestions, please?


Wordpress menu performance is slow when lot of items

I have a menu with more than 100 items in total and it is very slow to manage all those, slow respond and slow saving. Is there any plugin to somehow improve performance and make my life easier in a big number of items?


How to disable lightbox popup for "add a review" only?

By default in woocommerce when a user wants to add a review of a product, they click 'add a review' and this opens up a pop-up lightbox. I want to disable this part and just display the review form. Anybody has any ideas?


how can redirect sign in and sign out link front-end page rather then wp-login .php in comment form in wordpress

I want to redirect the signin and signout link from comment form in Wordpress. I am using a plugin to register users from the front-end; there I have two pages: sign-in and register. When someone registers from this page and logs in from this page, then its working fine. But when someone is going to give a comment to a post and is not logged in, then a link shows directing the user to login. Upon clicking this link it goes to `wp-login.php`, but I want to redirect this link to my sign-in page and after sign in the sign out link should go to this page as well. How can I do this?


How to display both home.php and index.php

Hey guys i recently created a theme. I want to show home.php when a visitor visit home page but all my blog posts are listed in index.php file. Can someone suggest me how to display index.php i tried http://www.mysiteurl.com/index.php but it redirecting me to http://www.mysiteurl.com/home.php Please advise me. Thanks


Associate custom post types with normal posts

I have a custom post type, called App. This has details like the name, description, thumbnail image, and some custom fields. Then I have posts about this app, that I'd like to associate with it. In the end, I'd like to be able to view the custom post type and all the posts that are associated with it. But I don't see any way to associate a post with anything besides a category or tag. But categories and tags don't allow for custom fields, images, etc. Is the only way to create a category with the same name as the custom post type, and then do something like have a custom field in that custom post type that has the ID of that category? Thanks!


Using GD Star Rating outside of the loop?

I need to insert a rating straight away after having programmatically created a post in WordPress and added a comment. What is the (GDSR) function to call to fire the rating once I've got the post id/comment id?


What's a good RSS Importer?

I'm looking for a good RSS importer to use on my WordPress installation. The current one isn't importing images properly, and I don't want to fix it. It needs to be an automated importer. Where I give it the link to the feed and it auto imports automatically every set interval. It also needs to import into a category, not a page. I'm currently using FeedWordPress, just so no one suggests that as an option.


show all in query_posts on category.php?

I want to be able to switch back and forth by clicking an anchor tag preferably, between showing a subset of posts and showing all posts, the code I am using is:               query_posts($query_string . '&posts_per_page=-1');      or               query_posts( array(     'posts_per_page' => 45,     //'paged' => ( get_query_var('page') ? get_query_var('page') : 1 ),     ));      (paged isn't working) Any way to do this? The problem is I need the 45 limit to show by default, and then a show all anchor tag or button that the user can click. Any help would be much appreciated! Thanks! Donna


Enqueue scripts inside a class

I have written a small class that will handle enqueues in my theme :               <?php          class Header {              public function init_hooks()         {             add_action('wp_print_scripts', array(__CLASS__,'include_all_files'));         }              public function include_css_files()         {             wp_register_script('style.css', get_bloginfo('stylesheet_url'));             wp_enqueue_script('style.css');         }              public function include_js_files()         {             wp_register_script('jquery-min', "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");             wp_enqueue_script('jquery-min');                 }              public function include_all_files()         {             $this->include_css_files();             $this->include_js_files();         }          }          ?>      I call it right before closing the head tag, like :               $header = new Header();     $header->init_hooks();       But it does not work. There is no error, but no script is added. Any ideas ?


Name of JQuery technique used on this site

What is the effect or jquery plugin used to create the on hover video effect used on this site? http://www.iwc.com/it/collezione/


Cleared wp-cache and file is still not updated

I did all the following:   * Deleted the cache in the WP Super Cache settings   * Added `define('DISABLE_CACHE', true);` in my wp-config.php   * Deleted my 'cache' folder under 'wp-content' However a theme php file is still not updating. Can anyone help me?


Creating custom menu with custom themes

I have created my own custom WordPress theme and am now trying to implement the custom menu. I noticed with the default theme that when I went to _Appearance > Menus_ , I was able to create my menu based on the pages I had, but after installing my own custom theme, I could not locate _Appearance > Menus_. And by that I mean there was no _Menus_ option under _Appearance_ in WordPress. So now I do not know how to go about it, because this is my first WordPress site.


How can I upload SVG images using the media uploader?

I really love using SVG images as I can scale them as big or as small as I want. However, WordPress won't allow me to upload them using the media uploader. How can I change this? ![media uploader error](http://i.stack.imgur.com/3FaNI.png)


How do you publish a draft on Wordpress

I can't work out how to publish a draft. I go to preview, to check everything's ok, and then there doesn't seem to be any option to do anything more.


echo or print_r in an admin function

I'm currently working my first plugin (to deal with my CPT) and am at the process of saving the values of a meta box. I wish to add an underscore (`_`) to the meta key so that it is hidden on the custom field part. I have some trouble to get the data saved when this `_` is added (no problem when there's no `_`). So I try to investigate what goes in the meta array, but I can't manage to have an `echo` or `print_r` within a function in my plugin that would print on my admin page. I have wrote the following               function ccp_portfolio_item_info_meta_box_save( $post_id, $post ) {              if ( !isset( $_POST['ccp-portfolio-item-info-nonce'] ) || !wp_verify_nonce( $_POST['ccp-portfolio-item-info-nonce'], basename( __FILE__ ) ) )             return;              $meta = array(             '_portfolio_item_url' => esc_url( $_POST['ccp-portfolio-item-url'] )         );              print_r($meta);         // ccp_split_meta_save ($meta, $post_id, $post); // calling my function to split the metas     }      but that would not print my `$meta` on top of my admin page, what am I doing wrong? @brasofilo thank you for your answer first my form is as follow               function ccp_portfolio_item_info_meta_box_display( $post, $metabox ) {              wp_nonce_field( basename( __FILE__ ), 'ccp-portfolio-item-info-nonce' ); ?>
             <?php _e( 'Project URL', 'custom-content-portfolio' ); ?>
             <input type="text" name="ccp-portfolio-item-url" id="ccp-portfolio-item-url" value="<?php echo esc_url( get_post_meta( $post->ID, '_portfolio_item_url', true ) ); ?>" size="30" tabindex="30" style="width: 99%;" />
         <?php              /* Allow devs to hook in their own stuff here. */         do_action( 'ccp_item_info_meta_box', $post, $metabox );     }      then my save function is :               function ccp_portfolio_item_info_meta_box_save( $post_id, $post ) {              if ( !isset( $_POST['ccp-portfolio-item-info-nonce'] ) || !wp_verify_nonce( $_POST['ccp-portfolio-item-info-nonce'], basename( __FILE__ ) ) )             return;              $meta = array(             '_portfolio_item_url' => esc_url( $_POST['ccp-portfolio-item-url'] )         );                   ccp_split_meta_save ($meta, $post_id, $post); // calling my function to split the metas     }      up to there all is fine, when I print_r the $metal, it show the right thing then within the previous function I call this one               function ccp_split_meta_save ($meta, $post_id, $post) {          echo 'je suis dans ccp_split_meta_save
';     print_r($meta);         //exit();              foreach ( $meta as $meta_key => $new_meta_value ) {                      /* Get the meta value of the custom field key. */                 $meta_value = get_post_meta( $post_id, $meta_key, true );                      echo '
la meta key est '.$meta_key.'
';                 echo '
la meta value  est '.$meta_value.'
';                 // exit();                      /* If there is no new meta value but an old value exists, delete it. */                 if ( current_user_can( 'delete_post_meta', $post_id, $meta_key ) && '' == $new_meta_value && $meta_value )                     {//delete_post_meta( $post_id, $meta_key, $meta_value );                     echo '
je suis dans delete
';                     }                      /* If a new meta value was added and there was no previous value, add it. */                 elseif ( current_user_can( 'add_post_meta', $post_id, $meta_key ) && $new_meta_value && '' == $meta_value )                 {                     //{add_post_meta( $post_id, $meta_key, $new_meta_value, true );                     //echo '
 c est une nouvelle meta value
'; exit();                     echo '
je suis dans add
';                 }                        //}                      /* If the new meta value does not match the old value, update it. */                 elseif ( current_user_can( 'edit_post_meta', $post_id, $meta_key ) && $new_meta_value && $new_meta_value != $meta_value )                 {   //update_post_meta( $post_id, $meta_key, $new_meta_value );                     echo '
je suis dans update
';                 }                 else                  {                 echo '
je suis nul part
';                 echo 'add_post_meta : ' .current_user_can( 'add_post_meta', $post_id, $meta_key ).'
';                 }              exit();         }          }      as you see it is a working/denug function since I have put some pointer to see where my datas are the strange thing is that if I have $meta = array( 'portfolio_item_url' => esc_url( $_POST['ccp-portfolio-item- url'] ) then it goes well to elseif ( current_user_can( 'add_post_meta', $post_id, $meta_key ) && $new_meta_value && '' == $meta_value ) so a new entry is add to the db if I have $meta = array( '_portfolio_item_url' => esc_url( $_POST['ccp-portfolio-item- url'] ) then it goes to my last else, which means nowhere if I print $meta_value = get_post_meta( $post_id, $meta_key, true ); then it well return an empty value so that would direct me to                       /* If a new meta value was added and there was no previous value, add it. */             elseif ( current_user_can( 'add_post_meta', $post_id, $meta_key ) && $new_meta_value && '' == $meta_value )             {                 //{add_post_meta( $post_id, $meta_key, $new_meta_value, true );                 //echo '
 c est une nouvelle meta value
'; exit();                 echo '
je suis dans add
';             }         but no it is not I just don't understant that why adding only the underscore makes trouble thank you in advance for your help @ toscho, sorry I did not really understand how to update my question, but it looks like I found out.. thank you and sorry for my rookiness


How to publish new posts/pages in root instead of subfolder, but keep old structure in place?

I have a blog that was setup in `example.org/blog/` many years ago, so all its files are in `/blog/`. Back then it seemed like a good idea, but now we want to _slowly_ get rid of the subfolder. Of course I could move the installation to the root folder `/`, change the wordpress url in option and just move everything, add a htaccess redirect from `/blog/*` to `/*` so old links still work. **But** we want to do it slowly because moving all the content at once would be a major risk and possible desaster for the Google rankings and traffic. 301/302 redirects are fine, but Google is not very happy if you move thousands of articles at once while the links stay the same. So new content first, then old stuff. **Is there any way to only publish _new_ posts and pages in `example.org/` instead of `example.org/blog/`?** I'm capable of all kinds of hacks. I already have several blogs running with the Wordpress installation in subfolders, have redirected and moved blogs all over the place and written scripts to change the values of all rows in a database table. Bring it on :)


Custom walker to generate menu with integrated breadcrumb dropdowns

Have been trying to write a custom walker class which returns a wp_custom_menu as follows. http://i.stack.imgur.com/lC5cP.png Planning to enhance the different states with some scripting. The page at http://www.htmldrive.net/items/demo/169/jQuery-Plugin-xBreadcrumbs-Extended- Breadcrumbs-navigation is a good example of the planned end result. Could not find any leads nor howtos, some ideas would be fabulous! Many thanks, F.


Adding a custom field into the_content()

Anyway to add a custom field into the_content() somehow? I have the AddThis plugin on my site and it shows up at the bottom of my site right before my custom field, I would like my custom field to show up at the very end of the_content() and then have the AddThis stuff show up. Anyway to do this?


Add suffix to filename of uploaded images

I registered 3 custom image sizes (Double sized, for retina displays) with add_image_size: thumbnail@2x, medium@2x and large@2x.               function retina_image_sizes() {         $retina_sizes = array(             'thumbnail@2x' => array(             'width' => get_option( 'thumbnail_size_w' ) * 2,             'height' => get_option( 'thumbnail_size_h' ) * 2,             'crop' => get_option('thumbnail_crop'),             ),             'medium@2x' => array(             'width' => get_option( 'medium_size_w' ) * 2,             'height' => get_option( 'medium_size_h' ) * 2,             'crop' => false,             ),             'large@2x' => array(                 'width' => get_option( 'large_size_w' ) * 2,                 'height' => get_option( 'large_size_h' ) * 2,                 'crop' => false,             )         );              foreach ( $retina_sizes as $name => $data ) {             add_image_size( $name, $data['width'], $data['height'], $data['crop'] );         }     }     add_action( 'init', 'retina_image_sizes');      Wordpress's naming convention is filename-width x height.jpg. But I need them to be named in another fashion ( filename-originalwidth x originalheight@2x.jpg) If I upload a picture, and the thumbnail has a size of 100x100, for example, I want the images to be named:               example-100x100.jpg     and     example-100x100@2x.jpg      I found ways to process pictures and save them under another name, but that is too much. This question explains, how to change the filename, but, not how to include with and height information. I tried to get it to work, but I only get a single file instead of seven and it throws some errors (probably because it tries to overwrite the file). How can I change the filename in the above described fashion? Is the add_attachment hook the right one?


Multiple gallery thumnbnails on one page

I want to post multiple galleries on a single static page. So far, I've only been able to create a gallery that puts every single picture on that one page. What I want to achieve is several images on one page (thumbnails maybe) that represent different galleries, not the same one. How can I do that?


What is content.php file that is needed for Jetpack infinite scroll plugin?

I'm currently learning how to use Jetpack infinite scroll plugin, while going through the documentation I came across 'render' section: http://jetpack.me/support/infinite-scroll/ It uses default loop, which I actually need to customise, it also says that if I have content.php file in my template than I'm good to go and can omit render argument. However I don't know what content.php file is for. As for the loop and the markup of each post, those are defined in my index.php, single.php and page.php files. Could you please explain and give example of what content.php page is, where it should be located and how can it be used. I'm speculating that its a file where I can paste just my loop and post markup bit, so perhaps I can than somehow include content.php file in my index.php, single.php and page.php files maybe? Not sure. I did look for this in the codex, but surprisingly couldn't find explanation of content.php file.


How to remove a filter that is an anonymous object?

In my `functions.php` file I would like to remove the below filter, but I'm not sure how to do it since it's in a class. What should `remove_filter()` look like?               add_filter('comments_array',array( &$this, 'FbComments' ));      It's on line 88 here.


How to add posts to custom menus?

I'm just beginning to work the "Custom Menu" functionality that was introduced in 3.0 into my theme. I like everything about this new capability and API, with one exception: Why no posts? I can create menus containing pages, categories, even tags, but where is the posts selector? I know I could use the "Custom Links" tool as a workaround, by pasting in the URL to a given post, but I'd rather not expect my users to do that without creating a ton of support issues. I'd rather just add a menu box called "Posts" that has the same functionality as "Pages". Has anyone done this and if so can you share the code? Alternately, and I know I'm dreaming on this one, what about a single box with tabs for selecting between pages and posts?


I want to use ONLY Disqus and turn off default Comments

If I set "Comments: OFF" ( _Discussion_ > _Allow comments_ > _OFF_ ) on post - Disqus (and default WP Comments) does not show on single post. I founded in settings ( _Comments_ > _Disqus_ > _Plugin Settings_ ) " **Appearance** " and I selected " **Use Disqus Comments: Only on blog posts with closed comments.** " but it nothing changed - comments and Disqus do not exist on single post, and if I set "Comments: ON" for some post - exist only default form to add comment (Disqus does not show).


Change the "page" slug in pagination

Simple question. When pagination is activated, the URL changes to `"site.com/page/2"`. For my site, this should be `"site.com/paggetto/2"`. How can I change that rewrite rule? I also want to change `"author"` and other variables.


Advanced Integration - WordPress + YOURLS

I've been using a custom YOURLS system to create my own URL shortener for my blog network for a while now. Everything works just great with only a few exceptions (bugs already reported to the developer). But I'm aiming for something a bit more complicated that's not included in the existing WordPress YOURLS plug-in. ## Currently Right now, when a post is published, WordPress automatically logs in to YOURLS, creates a short URL, and pushes a notification to Twitter. It works well and keeps track of everything for me (the short URL is memorized by WordPress and inserted into appropriate `<meta>` tags as well). ## What I want to do I schedule my blog posts for 8am Pacific Time. This works well _if_ you're on Twitter at 8am. But some people are browsing at lunch. Some in the evening. I want to schedule automated re-tweets of my short URL from within WordPress. Some posts I want pushed out once ... others I want pushed out at 2 or 3 strategic times during the day. How would I go about doing this?


use wp_get_theme() to get theme author name

As of wordpress 3.4 we're supposed to use wp_get_theme to return theme data.               $theme = wp_get_theme();          //var_dump($theme);          echo $theme->Author;      despite the var_dump indicating the correct string, $theme->Author always returns a hyperlink with the author's name, but linked to the author's site. how can i get just the theme's author name?


Wikipedia - CMS

I am working on Wordpress - Blogging Application. Like Wikipedia or Livejournal .. How to allow a registered users in my Web- Blog site to write their blogs or contents ? If i need to write any blogs on my site, its simple normal process. But making the blogging site .. little bit of commercial by allowing the users to register and to blog on my site .. is our goal ..!


Exclude category from related post

I made a related post sidebar widget and im trying to exclude a category from it i tried 'exclude'=>7932 but that doesnt seem to work, is there another way to do this?                           <?php $category = get_the_category();                 $parent = get_cat_id($category[0]->category_parent);                 $parent = $category[0]->cat_id; ?>
                 <?php                 $categories = get_the_category($post->ID);                 if ($categories) {                 $category_ids = array();                 foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;                 $args=array(                 'category__in' => $category_ids,                 'post__not_in' => array($post->ID),                 'showposts'=>5, // Number of related posts that will be shown.                 'caller_get_posts'=>1,                 'exclude'=>7932,                 );                      $my_query = new wp_query($args);                 if( $my_query->have_posts() ) {                 while ($my_query->have_posts()) {                 $my_query->the_post();                 ?>                 <?php $id = get_the_ID(); ?>                      <?php $image_meta = get_post_meta($id,'image',true); ?>

                 <?php if ( (isset($image_meta)) && ($image_meta != '') ) {                  woo_image('key=image&width=140&height=80');                 }else{  echo $small_placeholder;}   ?>
                 <a href="<?php the_permalink() ?>"><?php the_title(); ?>
<?php get_the_excerpt_limit( 75, '...' ); ?>

                             <?php                 }                 }                 }                 $post = $orig_post;                 wp_reset_query();                 ?>


How do I hide a term from non-admin users in get_the_term_list?

I have a term that I'd like logged in admin users to see while they're browsing the site while keeping it hidden from the public. I'd prefer to have it done at the lowest level possible, even so far as to prevent the term from showing up publicly with _any_ of the functions (e.g wp_list_categories). What's the best way to pull this off?


Contact Management Plugin suggestions, or tutorials/resources recommendations

I will soon be building a site for a local Non-Profit Art Community, and they would like a to have a powerful **contact/member management system** that can do these key things:   1. Store User Contact info (Address, Phone, Email, Website, regdate, etc.)   2. Synchronize with a newsletter mailing service, their preference is Emma. (Alternatively, the desired plugin could handle the newsletters internally)   3. Tag users with multiple tags, example would be Artist, Volunteer, Member.   4. Track membership and expiry, as well as payment history for Members.   5. Hopefully use the built-in Wordpress User area of the admin. My question is, can anyone recommend a plugin that can get me all the way, or part of the way there?


wp_insert_comment error. puzzled by date value

I am trying to programmatically insert comments in a bulk operation as part of migration routine. Comments are in a SQL server table. I receive the date info from the SQL server table field and store it in a PHP variable like the following way;                   while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC))         {                        ...             $the_date = $row['the_date'];             ...         }         var_dump view of the $the_date is as follows;               object(DateTime)#97 (3) {       ["date"]=>       string(19) "2012-07-30 00:00:00"       ["timezone_type"]=>       int(3)       ["timezone"]=>       string(3) "UTC"     }      then I prep my wp_insert_comment's data array.   var_dump view of that data array as follows;               array(7) {       ["comment_post_ID"]=>       string(5) "73615"       ["comment_author"]=>       string(14) "Joe  (USA)"       ["comment_author_email"]=>       string(20) "user@domain.com"       ["comment_content"]=>       string(2001) "commment text here"       ["comment_parent"]=>       int(0)       ["comment_date"]=>       object(DateTime)#97 (3) {         ["date"]=>         string(19) "2012-07-30 00:00:00"         ["timezone_type"]=>         int(3)         ["timezone"]=>         string(3) "UTC"       }       ["comment_approved"]=>       int(1)     }      After the wp_insert_comment operation, I get a 0 in return - indicating an error. And the following message stops the whole process.               Warning: preg_match() expects parameter 2 to be string, object given in F:\inetpub\....\wp-includes\formatting.php on line 1868          Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 1 to be string, object given' in F:\inetpub\....\wp-includes\formatting.php:1872 Stack trace: #0 F:\inetpub\....\wp-includes\formatting.php(1872): DateTime->__construct(Object(DateTime)) #1 F:\inetpub\....\wp-includes\comment.php(1238): get_gmt_from_date(Object(DateTime)) #2 F:\inetpub\...\comments.php(259): wp_insert_comment(Array) #3 F:\inetpub\...\comments.php(100): HandleComments(Resource id #25, '73615', 'services.articl...', 'XYZ1207-5206') #4 {main} thrown in F:\inetpub\....\wp-includes\formatting.php on line 1872      How can I go around this problem and store the date properly? 2012-07-30 00:00:00


Calling a div and content in php?

Is there a code that i can place in the header that will call a certain div and the content i place inside it for every custom post type i have, Somthething like this.                <?php if (is_post_type('pretty-little-liars') ) {echo '

'; } ?>      I know that the code above doesn't work, but is there a way that i can call something like that for each post type i have, i will be placing this code in the header. Also if anyone does have the solution could you please tell me where do i add a second line to the code that repeats the first line but with a different post type name?


How to display a category list in a mediawiki like way?

I would like to reproduce on Wordpress the same behaviour of mediawiki when it comes to display the posts of a certain category (with an alphabetical order, in columns and using first letters in bold as section titles). Do you think it's possible ?if yes, how would I do that ? Currently I'm using a wordpress blog as a Laboratory Notebook and would like to add to it the good sides of a wiki. I already have the post revisions but this kind of category view is a plus I would like to add. It's one of the feature that makes me have difficulties to choose between both applications. Thanks in advance for your help.


Featured Image Link to next post?

Hello i wonder if anyone knows this is possible? A post featured image click to view next post...? For example..               <a href="next-post">      <?php the_post_thumbnail('post-thumbnails'); ?>     </a>      I assume its something from the WordPress pagination, as when it gets to the final post/image it needs to go back to the first one. Any idea if it can be done?


Override dynamic_sidebar() in plugin?

I'm writing a custom plugin that allows a particular page to have it's own sidebar with widgets. It works great so far, but what I'd like to do is generalize it more and allow the plugin to "override" the dynamic sidebar of any page (if it has a custom sidebar) without having to edit any template files. I've tried several hooks and have delved into the code a bit, but nothing stands our or works so far. To save some time I thought I'd see if anybody has any working solutions to this issue? I might be able to solve this issue, but it is straining my "after working hours" brain. If it isn't possible I'd be more than willing to have a short-code or function call that does this for me, but I'd really like to make it idiot proof and just have it work without any template changes.


Most viewed posts in Wordpress

I am owner of a blog/website and I am using this code for tracking post views in site :                 function getPostViews($postID){         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');             return "0 View";         }         return $count.' Views';     }     function setPostViews($postID) {         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             $count = 0;             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');         }else{             $count++;             update_post_meta($postID, $count_key, $count);         }     }      I want to fetch most viewed posts today, last week, last month to show in sidebar. Is there any way to sort posts based on post views. The post views is stored in a custom field post_views please guide me. Rias


Wordpress Url setting

AOA, I want to set my urls in wordpress something like this. http://www.digitalspinners.no/wp_mahasib/21-05-2012/abbotabad/page1 http://www.digitalspinners.no/wp_mahasib/21-05-2012/lahore/page1 but wordpress adds a dash and number to the end of url like this wp_mahasib/21-05-2012/lahore/page1-2 url explanation is : date/category/postname Any suggestion or improvement will be appriciated. Thanks


Custom rss feed template - Get featured image and custom fields

I use wp as a cms. I needed a custom-made template for my rss feeds, so that I could display custom fields of my posts in the feeds. I took the basic custom rss template suggested by Yoast and made some modification as I needed. It is working fine except that I am unable to retrieve the featured-post-thumbnail and other custom-field-values. Here is what my custom rss feed url looks like now - `http://website.com/custom-feed/` _Here is the complete code :_               <?php     /*     Template Name: Custom Feed      */          $numposts = 5;     function yoast_rss_date( $timestamp = null ) {       $timestamp = ($timestamp==null) ? time() : $timestamp;       echo date(DATE_RSS, $timestamp);     }          $posts = query_posts('showposts='.$numposts);     $lastpost = $numposts - 1;          header("Content-Type: application/rss+xml; charset=UTF-8");     echo '<?xml version="1.0"?>';     ?><rss version="2.0">     <channel>     <title>website content feeds</title>     <link>http://website.com/</link>     <description>The latest content from website.</description>     <language>en-us</language>     <pubDate><?php yoast_rss_date( strtotime($ps[$lastpost]->post_date_gmt) ); ?></pubDate>     <lastBuildDate><?php yoast_rss_date( strtotime($ps[$lastpost]->post_date_gmt) ); ?></lastBuildDate>     <managingEditor>director@website.com</managingEditor>     <?php foreach ($posts as $post) { ?>          <item>     <title><?php echo get_the_title($post->ID); ?></title>     <link><?php echo get_permalink($post->ID); ?></link>          <?php echo add_my_custom_field_node();?>          <description><?php $object = new WPSEO_Frontend(); echo $object->metadesc( false ); ?> </description>     <pubDate><?php yoast_rss_date( strtotime($post->post_date_gmt) ); ?></pubDate>     <guid><?php echo get_permalink($post->ID); ?></guid>     </item>          <?php } ?>     </channel>     </rss>      The code that I am trying to pull the thumbnail is suggested in a solution by @bainternet to a similar question and I have it between the `<link>` and `<description>` tags. But it is not doing anything. I tried using `<?php echo get_post_meta($post->ID, 'location', true);?>` for custom-feld-values to appear but it does not work either. Is there specific tags I should be using for the featured-image or custom-fields to appear, if so what tags and how do I use them? I also tried solution suggested here. What am I missing. Please guide, thanks. > FYI - My post descriptions are auto generated by the yoast-wordpress-seo > plugin so for descriptions I am using a custom code, which is working fine. * * * **UPDATE** : Reading the solution by @BenMiller to this question I understood that I have to use `rss2_item` action hook in order to add tags to my custom- rss-feed. Here is a the code in my functions.php now :                add_action('rss2_item', 'add_my_custom_field_node');          function add_my_custom_field_node() {         global $post;         $metaValue = get_post_meta($post->ID, 'location', true);         if(!empty($metaValue)):             echo("<my-custom-field>{$metaValue}</my-custom-field>");         endif;     }      * * * **SECOND UPDATE** : The other strange thing that I noticed is that when I checked my custom-rss-feed-url at validator.org. It shows my custom-field- values and the featured-image url with a .jpg extension but for some reason throws an error. `Undefined item element: my-custom-field`. I use livebookmarks to check feed-url and using firefox browser. I am totally confused.


Form post to Wordpress page = wrong template

I'm using permalinks and I have a page with a slug like this:               http://www.mysite.com/jobs/      The page uses a specific template for itself. On another page I have a form that I submit as POST to `http://www.mysite.com/jobs/`. However, when the form is submitted, it takes me to the proper `/jobs/` page, but the template is not correct. Even though the url is correct. I appears to use maybe the index or default template for some reason. If I click in the address bar of the browser and press enter to re-visit the same page, then the proper template appears. It's like submitting a POST form to this page makes it use the wrong template even though the permalink slug is exactly the same as when I visit it normally. Any clues?


Modify links in user comments

When a link is posted in a comment, the format is : rel="nofollow" Using a function, how can I change that to : rel="external nofollow _blank" So the links open in a new window?


stop all video players when starting an other to play?

I have a wordpress-page where many videos are posted. Some are embedded Vimeo or YouTube Videos, some are hosted on the server and played with wordpress-JW- Player Plugin. The thing is, on some pages there are up to 10 videos and in "worst" case, three different players. When the user watches a video, and then starts a second one, the first video should stop automatically. My question is: is there a Wordpress-compatible-JavaScript/WP-Plugin/etc. which provides such a behavior, when the user starts a second video the first one shell stop (and if he starts a third, then the second one shell also stop, and so on). Or do I have to configure the WP-Plugin of JQ Player in an other way? **UPDATE** I found this script, but it seems no to do anything in my case ... (I don't get any errors - it seems just to do nothing)


Network Unreachable error on Google Webmaster Tools at Child-Sitemap

My URL is: http://www.chemicalsubjects.com Hi, I have an issue with my wordpress site sitemap.xml 's some child sitemaps. It sometimes gives an HTTP 503 crawl error: Unreachable network. I think that is issue with godaddy server-side. I get this error mostly from this sitemap link: http://www.chemicalsubjects.com/sitemap-pt-post-2011-07.xml . When i click test sitemap, then it works. But after 4-5 hours later and when i look at my sitemap then it doesnt work and status is pending. I did fetch as google bot , so everythings fine on those pages. But why sometimes my sitemap goes down? Why godaddy server is often down for my main website sitemap.xml? This is godaddy reply: When using 3rd party applications or sites to monitor a site those particular robots that are trying to request information may be requesting so much that our hosting accounts will actually block the requests. in your case with the 503 message that is what happens when a request of information happens often. There is nothing wrong with the hosting account its just how our system protects the hosting account and your site. And I asked: I also use jetpack but I have disabled its statistics monitor but auto twitter,facebook posting enabled, and I have limit login attempts, wp-united, ithemes security, akismet, google analytics plugins installed. Which plugin may cause this system with so much traffic? So, which plugin may cause to too much requests? Then I have found something onto my mind; when i create an article on wordpress , a lot of jetpack crawlers comes to my website, also i have auto twitter,facebook and g plus posting option when an article is posting and when an article posted after i looked to my google webmaster tools i saw my wordpress sitemap is on hold (status is pending) So what is that meaning? Which option can cause this issue? I also have some security precautions with ithemes security plugin.


Set a cookie only in single posts

I'm trying to set a cookie when a user is on a single post. I'm keeping track of how many single posts he has read this month. I have two problems: I have a custom template and added the following code to my functions.php               function articlesVisited() {       if (is_single()){         $postNumber = $wp_query->post->ID;         setcookie($postNumber,'visited',time()+60*60*24*31);       }     }     add_action('init', 'articlesVisited');      First. The code inside is_single() is never reached when I visit a single post on my site. If I put an -else- block after it, it executes that. Second, the $wp_query->post->ID does not give me the ID of the post. I think that has something to do with global variables... Does anyone has experience with this?


How do I unserialize this?

I don't know the most about WordPress, but I see some serialized data in the DB that a plugin creates. The plugin works just fine, so I guess it unserializes it just fine too. When _I_ try to unserialize() it, it fails and var_dump shows bool(false) for the result. This is the string I see in the database:               a:1:{i:0;a:3:{s:4:"name";s:56:"Song → Black Meen : “So Clean (feat. Dullaah Jin)”";s:4:"file";s:98:"http://localhost/peace.worldwide/wp-content/uploads/2013/05/03-So-Clean-feat.-Dullaah-Jin.mp3";s:9:"condition";s:3:"all";}}      You might notice that the length fields don't match with the lengths of the values in the quotes. What's going on here? How do I unserialize this data?


How to change widget's form color in admin?

I have a simple question. How to change widget's form color in admin panel of wordpress (on widgets page) to make them more unique? Here is a simple example: ![example](http://i.stack.imgur.com/wFnjZ.jpg)


Create user from external file

I have this little script for create user from page of template i use in wordpress template page :               $user_name = "usertest";     $user_pass="123456";     $user_email="myemail@domain.com";     wp_create_user( $user_name,$user_pass,$user_email);      I have little from inside template for create user using this way but no works , it´s bad writte or what , thank´s for the help


Wordpress Update Links

I just need a little help in WordPress query or a plugin which can update all internal links used as hyper link or directly with pages to WordPress normal url i.e `?page_id=69` I have created a website with .htaccess mod_rewrite but unlucky the host which I am going to use not allowing to rewrite urls I have about 140+ Pages so I can't just update links 1 by 1 I have also changed the links to default but that only works for main menu not internal pages. IN SHORT I JUST NEED TO UPDATE ALL URLS FROM:                http://localhost/wordpress-website/about      to                http://localhost/wordpress-website/?page_id=40


Custom post metadata not appearing in public API

I'm using wordpress.com's public REST API to retrieve custom posts from a Wordpress installation. The JSON that's being returned is missing all the custom fields, however. The fields are definitely there and working, because I can filter on them. For example this URL: https://public- api.wordpress.com/rest/v1/sites/swnfest.com/posts/?type=artist&meta_key=facebook&meta_value=outfitoutfitoutfit is successfully limiting based on the `facebook` custom field, but that field isn't present in the response. Judging by the criteria for including custom fields in this article: > If the user performing the request is unauthenicated, he or she will not be > able to add, edit or delete any metadata; will be able to read any metadata > for which the key doesn’t begin with _ but will not be able to read any > metadata which begins with _ unless it is whitelisted. the field should be appearing. Is there something I'm missing, or is this a bug?


Pass PHP variable between functions in functions.php

I have a WordPress Admin page where you can add a "listing". Within this Admin Page I have added many fields which transfer variables over to the listing page which is created/updated. Within this admin page I am trying to take the string after the last "&" in the URL which is manually entered in the URL before loading the page:                $url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";      $id = substr( $url, strrpos( $url, '&' )+1 );      NOW the code below here is called when the ABOVE admin page is submitted to update the "listing". what I need to do is somehow get the variable `$id` to pass through to this function and be used again within the submit code.               $dirname = "../wp-content/themes/Explorable/".$id."/";      $images = glob($dirname."*.jpg");     // Open a known directory, and proceed to read its contents       foreach($images as $image) {         $imageNameLong = substr($image, -14);         $imageName = substr($imageNameLong,0 , -4);              if ( isset( $_POST[$imageName.'links'] ) )             update_post_meta( $post_id, '_'.$imageName.'links', sanitize_text_field( $_POST[$imageName.'links'] ) );         else             delete_post_meta( $post_id, '_'.$imageName.'links' );               if ( isset( $_POST[$imageName.'heading'] ) )             update_post_meta( $post_id, '_'.$imageName.'heading', sanitize_text_field( $_POST[$imageName.'heading'] ) );         else             delete_post_meta( $post_id, '_'.$imageName.'heading' );      };


Time sort with meta_key using UNIX timestamp failing due to date differences

I'm dealing with the following issue trying to sort a custom post type by a meta key created using the Advanced Custom Fields plugin Date and Time Picker add-on. The add-on creates a jQuery datepicker for users to set times in the dashboard. By default, an option _save_as_timestamp_ is set to true, so the data in the back-end is set as a Unix timestamp/epoch time. I'm trying to sort a series of events (all occurring on one day) by time. The problem I'm having is, if all the events were added on one day, then they sort correctly (e.g. a 9:00 am event would come first, 5:00 pm would come last). However, if a day or two later, my boss adds a new event to the list, it will show up as the final event, event if it were a 9:00 am event, because it's date is different. My post type query is as follows:               <?php $args = array(         'post_type' => 'event',         'posts_per_page' => -1,         'nopaging' => true,         'post_status' => 'publish',         'meta_key' => 'start_time',         'orderby' => 'meta_value_num',         'order' => 'ASC'     );     $my_query = new WP_Query( $args );     while( $my_query->have_posts() ) : $my_query->the_post(); ?>      In my estimation, I have two options, change the _save_as_timestamp_ option to false, so that no date is associated with the time. Problem is I'd have to go in and set the times again on all the events and, still, I'd have to manage a meta_query that can sort PM times after AM times, because, when I do this, it still sorts a 9:00 AM time after a 5:00 PM time. I've played with using _meta_query_ and setting type to 'TIME' but still no luck. Second option, I imagine I could format the timestamp in a manner where the date is stripped out using some combination of the date, time or DateTime functions in PHP, but I'm at a loss as to how to do this correctly. I tried added the following to the query, but I'm not experienced with meta_query at all:               'meta_query' => array(         array(             'key' => 'start_time',             'value' => date('Hi', time()),             'compare' => '>='         )     )      Is there any way to do this or would I have to use some function or pre_get_posts filter that will format the meta_key so that I can access it as a formatted variable before the loop begins? Any help is greatly appreciated!


Tags results not displaying for post types

**UPDATE** Here is the thing... I have a structure where I created a post type which has taxonomies and also tags. Let's call it **Works.** However, when I need to filter by tags, using the tag template, it displays only the blog post posts taged with the blog tags, and do not display the tags used on the post type. **Works has Taxonomies** like: In-house, OutSourced. (there is no problem with taxonomies, just displaying this just in case...) **Works has tags** like: Iron, Wood, etc. So... According to my main guess, if I want to display a filter by tags, or just clicking a tag link generated. I have to create the `tag.php` template, and into the loop, I will have all works tagged with a particular tag. However... the result is empty, or worst... I have a similar tag but into the BLOG section, it will display the blog post, which actually, is normal behavior. I tried going a level deep and used the `archive.php` template instead, however it does not show it either, same thing as `tag.php`. So... the point is, if I want to create a filter that display my custom post type, `Works`, tagged with a particular tag, which is the template I need to create? If I get I click the tag generated, it actually takes me to `example.com/tag/my-tag`, which is in fact, the problem (I think), cause that is the root for blog posts. Any guessing?


Wordpress putting "rn" in every line break?

I am using a Wordpress plugin called "WP Checkout" and there is a custom post field that allows you to enter additional product information which is tabulated on the product page. I am able to enter HTML into these tabs, but for some reason, the HTML becomes malformed when I save the changes and "rn" is added in every line break. This issue didn't used to exist, it seems like it only started happening since I updated to the latest Wordpress version. The issue can be seen here: http://xactsensing.com/transmisor-del-flujo-de- lodo/#tabs13-2 Any ideas? Thanks in advance!


Help with JSON decode and foreach

I have this XML:   http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=science[journal]+AND+breast+cancer+AND+2008[pdat]. And I would like to get some information with JSON and put them in a array using foreach. This is my code:               function pubmedQuery() {               $json = wp_remote_get( 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=science[journal]+AND+breast+cancer+AND+2008[pdat]' );             if ( is_wp_error( $json ) ) {               echo '

Ups! There is an error!

';             } else {                 $decode = json_decode( $json['body'] );                 $results = array();                 foreach ( $decode->IdList as $items ) {                     $results[] = $item->Id;                 }             }     }      But it get me an error: > invalid argument supplied for foreach in **line 17**... (foreach ( > $decode->IdList as $items ) {). Can somebody help me? Excuse my english please!


How to migrate, does WordPress hardcode or shortcode image URLs?

I am getting very confused. I used to take my website on my dev. server, and copy the files over to my live server, export the database in phpMyAdmin, import it via phpMyAdmin into the new database server, change the `site_url` and `home url` and voila, the site migrated fine. All the image URLs worked fine, it seems they just used the `SITE_URL` for the domain part. Then I migrated my website with WP Migrate. Suddenly, exporting via phpMyAdmin leaves all the image URLs wrong. I have to do a find and replace with WP Migrate to change them all. I don't understand, how come they are suddenly hard coded? In short, are image URLs hardcoded or do they take the domain part from the SITE URL?


How to remove the excerpt in the Dzonia Lite theme

I am using Dzonia Lite theme in my website. My front page shows all the latest posts. I am getting an excerpt at the end of each post. Could anyone suggest me how to remove that excerpt at the end of the post. # Below is the code that I have in my template file
              <?php if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { ?>              <a href="<?php the_permalink(); ?>">              <?php the_post_thumbnail('post_thumbnail', array('class' => 'postimg')); ?>                            <?php } else {              ?>              <a href="<?php the_permalink() ?>"><?php echo inkthemes_main_image(); ?>              <?php              }              ?>              <?php the_excerpt(); ?>

              <?php wp_link_pages(array('before' => '
' . 'Pages:' . '', 'after' => '
')); ?>              <?php edit_post_link('Edit', '', ''); ?>
          <a href="<?php the_permalink() ?>" class="continue"><?php _e('Continue reading →', 'dzonia'); ?>
          <?php the_tags('Post Tagged with ', ', ', ''); ?>


How to get the path to the current theme?

This code is used to get the directory of the current plugin: `plugin_dir_url( __FILE__ )`. What should I use to get the directory of the current theme?


Why are admin scripts not printed

I am trying to enqueue/print scripts in the admin area. But they dont seem to appear.               add_action('admin_init', function() {         add_meta_box('portfolio-meta', 'Details', 'portfolio_metabox_details', 'portfolio');              wp_register_script('jqeury-validate', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js');         wp_enqueue_script('jquery-validate');         wp_register_script('ae-admin', get_bloginfo('template_directory') . '/js/admin.js', array('jquery', 'jquery-validate'));         wp_enqueue_script('ae-admin');         wp_localize_script('ae-admin', 'WpAjax', array(                 'AjaxUrl' => admin_url('admin-ajax.php')         ));         wp_register_style('ae-validate', get_bloginfo('template_directory') . '/css/validate.css');         wp_enqueue_style('ae-validate');     });      But my script (`admin.js`) does not seem to get printed. I even tried to put those in 'init' instead of 'admin_init' still I dont see my scripts ... why is that? How can I debug?


need help adding a new sidebar to a page that can't use page-templates -> multisite

This problem is quite complex and hard to describe so bare with me. I'm trying to add a new sidebar to my test-page before I put it live. Basically I've got a website with wordpress installed and inside this are 3 sub-directories for other websites. All the pages are linked using http://pastebin.com/gr594PxQ All the sites use the same wordpress admin panel however they seem to use the default index.php template, some pages are different so they must use other templates but these arn't shown in the admin panel. I've yet to find out how to give my test-page a new template as you can't do it in the WP-ADMIN. If I could find out how to achieve this my problem would be simple to solve. at the moment I've tried playing around with an if conditional so different sidebars will appear for different pages. My results return no sidebar at all which is whats confusing me. Here is what I have. http://pastebin.com/anUgJmkh Many Thanks


Dynamic image grid gallery

I want to create a project with the following image grid gallery. I try to do with the using of masonry JQuery ![enter image description here](http://i.stack.imgur.com/O4qvm.jpg) My code : `functions.php`               wp_register_script( 'pkgd', get_template_directory_uri() .'/lib/js/vendor/masonry.pkgd.min.js');     wp_enqueue_script( 'pkgd');      `header.php`                     `category-36.php`

              <?php wp_nav_menu(array('menu' => 'Print-menu'));?>

      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                      <div class="post" id="post-<?php the_ID();?>">

                     <?php the_post_thumbnail(); ?>                       <?php the_content (); ?>

       I upload some images to category but the massory didn't load. How can fix that? Is there any jQuery script that can generate a completely dynamic grid in respect to image size? Thanks in advanced and for any help.


Sharing Dynamic Sidebars across Multisite Blogs

I'm trying to find away to retrive a dynamic sidebar from one blog and print it on another blog in the same install of Wordpress Multisite. I have tried               switch_to_blog($blog_id);     dynamic_sidebar($sidebar_name);     restore_current_blog();      But nothing is returned. I also tired to retrive the sidebar through `get_blog_option($blog_id, 'sidebar_widgets')` but I was only able to retrive an array identify what widgets were used by the sidebar, but I couldn't find away to process the array into a sidebar.


Pagination For Table Rows on a page?

Please See Attached Image Below In Comment I am using a table to display content on my page. I am using the twenty eleven theme. I would like to limit the number of rows on the page. i created a custom sidebar template for the page. anyone have any idea how i can limit the number of rows to 20 rows per page and anything beyond that goes to page two. Thus when i add a new row the last row (20) on page 1 becomes the first on page 2. thank you. i create the tables using html in wordpress. am not using a plugin. as you can see in the image i have the page-navi plugin activated in my template (please refer to code for custom template below) Example of table.

      My Content
     My Content

      If anyone can help i will really appreciate. I have basic code knowledge. if you will, please also advise where i put the code. This is the code for my custom template.                 <?php     /**      * Template Name: SL Sidebar Template      * Description: A Page Template that adds a sidebar to pages      *      * @package WordPress      * @subpackage Twenty_Eleven      * @since Twenty Eleven 1.0      */          get_header(); ?>

                      <?php while ( have_posts() ) : the_post(); ?>                          <?php get_template_part( 'content', 'page' ); ?>                          <?php comments_template( '', true ); ?>                      <?php endwhile; // end of the loop. ?>
     <?php wp_pagenavi(); ?>
          <?php get_sidebar(); ?>     <?php get_footer(); ?>


why does bones theme call the_excerpt function with parameters?

I have been triying to localize a wordpress site which uses Bones as the theme. In the theme's search.php, there is a line that goes:               <?php the_excerpt('' . __('Read more »', 'bonestheme') . ''); ?>      In the function reference it is said that this function does not take any parameters. So why does this theme send parameters?


How can i use this meta box function in my template ? (Wordpress)

this is my function :               $prefix = 'dbt_';          $meta_box = array(         'id' => 'my-meta-box',         'title' => 'Custom meta box',         'page' => 'post',         'context' => 'normal',         'priority' => 'high',         'fields' => array(             array(                 'name' => 'Checkbox',                 'id' => $prefix . 'checkbox',                 'type' => 'checkbox'             )         )     );          add_action('admin_menu', 'mytheme_add_box');          // Add meta box     function mytheme_add_box() {         global $meta_box;              add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']);     }          // Callback function to show fields in meta box     function mytheme_show_box() {         global $meta_box, $post;              // Use nonce for verification         echo '<input type="hidden" name="mytheme_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';              echo '
';              foreach ($meta_box['fields'] as $field) {             // get current post meta data             $meta = get_post_meta($post->ID, $field['id'], true);                  echo '
',                     '', $field['name'], '	',                     '';             switch ($field['type']) {                 case 'checkbox':                     echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';                     break;             }             echo    '',                 '
';         }              echo '
';     }          add_action('save_post', 'mytheme_save_data');          // Save data from meta box     function mytheme_save_data($post_id) {         global $meta_box;              // verify nonce         if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {             return $post_id;         }              // check autosave         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $post_id;         }              // check permissions         if ('page' == $_POST['post_type']) {             if (!current_user_can('edit_page', $post_id)) {                 return $post_id;             }         } elseif (!current_user_can('edit_post', $post_id)) {             return $post_id;         }              foreach ($meta_box['fields'] as $field) {             $old = get_post_meta($post_id, $field['id'], true);             $new = $_POST[$field['id']];                  if ($new && $new != $old) {                 update_post_meta($post_id, $field['id'], $new);             } elseif ('' == $new && $old) {                 delete_post_meta($post_id, $field['id'], $old);             }         }     }      i try to use this code in my template if check box checked :               <?php if ($meta_box = get_post_meta($post->ID, "checkbox", true) ) : ?>     Show this when checkbox checked     <?php endif; ?>      And it doesnt work


Notification mail about high memory usage?

Today morning on valentines I received a shocking mail from my WordPress site,   Don't know what to do, Can anyone help me out in this > Subject: [Online MBA] High memory usage notification Sent: Feb 13, 2011 > 11:33 PM > > WordPress memory usage exceeded 64 MB   >  WordPress peak memory usage: 114.87 MB   >  Number of database queries: 173