title: can't customize facebook sharing basic properties

text:
How can I populate opengraph meta tags with actual post data? How does it work? Right now I have this on my single post template:

      It shows the sharing buttons with counters but it gets a random (i suppose) image from the page. I tried to use a function that was supposed to add the open graph meta tags:                   //Adding the Open Graph in the Language Attributes     function add_opengraph_doctype( $output ) {             return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';         }     add_filter('language_attributes', 'add_opengraph_doctype');          //Lets add Open Graph Meta Info     function insert_fb_in_head() {              global $post;              if ( !is_singular()) //if it is not a post or a page             return;              echo '<meta property="fb:admins" content="912649817492374"/>';         echo '<meta property="og:title" content="' . get_the_title() . '"/>';         echo '<meta property="og:type" content="article"/>';         echo '<meta property="og:url" content="' . get_permalink() . '"/>';         echo '<meta property="og:site_name" content="Vida Nova Imóveis"/>';              if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image             $default_image="http://example.com/image.jpg"; //replace this with a default image on your server or an image in your media library             echo '<meta property="og:image" content="' . $default_image . '"/>';         }else{             $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );             echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>';         }         // echo "";     }     add_action( 'wp_head', 'insert_fb_in_head', 5 );      But nothing is added to the header. The function that adds the opengraph_doctypes works though. I deactivated all plugins from the website and it still doesn't work. How can I pass the post data (image/title/description) to the open graph meta tags? How does it work? Am i obligated to register an app on Facebook to be able to simply share a page with a custom title / image / description? Thanks alot


title: Storing user meta as an array, empty array index shows as "Array" on front end

text: I am storing user meta data as a single entry in the DB as an array. If any of the array index values are empty, when I display the empty data it shows up as "Array". In particular in my user update form on the front end. I've tried setting a default value of '' but I still can't get the user meta value in the form to just be empty. It always shows as "Array" How can I fix this? Thanks in advance EDIT ----------------------------------------------------------------- Here's my code for saving the meta data. Nothing special just the default saving. The Name attribute of my user fields are set up like this meta_key_name[inner_meta_key][inner_inner_meta_key_name] Not all inner_meta_key have an inner_inner_meta_key               //each $_POST is a      foreach( $_POST as $meta_key => $meta_value ):                                //delete old meta value         delete_user_meta( $user_id, $meta_key );                  //use new meta value to update/add         update_user_meta( $user_id, $meta_key, $meta_value );               endforeach;      And my code to display/retrieve the meta values               function ds_get_user_data( $user_id, $meta_id, $key1 = NULL, $key2 = NULL ){                   //$meta_id is the key that stores the array of data as a single value in the wp_usermeta table         $meta = get_user_meta($user_id, $meta_id, true);                   if( $key1 && $key2 )             return isset($meta[$key1][$key2]) ? $meta[$key1][$key2] : false;         elseif( $key1 )             return isset($meta[$key1]) ? $meta[$key1] : false;         else             return $meta;               }//end ds_get_user_data


title: What do I need to do to fully integrate a custom session login into WP?

text: I have a very simple session login using my company's SSO. I just take their authenticated username and sign them in with no password. Right now this sits as a single page. We have 7 used WP installs and counting and would like an easy way to ensure that:   1. It doesn't cause issues with plugins or themes or whatever.   2. User gets proper error reporting   3. The login lasts as long as possible   4. Bonus would be adding user to database if they are not in the WP database already.              require('wp-blog-header.php');                 session_start();                             $appKey = "xxxxxxxxxxxxxxxxxxx";         $safeurl =  'https://safe.xxxxxxxxxxxxxxxxxx.com/login/sso/SSOService?app=playbooks';         // first call back after safe login - POST is set         if ($_POST && isset($_POST['digest']))          {          $digest = $_POST["digest"];          // set the session variables ...          $_SESSION['usernamef1'] = $_POST["firstname"]." ".$_POST["lastname"];          $_SESSION['firstname'] = $_POST["firstname"];          $_SESSION['lastname'] = $_POST["lastname"];          $_SESSION['email'] = $_POST["email"];          $_SESSION['uid'] = $_POST["uid"];         // Needed for key          $uid = $_POST["uid"];          $time = $_POST["time"];          // Read the property file with the key and URL so this won't go into the main code ...          // this sets $appKey and $safeurl          $mykey = "".$uid.$time.$appKey;          $mydigest = md5($mykey);         }             // session is not initialized as we never got the post above to set session vars         // call now the safe login to get the post to set the session vars ...         if (!isset($_SESSION['usernamef1']) || empty($_SESSION['usernamef1']))         {          // Read the property file with the key and URL so this won't go into the main code ...          // this sets $appKey and $safeurl          header("Location: ".$safeurl);         }                      $username = $_SESSION['uid'];         $user = get_user_by('login', $username );             // Redirect URL //         if ( !is_wp_error( $user ) )         {             wp_clear_auth_cookie();             wp_set_current_user ( $user->ID );             wp_set_auth_cookie  ( $user->ID );                  $redirect_to = user_admin_url();             wp_safe_redirect( $redirect_to );             exit();         }


title: Create a post variable processing page

text: I need to create a blank PHP page that processes a POST request. Basically, a site will send me a few post variables. I need to use these variables with the mycred plugin. Here is my code:               require_once("../../../../wp-load.php");     if (isset($_POST['reward_amount'])) {          $toaward = $_POST['reward_amount'];         $user = $_POST['sid'];              if (!function_exists(mycred_add))                 echo "Failed to add!";         if (mycred_add('Points_for_______________', 1, 1, '%plural% for ------ completion', $_POST['oid'] )) {                 echo "Success!";                 //header("HTTP/1.1 200 OK");         } else {                 echo "Fail!";                 //header("HTTP/1.1 412 Precondition Failed");         }     }      This works, but the site I am using does not allow HTML to be returned in the HTTP response. How do I remove the HTML code that is included from `wp- load.php` but still keep the Wordpress function support so I can use wordpress functions? I also tried including `wp-blog-header.php` as well, but to no avail.


title: Custom posts affecting Recent Posts

text: I have built a plugin that uses custom post types. Everything works exactly as it should except when you list posts by category; the recent post widgets just displays the recent custom posts type. http://testblog.co.uk/events-list/ \- All OK (these are the custom posts) http://testblog.co.uk/category/derek/ \- Only Recent custom posts display The plugin has a wp_query call:               $args = array('post_type'=>'event','orderby'=>'meta_value_num','meta_key'=>'event_date','order'=>'asc','posts_per_page'=>-1);     query_posts( $args );      But I can't see how this would affect things. Any suggestions as to where I should start looking? EDIT: Not using pre_get_post so that's not the issue. I do use:               $output_string = ob_get_contents();     ob_end_clean();     return $output_string;      after clearing the query but when I removed this it made no difference. It was a user that alerted me to the problem so it's not my theme (although I have tested using 2014 and all other plugins deactivated). It's got to be a reset not firing in the right place... EDIT 2: Debug is now on and apart from a few undefined variables there isn't anything being reported. EDIT 3: The 'recent posts' list that appears seems totally random. It displays posts and events and deleted items - most bizarre, Debugging is complete - there is one warning related to another plugin that can be ignored. Taxonomy is               $args = array('taxonomies' => array('category','post_tag'));register_post_type('event',$args);      Obviously a lot more labels and args in the plug8in but that's the only reference to categories. Tested using 'tags' and archive queries and al lis ok. So it's only to 'category' queries. Removing the category from the CPT taxonomy makes no difference.


title: Use WP_Filesystem to list files in directory

text:
Is there a way to list files in a directory using WP_filesystem instead of something like:               function listFolderFiles($dir){         $ffs = scandir($dir);         echo '
';         foreach($ffs as $ff){             if($ff != '.' && $ff != '..'){                 echo '
'.$ff;                 if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);                 echo '
';             }         }         echo '
';     }          listFolderFiles('Main Dir');      I want to list all the files and folders in my uploads folder so I was writing something like:               class ff     {         public static function listFolderFiles($dir)         {             $ffs = scandir($dir);             echo '
';             foreach($ffs as $ff){                 if($ff != '.' && $ff != '..'){                     echo '
'.$ff;                     if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);                     echo '
';                 }             }             echo '
';         }     }     $upload_dir = wp_upload_dir();      return New ff::listFolderFiles($upload_dir['basedir']);      but wanted to see if there is a better way..


title: add_image_size() width not actually working

text: I've been attempting to add an image size to my code, for an image that needs to be 708px wide. Height can be variable. I've added the code this way:               add_image_size( 'full-blog-width', 708 );      add_filter( 'image_size_names_choose', 'my_custom_sizes' );          function my_custom_sizes( $sizes ) {         return array_merge( $sizes, array(             'full-blog-width' => __( 'Full Blog Width' ),         ) );     }      However, when I go to add the images in the media library, the width seems to max out at 474px with the height varied based on proportions. I've attempted hard cropping, but that doesn't seem to affect anything but the ratio in the end. Best I can tell, this 474 number comes from the is the width of the blog post container. Does the media library set a maximum size for the images based off the blog post CSS? Is there a way to override this?


title: xypic on Wordpress

text: Is it possible to use xypic on Wordpress (for those who don't know what xypic is, it's a LaTex tool for drawing diagrams- see Wikipedia)? On a related note, is it possible to use the LaTeX package chemfig on Wordpress?


title: Get post id in wordpress action?

text: I have this code               add_action( 'delete_post', 'my_delete_function' );      function my_delete_function() {         global $wpdb;        $wpdb->query("         DELETE FROM wp_votes WHERE post=".$thePostID."     ;);      }      How can I get the id of the post being deleted? Additionally, will this still work if multiple posts are deleted in the admin?


title: How to load JQuery easing script in wordpress?

text: Ok, first of all, I know how to do this manually.   I could just download easing, place it in my plugin folder and load it using `wp_enqueue_script`. However, I want to load my script in a long-term way, ensuring that I use the same version of the easing script wordpress uses. So what I am looking for, is a way to load easing in wordpress using `wp_enqueue_script`, as seen below. I have looked at the function reference for `wp_enqueue_script`, but I can't seem to find the right file/handle to enqueue. Is there anyone who knows how to load the WordPress-native easing script?               //I know this works because I've used it a thousand times already     wp_enqueue_script("jquery");          //I want something like this without having to use my own script     wp_enqueue_script("jquery-easing");


title: Avoid converting ">" to >

text: I'm using a Markdown plugin and trying to write a blockquote > Like this But Wordpress converts ">" to an html entity, so the result looks > like this Is there a way to avoid this?


title: Wordpress protected Pages

text: Would be possible to access the protected pages with password through of a token. What I mean I pass the token by URL, is going to be checked if the page is protected, if yes check if the URL has the token than the token to be check if match or not.


title: A plugin for newsletter registration (not sending, just gathering data)?

text: Most of the plugins I see also send the newsletter, which I don't need. I need a simple, customizable plugin that helps me get user e-mails, name, and other custom fields, and store it in the database. The plugin must also have an unsubscribe option, of course.


title: As a plugin developer, how to deal with theme developer loading jquery from google?

text: Theme developers like to deregister wordpress jquery and load jquery from google instead. I've been told it is for speed and I agree. This usually is not a problem **for me** since I always use **jQuery** instead of **$**. But I do see some plugins try to use **$** , well, it generates javascript error and also makes my plugin not working. As a result, clients blame on innocent me. Sometimes my js code depends on the version of wordpress jquery but theme developers tend to load **a specific version** from google. Even though the theme is updated, they may not update the jquery version, not to mention an old theme. **What should I do in such situations?** Actually, I'm thinking about, maybe I should use Zepto.js instead and include it in my js code. p.s. good news, wordpress 3.6 doesn't allow deregister jquery in its backend.


title: WP custom menus error > menu name already exists?

text: I'm getting a puzzling error when I var_dump on $menu_id in the code below... First, the test code to create a custom menu on the fly and assign it to a registered menu location called "header-menu" (creates the menu but fails in assigning it to the theme's menu location)...               $menu_id = wp_create_nav_menu('my_test_menu_abc_123');     //var_dump($menu_id);die;     wp_update_nav_menu_item($menu_id, 0, array(         'menu-item-title' => 'First Menu Item',          'menu-item-url' => 'http://mysite.com',          'menu-item-status' => 'publish'));     $theme = get_current_theme();     $mods = get_option("mods_$theme");     $mods['nav_menu_locations']['header-menu'] = $menu_id;     update_option("mods_$theme", $mods);      When I var_dump on $menu_id below, its returning... > object(WP_Error)#110 (2) { ["errors"]=> array(1) { ["menu_exists"]=> > array(1) { [0]=> string(102) "The menu name my_test_menu_abc_123 conflicts > with another menu name. Please try another." } } ["error_data"]=> array(0) { > } } It does not matter what I name the menu, I'm always getting this error. Which leads me to believe I have a flaw in the logic of my code below. Although, it still creates the menu fine, and inserts the menu item into it. It just fails to assign the menu to the theme's header-menu location. Any ideas? **Background** : Thanks to the help of @Bainternet, I've managed to come pretty close to a solution. What I'm trying to do is to programmatically create a new custom menu on the fly **[solved]** , then assign that menu to one of my theme's registered "Menu Locations" [ **still not solved** \- and no one else appears to be able to do this], all via script inside a plugin. However, eve though the code above will create the my_test_menu_test perfectly, its not assigning it to the "header-menu" location of the theme. My first clue to a problem, is the fact that the echo statement appears to be in conflict with the code I'm using to create the menu. Here is an external reference I've been using... http://wordpress.org/support/topic/how-to-assign-a-wordpress-3-menu-to- primary-location-programmatically However, its unclear whether the author's solution actually works for anyone else (according to my experience and that of the other responders on the post)... _Interestingly, as some have noted, the assignment of a custom nav menu to a theme's custom menu locations does not appear to be included in the Custom Menu API..._


title: Get ID of "root-page"

text: I have an url that looks like this http://apploadny.appload.nu/tjanster/webbutveckling/ I want to get the ID of the page "tjanster", how can i do that?


title: Metabox doesn't retain values

text:
I have this code in functions.php in order to have a meta box displayed in the backend. The problem is, this was functioning normally until I've moved the website from a subdomain (dev) to the root and now even if the metabox appears in the backend, it doesn't retain the values anymore.               <?php     define('MY_WORDPRESS_FOLDER',$_SERVER['DOCUMENT_ROOT']);     define('MY_THEME_FOLDER',str_replace('\\','/',dirname(__FILE__)));     define('MY_THEME_PATH','/' . substr(MY_THEME_FOLDER,stripos(MY_THEME_FOLDER,'wp-content')));          <?php     define('MY_WORDPRESS_FOLDER',$_SERVER['DOCUMENT_ROOT']);     define('MY_THEME_FOLDER',str_replace('\\','/',dirname(__FILE__)));     define('MY_THEME_PATH','/' . substr(MY_THEME_FOLDER,stripos(MY_THEME_FOLDER,'wp-content')));          add_action('admin_init','my_meta_init');          function my_meta_init()     {         $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;         if ($post_id == '2') {         foreach (array('post','page') as $type)          {             add_meta_box('my_all_meta_home', 'Additional info', 'my_meta_setup', $type, 'normal', 'high');         }         }         add_action('save_post','my_meta_save');     }     function my_meta_setup()     {         global $post;         $meta = get_post_meta($post->ID,'_my_meta',TRUE);         include(MY_THEME_FOLDER . '/meta.php');         echo '<input type="hidden" name="my_meta_noncename" value="' . wp_create_nonce(__FILE__) . '" />';     }          function my_meta_save($post_id)      {         if (!wp_verify_nonce($_POST['my_meta_noncename'],__FILE__)) return $post_id;         if ($_POST['post_type'] == 'page')          {             if (!current_user_can('edit_page', $post_id)) return $post_id;         }          $current_data = get_post_meta($post_id, '_my_meta', TRUE);           $new_data = $_POST['_my_meta'];         my_meta_clean($new_data);         if ($current_data)          {             if (is_null($new_data)) delete_post_meta($post_id,'_my_meta');             else update_post_meta($post_id,'_my_meta',$new_data);         }         elseif (!is_null($new_data))         {             add_post_meta($post_id,'_my_meta',$new_data,TRUE);         }         return $post_id;     }     function my_meta_clean(&$arr)     {         if (is_array($arr))         {             foreach ($arr as $i => $v)             {                 if (is_array($arr[$i]))                  {                     my_meta_clean($arr[$i]);                     if (!count($arr[$i]))                      {                         unset($arr[$i]);                     }                 }                 else                  {                     if (trim($arr[$i]) == '')                      {                         unset($arr[$i]);                     }                 }             }             if (!count($arr))              {                 $arr = NULL;             }         }     }      Would you please help me understand what's wrong? I can't figure this out and is quite frustrating. The code is not changed at all, the output for my metabox is in another php file in the theme root, nothing is changed really. The only thing I can think of, is that developing the website on a subdomain, when I've copied the files to the root I didn't create another database as I didn't need one and have used the one I had and then used a plugin to change all the URL's. And then I've used a plugin to search and replace URL values in the database, but this was happening before altering the database. I can't be this anyway. When I edit the metabox in the back end, I have no error, the post/page is updated, but it's obvious the database doesn't retain the new values and after editing the fields are emtpy. Here's what I have in the meta.php:               <input type="text" name="_my_meta[title]" value="<?php if(!empty($meta['title'])) echo $meta['title']; ?>"/>     Enter in a title               Body text     <textarea name="_my_meta[body-text]" rows="5"><?php if(!empty($meta['body-text'])) echo $meta['body-text']; ?></textarea>     Enter in the body text               Link     <input type="text" name="_my_meta[link]" value="<?php if(!empty($meta['link'])) echo $meta['link']; ?>"/>     Enter in the URL of the link          e.g.  View our Services page       Later edit: This is how I get my metabox values:               <?php      global $wp_query;     $postid = $wp_query->post->ID;     $array = get_post_meta($postid,'_my_meta',TRUE);            echo "
"; echo $array['title']; echo "
";        echo '
'; echo $array['body-text']; echo '
';        echo $array['link']; ?>


title: Wordpress Related Plugin - only show when related content

text:
I'm using the Wordpress related plugin : http://wordpress.org/extend/plugins/related/ Which uses the following markup to call the plugin:               <?php echo $related->show(get_the_ID()); ?>      I would like to add a title and a division around the plugin... but would only like this to display if there is a related post/page. How should I modify the code? This is the result I would like to see, but only when there is related content:
Related products
     <?php echo $related->show(get_the_ID()); ?>


title: Posts and Pages w. private visibility don't show up in existing content

text: when I create or edit a link in the editor (post or page) pages & posts with private visibility don't show up in the "existing content" section of the "insert/edit link" popup. All pages/posts with public visibility are shown. Is there a fix for that behavior? This doesn't make sense as I have all necessary privileges to see and edit these private pages/post. Any help is appreciated! Thanks Heiner


title: Display navigation menu item conditionally based on user capabilities

text: I have one "branch" of my main site's navigation tree that should only be accessible to a set of registered, logged-in users. I understand how to query a user's role and capabilities. This question is specifically about what is the best way to leverage the build-in nav menu, but just hide an item conditionally. Do I need to overload the built-in default navigation and write a custom query and build the navigation structure manually? I'd love to avoid this if possible. I don't need full code samples, just your ideas and general framework / approach. Appreciate the advice! T


title: prefix table and plugins

text: I changed my prefix of my tables from the wp_ to something else for security reasons and good practice etc. I was curious most of new plugins installed take on the new prefix but I have one that refuses and still installs with wp_ it still works but i was curious is that normal practice or just a bad written plugin?


title: Wordpress Admins or Roles per Page

text: I would like to define an admin that has Administrator rights to everything - thats of course possible, its the default functionality. then i would also like to create an admin (or role) that can only edit and see certain PAGES in the backend. i have gone through many plugins but i can't seem to find this functionality anywhere! any ideas? thanks! mark


title: How can I build a query that returns all attachments of a page and it's children pages?

text: I'm using this query to return attachments of a page.               $args = array(         'post_parent' => $post->ID,         'post_status' => 'inherit',         'post_type' => 'attachment'     );      Is there a way to adapt this in order to return attachments for the current page _and_ the attachments of all child pages ?


title: Populate Custom Field Dropdown on Theme Install?

text: Is there a way to populate the custom field dropdown box when you install a theme? I want to make it easier for users and avoid having them add the terms manually when they first set it up.


title: Why are my sidebars not registering in unit tests

text:
I am trying to unit test the function I'm using in a theme to register sidebars. Here is the function from functions.php.               function fp_register_sidebars() {     register_sidebar( array(         'name' => __( 'Sidebar 1', 'fp' ),         'id' => 'sidebar1',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
'     ) );          register_sidebar( array(         'name' => __( 'Sidebar 2', 'fp' ),         'id' => 'sidebar2',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
'     ) );     }          add_action( 'widgets_init', 'fp_register_sidebars' );      Here is the unit test method.               function test_fp_register_sidebars() {         do_action( 'widgets_init' ); // Run the widgets_init hook              /** @var array $sidebars Array containing all active sidebars and their widgets. */         $sidebars = wp_get_sidebars_widgets();              $this->assertTrue( array_key_exists( 'sidebar1', $sidebars ), 'Sidebar 1 is registered at the widgets_init hook.' );         $this->assertTrue( array_key_exists( 'sidebar2', $sidebars ), 'Sidebar 2 is registered at the widgets_init_hook.' );     }      The unit test fails. Looking into this I found that the sidebars are not being updated from the sidebars for twentythirteen to the sidebars for this theme (they stay at sidebar-1 and sidebar-2). I'm switching to my theme in the unit test class setUp() method using switch_theme() and that is successful. Activating the theme on a WordPress environment does correctly register these sidebars so I'm thinking it is something to do with how switch_theme() works.


title: Form to Add Posts to Custom Post Type

text: Basically I want to display a form on my blog (on a certain page) that will allow anyone to fill it out and it will create a post in a custom post type. I saw the answer once before but I can't find it now.


title: Recommended File Permissions

text: Hey guys, I have been spending the longest time trying to figure out this issue. I would like to know what the file permissions should look like in WordPress **in order to use the autoupdate feature**. As of now, my wordpress installation keeps asking me for my FTP information and I do not want to use that method of upgrading/installing, I want to use pure/direct PHP. Some context:   * webserver and php fcgi daemons run as `www-data:www-data`   * wordpress installation is at `/home/blaenk/sites/domain.tld/` At first, I read that all files/folders should be owned by my user (blaenk) and writable by my user. But this wasn't working, after spending many hours researching, someone on the IRC channel told me to try setting _everything_ to ownership `www-data:www-data` and this worked. I was no longer asked for FTP information and the plugin installation worked automatically. However, I originally placed the site files in my home directory precisely because I wanted to be able to write/create them as my user. I even added myself to the `www-data` directory as stated in this guide. ## Question I already know that files should be 644 and directories should be 755. However, this seems more of an issue of ownership. I don't want to have to set `www-data:www-data` on everything in my wordpress installation, so I'm wondering what files/directories specifically require this ownership level? **EDIT** : I believe that the reason for which everything seems to work on my shared hosting wordpress installation despite all of the files being owned by my user is that the shared host I use seems to use suexec which presumably runs PHP as me, so in other words, the files _are_ owned by the webserver, so to speak.


title: Wordpress 3.0 Media Upload Directory

text: I am using Wordpress 3.0 and would like to organize the directory where uploads are made. Is there any way to change where the files get uploaded or is the only real organization the Media tag plugin? What would be ideal is when a user uploads a file, they can specify a sub directory where to dump the file (or default to date). So a user could say "flowers" and the file would go in uploads/flowers. Thanks!


title: How do I use a custom theme for the WP Maintenance Mode plugin?

text: How do I use a custom theme, rather than the themes included with this plugin? Here is the link to the plugin: http://wordpress.org/extend/plugins/wp- maintenance-mode/ I see that under the plugin's settings there is a way to choose "own style" theme and a way to link to custom stylesheet, but I want to use my own html as well.


title: Can WordPress handle these functionalities?

text: I'm a front-end designer/developer whose weapon of choice for the back-end is WordPress. Up to this point all of my projects involving WordPress were fairly basic and it has handled everything beautifully. I just landed a new client that wants some extra functionality built into his next project and I'm hoping some of you WordPress wizards can give me some good advice while I'm putting together the quote. I'm trying to limit the need for any subcontracting for the back-end functionality, so my question is whether or not WordPress can handle the following (via plugins or light custom manipulation): The idea behind the site is to be a community calendar based on location that Health Care providers can log in and post their events to, as well as participate in discussions, blogs and all the other WordPress goodness. The specific functionalities that I'm unsure of the best way to accomplish are:   * Full featured calendar that members with access can add their own events to - must be searchable by date/type of event/location etc   * Event generator module for members that integrates with calendar - includes upload field for images and forms for details event info   * Interactive map to filter both of the above by location (I'm assuming this will need to be flash, but I'd rather find another solution if possible) I know there are other solutions out there that may be more suited to this than WordPress (Drupal, custom build, etc) but if it's at all possible to tackle this as a one man show then I'm going to charge it head-on! Humble web folk and fellow WordPress fans...your insight would be much appreciated. Thanks in advance for your time.


title: Check is category parent or not from its ID

text: question is simple (i don't know is aswer too ;)   I just want to check that, does a category has child (or is ancestor) from its cat-id with a function.   Eg.   `function check_category ($catid){   ............   ...//true if is ancestor, false if not   return $result;   } `   Note: I can only pass cat-id parameter for function because i need to use it in functions.php   Thanks in advance...


title: custom post type - use default or create new?

text: I'm building a website that will only have one post type called Work. This post type will need a field as well. Should I just use the default post type (post) and use custom fields or hide the default post type and create a brand new one called Work? If the former, is there a way to change "Post" to "Work" in the dashboard?


title: w3c validation problem - Twitter share button pulling content

text: I have this twitter share button that pulls 100 characters from the content of the post and its URL for the twitter share.               <a class="popup"         href="http://twitter.com/share?url=<?php             echo urlencode(get_permalink($post->ID));         ?>&text=<?php the_content_limit(100, "");?>">                    It's working but I always get the following validation error ![Error](http://i.stack.imgur.com/L03pP.png) Can someone help me?


title: Custom Menu in Admin doesn't change menu in browser

text:
i've just begun participating these stack overflow forums yesterday and had a great experience with someone who could problem solve with me. working from the admin panel under the themes tab i have what looks like a working theme locations panel. i followed instructions i found for installing the proper php code in the proper functions.php file and then placed it where i wanted it to appear in the proper file for my theme. my issue is it won't actually function the way it was intended, i have 3 different menu's created but the site displays every page i created. i obviously slipped somewhere along the way but i can't find where. here's what i have in my functions.php:                       add_theme_support( 'menus' );          add_action( 'init', 'my_custom_menus' );     function my_custom_menus() {         register_nav_menus(             array(                 'primary-menu' => __( 'Primary Menu' ),                 'secondary-menu' => __( 'Secondary Menu' )             )         );     }                 here's whats in my sidebar.php:

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

           still learning, even posting on this site has a learning curve... thanks for reading this and any help or time is appreciated.


title: limit post by a taxonomy in the admin

text: I have a site with authors from different locations. I have created a taxonomy called locations and has different countries (ex. Canada, Germany). Each author need only to see his country's post for the admin. For example, the author of Canada only can see and edit the post of Canada. Its is just for the admin, not the frontend. Authors should never ever be able to see any other posts. It is possible to limit posts by taxonomy in the admin? thanks!


title: Pass query param to custom page

text: I had to create custom .php file that representing one page on my website. I did it by creating new page in admin panel, and then renaming my .php file to page-customslug.php (where customslug is slug value of created page). This works fine, and I can access my custom file via www.mydomain.com/customslug What troubles me, is sending GET params to this page, like www.mydomain.com/customslug?par=1. In this case I receive 404 Page not found. Any suggestions why is this happening? Thanks!


title: Page to output sub-pages (children)

text: I want to output all sub-pages of a particular page in a neat `ul li` list. Including: featured image, title, and first 50 characters of page content. I'm very new to Wordpress, I've tried reading through the codex and I seem to have found something but I cannot get it to work. First, I have created a new template of "list page" (listpage.php) so that I can choose pages where I wish them to list out sub pages. I still need the content of that page to display, and the `ul li` list to output below, essentially so the client can add some intro text. Here is the code I have from the codex               <?php get_page_children( $page_id, $pages ) ?>      I tried to change the parameters to meet my requirements, the page ID is page 6 (you can see it here) I cannot work out what the `$pages` parameter is meant to be, but looking at other examples on the Codex page it seems that `$all_wp_pages` can be used. So I tried this:               <?php get_page_children( $6, $all_wp_pages ) ?>      And got an error: > Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' > in /mnt/vol2/home/b/a/barkin10/public_html/wordpress/wp- > content/themes/Yasmin/listpage.php on line 27 So I really don't know what I'm supposed to be doing :( Also... Even if this did work, because I have to put the page ID it has occured to me that this `listpage` template will only be useable on the page that the ID corresponds to. I want to be able to give any page a template of `list page` and be able to output the children (featured image, page title and first 50 chars) but no idea how.


title: How to delete in the pages the pre tag added automatically by Wordpress

text: i have been looking around but there is not a specific answer to my issue. I have set up a slideshow by Wordpress, then i paste the short code in the page where i want to display. The slideshow is completely messed up because Wordpress automatically adds `pre` tag before the div containing all the slideshow. If i edit in the browser and delete the `pre` tag, the slideshow is displayed perfectly. I had a look to a demo using the same Theme and actually there is not this `pre` tag. So this is obviously causing the error. I am not espert with PHP but there is the possibility to delete this `pre` tag in my wordpress pages in order to display properly the Slideshow?


title: product export and import using xml

text: I am use eCommerce plugins for the eCommerce support in wordpress I am export my all product using `Tools->export` from my `http://localhost/first` wordpress site and i am try to import in my wordpress another site like `http://localhost/second` and it is not give any error but not display product main image. I am try to debug the code and i found the problem in xml attribute name like               <wp:postmeta>      <wp:meta_key>_wpsc_product_metadata</wp:meta_key>      <wp:meta_value>dtails</wp:meta_value>      </wp:postmeta>      and               <wp:postmeta>      <wp:meta_key>_thumbnail_id</wp:meta_key>      <wp:meta_value>253</wp:meta_value>     </wp:postmeta>      i am not understood how can i change this two attribute value please help me thanks in advance


title: Divide WP_Query posts by date & post type

text:
I have a WP_Query that divides 2 Posts types by date but the functionality is not there. Currently it outputs the dates and posts on the same level like.. **-Date**   -Post   -Post   **-Date**   -Post   -Post   What I would like is to wrap each date and its associated posts inside a div, as well as split the two post types for each date into two columns. ![enter image description here](http://i.stack.imgur.com/NkYYM.png) **Update** I managed to split the posts up by date and wrap them in separate divs, now I just need to figure out how to divide the two CPTs into separate columns under each date **Updated Query**               <?php     $day_check = '';     $index = new WP_Query( array(        'orderby'=>'post_date',        'post_type' => array('cpt1', 'cpt2'),        'posts_per_page' =>12));     while ( $index->have_posts() ) : $index->the_post();        $day = get_the_date('j');        if ($day != $day_check) {           if ($day_check != '') {              echo '

'; // close the divs           }           echo '

' . get_the_date() . '

';        }?>
<?php the_title(); ?>
     <?php $day_check = $day; endwhile; ?>     <?php if ( $index->have_posts() ) :?>                                              <?php endif; ?>


title: Create WordPress pages with PHP

text: I'm using MongoDB to store separate data for a WordPress website and need to be able to create pages with the data from MongoDB rather than from manually created pages in the dashboard. I've searched all over for this and can't seem to find anything for creating pages in the backend. Is this even possible and if so, does somebody know a good starting point or way to do it? Any information would be great.


title: None of the Facebook Like Box Plugins working

text: I have transferred my Wordpress site from Shared Hosting to Digital Ocean. http://livingwithict.com I have installed various plugins for Facebook Likebox and tried to place it under the "Find Us On Facebook" at the right Sidebar. But the like box is not displaying. It was working on localhost as well as the previous shared hosting. But after migrating the site to VPS from Digital Ocean, it stopped working. Thanks in Advanced. Regards, Tushar


title: Admin Posts List (edit.php) by post IDs

text: I'm writing a plugin that creates posts in bulk. I provide a way for the user to set certain parameters of the created posts beforehand. But it would be useful to use the WordPress default "All Posts" (`edit.php`) interface to fine-tune the details after the posts are created. I had a look at the `class- wp-list-table.php` and duplicating its functionality is going to be a lot of work. The best solution would be to just send the user to edit.php - limited only to the posts created by my plugin. I have the IDs of the posts, so I'm looking for a solution like `edit.php?id=1&id=2`, revealing a nice list table with only the posts with those IDs.


title: wp_query() get_col error

text: I'm trying to create an auto search jQuery function by using AJAX to send data to the database and back to the search field. In my wordpress theme, I create a folder called "include" and in there I created a file called "autoSearch.php" In that file I have my PHP code like so:               global $wpdb;          $searchQuery = mysql_escape_string($_POST['value']);          $mypostids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_title LIKE '$searchQuery' LIMIT 5");          $args = array('post__in='.$mypostids);          $res = new WP_Query($arg);            $titles ="";          while ( $res->have_posts() ) : $res->the_post();         $titles .= get_the_title().'<br />';     endwhile;          echo json_encode(array("everything"=>$titles));     wp_reset_postdata();      However, I get the error: Fatal error: Call to a member function get_col() on a non-object. I have no idea why that's happening. Thanks for the help in advance.


title: GUID not updated on import

text: I've exported data from my dev server and imported it to my prod server.   One template is listing child pages and uses `$page->guid` to get link to page. The problem is that this link still points to my internal dev server. Has anyone else had similar problems? And if yes, how do I solve it without having to edit my DB directly?


title: Domain Mapping for Wordpress MU and https redirection - How to?

text: Ok, here is my setup. I have a Wordpress MU site setup which uses domain mapping. The root of the site is greatwhitehosting.com.au. Any other site I add using domain mapping works fine and all sites are set to use the primary DNS name as the primary domain. IE say I have a subdomain site greatwhitehosting.com.au/site1 I have set it's primary domain as site.com and typing this in a browser works perfectly fine so this means domain mapping is working correctly. The issue I have is that I want to use my certificate (assigned to greatwhite) for authentication on these domains FOR THE ADMIN SECTION ONLY. This is possible by configuring domain mapping to redirect the admin control panel to greatwhitehosting.com.au/site1. Again this works perfectly fine if I manually browse to https://greatwhitehosting.com.au/site1/wp-login.php. Now here is the issue - I want all http traffic to admin sections (logins etc) to be over a https. I have heard this is possible using rewrite rules in Apache. I have found the code and added it to my httaccess file as follows:               RewriteCond %{HTTPS} !=on      `RewriteRule ^wp-login\.php$ https://greatwhitehosting.com.au/wp-login.php [R=301,L]` The problem I have is that two redirects happen at once and ultimately screw up the redirection. When you use domain mapping and login to the site it tries to redirect you back to site1 using some kind of redirection technique built into the domain mapping plugin. But because Apache also redirects this URL to a https URL it gets screwed up. How do I fix this?


title: Where can I find documentation for the WP_UnitTestCase factory classes?

text: In recent versions WP_UnitTestCase has included a $factory property. For example: `$post = $this->factory->post->create();` Where can I find documentation on this useful feature?


title: Woocommerce price including tax with formatting from options

text: Af first, I'm not a programmer. In Woocommerce I need to display both product prices, including tax and excluding tax. Code in price.php               <?php if ( $price_html = $product->get_price_html() ) : ?>      is showing default price we entered as product price (this price is excluding tax). I have a problem with displaying price including tax - I'm using this code I found at stackoverflow:               <?php echo $product->get_price_including_tax(); ?>      But the price this code is showing is without formatting and currency I set in Woocommerce settings. Can you help me with this? How to display price_including_tax with proper formatting and currency? I will use this code in some woocommerce template pages, I'd like to avoid editing functions or classes if possible.


title: Return number of items in a table with post id

text: I am trying to return the number of reviews for a given page id, I have this so far...               <?php     global $wpdb;     $countreviews = $wpdb->get_var($wpdb->prepare("SELECT COUNT(ID) FROM $wpdb->wpcreviews     WHERE page_id = ID"));     echo 'Number Of Reviews ' . $countreviews . '';     ?>      Its not working and I assume its the end part page_id = ID How do I change the ending to that it searches the wpcreviews table for items with the current page ID, which is the same as my post id?


title: Sort custom post type list table by display name of a user id stored as post meta value

text: I have a custom post type named `domicile`. Each post (domicile) has an _owner_ (not the _author_ ). Owners are users with a custom role. I store the user id as a post meta value (`dmb_owner`) for the `domicile` post type. How do I sort the list table (`wp-admin/edit.php?post_type=domicile`) by the display names of owners? The relevant code from my class, `setup_columns()` is called on `init`:               /**      * Manage columns for List Table.      *      * @wp-hook init      * @return void      */     protected function setup_columns()     {         add_filter(             "manage_edit-{$this->post_type}_columns",             array ( $this, 'set_column_header' )         );              add_action(             "manage_{$this->post_type}_posts_custom_column",             array ( $this, 'render_columns' ),             10,             2         );              add_filter(             "manage_edit-{$this->post_type}_sortable_columns",             array ( $this, 'set_sortable_columns' )         );              add_filter(             'request',             array ( $this, 'prepare_orderby' )         );     }          /**      * Register column headers.      *      * @wp-hook manage_edit-{$this->post_type}_columns      * @param  array $columns      * @return array      */     public function set_column_header( $columns )     {         unset (             $columns['author'],             $columns['comments'],             $columns['date']         );         $columns['owner'] = __( 'Owner', 't5_domicile_manager' );              return $columns;     }          /**      * Display cell content.      *      * @wp-hook manage_{$this->post_type}_posts_custom_column      * @param string $column_name      * @param int $post_id      * @return void      */     public function render_columns( $column_name, $post_id = 0 )     {         if ( 'owner' === $column_name )         {             $owner_id = get_post_meta( $post_id, 'dmb_owner', TRUE );             if ( $owner_id )             {                 $owner = get_user_by( 'id', $owner_id );                 print $owner ? $owner->display_name : '<i>not set</i>';             }         }     }          /**      * Register sortable columns      *      * @wp-hook manage_edit-{$this->post_type}_sortable_columns      * @param array $columns      * @return array      */     public function set_sortable_columns( $columns )     {         $columns['owner'] = 'owner';         return $columns;     }          /**      * Set custom sort order.      *      * @wp-hook request      * @param  array $vars      * @return array      */     public function prepare_orderby( $vars )     {         if ( isset ( $vars['orderby'] ) && 'owner' == $vars['orderby'] )         {             $vars = array_merge(                 $vars,                 array (                     'meta_key' => 'dmb_owner',                     'orderby'  => 'meta_value_num'                 )             );         }         return $vars;     }      This … works, but it is obviously wrong, because it sorts by the stored ID. I have to filter the query – but I am not sure how exactly I should do that. _Sorry for the title, but I want to make sure this will be found. I searched very hard and found nothing useful._


title: Notifications Bar on home page only

text: Is it possible to create an "Alert" button that can be turned on and off thru wp-admin. Of course the "Alert" button im asking for is to be published at the main page, but can only be turned on when its needed. Im using wordpress with jqueryMobile for your information. **EDIT:** Its pretty hard to explain this. But i found this plugin and it does what im after. Except this plugin show the notification on everypage - even wp-admin. To the question: **Is it possible to create a notification/menubar that can be tunerd on/off from wp-admin. The idea behind this is to show important "news" whenever.**? **Whats the best solution?**


title: Custom post-type custom query - show all posts

text: I've got a taxonomy archive to show custom post-types, its got a custom query calling the posts - I can't figure out where to put showposts in it.               global $wp_query;          $term = get_term_by( 'slug', get_query_var($wp_query->query_vars['taxonomy']),               $wp_query->query_vars['taxonomy']);          if (have_posts()) : while (have_posts()) : the_post(); ?>       In case anyone's wondering I've tried using a new or standard query, but it seems to break some of woocommerce's functionality. So basically Id like to modify the above query to show all posts... any ideas? thanks!!


title: Is there any way to write custom HTML is some .php file and then call it wherever necessary?

text: I'm an absolute newbie as far as wordpress and php are concerned.So I wanna write some custom HTML and re use it again and again just like 'headers' and 'footers'.I have googled a lot but haven't find anything useful.Can anyone point me in the right direction?


title: Getting the correct value for a post

text: I have a taxonomy called state which lists all the states. When I create a post I want to select the taxonomy, but also have the name of the state automatically captured in a custom field as well. I've manage to get this code working, however I'm having trouble getting the correct value from that post. A state name is being copied but it's from a different record. I know it has to do with the foreach, but when I put the postid it does not work. Also, it should work whether I do it through the admin, or via the front end in a form that submits or edits the post. Here is the code, any help is appreciated. Thanks               add_action( 'save_post', 'add_state' );     function add_state( $post_id ){         // Bail if we're doing an auto save         if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;         //check if they selected your state term         $state = get_terms('state', 'name');         foreach ( $state as $state );              //insert post meta         update_post_meta($post_id,'state',$state->name);     }


Tried to install a wordpress plugin on my local machine: > To perform the requested action, WordPress needs to access your web server. > Please enter your FTP credentials to proceed. If you do not remember your > credentials, you should contact your web host.               Hostname          127.0.0.1     FTP Username      macusername     FTP Password      macusernamepassword     Connection Type   Connection Type  FTP      When I click proceed, I get this: > Failed to connect to FTP Server 127.0.0.1/:21 Why doesn’t WordPress work with my FTP data?


title: Regular security checks - what steps should be included?

text: There are heaps of tutorials explaining how to secure a WordPress installation, but I couldn't find any that listed out steps for weekly or monthly security checks. What are some steps that you recommend I perform on a regular basis to keep WordPress secure (besides updating core and plugins)? Here are some things I've implemented already:   * Forced all other users to only run as Editor   * Deleted unused themes and plugins   * My theme is custom written, so I know that there aren't any scripts like `timthumb.php` in it. It's also powered by Genesis which features automatic theme updates.   * Change my admin password every few months   * Automatic backups with VaultPress The main reason why I'm concerned is because my client's hosting provider is not very WordPress friendly and I have to run with 777 permissions. However my client is the only site on the box. Anything else I should be doing regularly to make sure the site is locked down? Thanks


title: wp_users user_status field

text: I have found an answer to my question here but it's 7 years old. I simply want to know if I can use this column for my own purposes. I'm planning to use the `user_activation_key` column to store a hashed key upon user registration and set an inactive flag in the `user_status` column. This flag will prevent users from logging in until their e-mail address has been verified.


title: Store Snapshot created via wordpress to use with lightbox

text: i know this is a bit of a weird question but its a real time saver   so if you got any ideas (even partial) i would really apreacate them :) Ok... so i am using wordpress built in interface to capture and disply   remote website images... here is the shortcode i am using..               /*********************************************************************     ** SNAPSHOTS     *********************************************************************/     function wpr_snap($atts, $content = null) {             extract(shortcode_atts(array(                 "snap" => 'http://s.wordpress.com/mshots/v1/',                 "url" => 'http://www.sagive.co.il',                 "alt" => 'My image',                 "w" => '400', // width                 "h" => '300' // height             ), $atts));              $img = '';             return $img;     }          add_shortcode("snap", "wpr_snap");      (How to use this: http://wordpress.stackexchange.com/a/38293/7990) . thats easy no problem.. but - what if i want to integrate it with lightbox.. since its not an image hosted on my website is ther any way to access that images or even write somthing that would upload the image and make it the feautred image of that specific post (a strech i know) or maybe store it elsewhere somehow? (without a plugin).. to try and grab the image i have made a second shortcode that does the same snapshot but doesnt wrap inside image tag for the href with the lightbox class..   . this is the line in the theme:               <a class="lightImages" href="<?php echo do_shortcode('[snapurl url="http://www.sagive.co.il"]'); ?>"><?php echo do_shortcode('[snap url="http://www.sagive.co.il" w="175px" h="125px" alt="'.get_the_title().'"]'); ?>      .   any ideas?


title: Weird characters in title if it contain “ ”

text: If my post title contain `“ ”` all the title stored in the database title column in weird characters like this `"الأورومتوسطى للشباب" تبدأ تلقى استمارات أنشطة الجمعيات الأهلية` I searched more & more but all i found is some advices to change the table encoding to `UTF8` it is already `UTF8` After some tests i found that the problem is came from `feedwordpress` plugin not from WordPress itself How to solve this?


title: current-user_can not working in loop

text: I am using the following loop to show the-content for only contributors as well as Google visitors. But somehow it is not working.                   <?php if (have_posts()) : while (have_posts()) : the_post();?>     <?php if (current_user_can(‘contributor’) || strpos($_SERVER[HTTP_REFERER], "google") == true) { ?>     <?php the_content('');?><?php } ?>     <?php endwhile; ?>     <?php comments_template(); ?>     <?php else : ?>     <?php endif; ?>      Please help me on this.


title: Top Admin Bar Never Shows Up

text: So I recently moved a site to a new domain and updated the URL to reflect the changes in the database as well as in the wordpress backend. wp_head and wp_footer are placed respectively in header.php and footer.php, however the top admin bar has never shown up. Any help would be greatly appreciated.


title: Custom slug in url for CPT and taxonomy

text: I want to add a custom slug to permalink for CPT and taxonomy. Like this:               http://mydomain.com/my-custom-slug/post-slug     http://mydomain.com/my-custom-slug/product_category      Here is my CPT and taxonomy code:               $args = array(         'query_var'           => 'product',         'capability_type'     => 'post',         'rewrite'               => array('slug' => 'my-custom-slug'),     );     register_post_type( 'product', $args );      This above CPT `product` output desired permalink,               http://mydomain.com/my-custom-slug/post-slug      but it give error 404. and same thing happen with taxonomy:               register_taxonomy('product_category', array('product'), array(         'hierarchical' => true,          'rewrite' => array('slug' => 'my-custom-slug', 'hierarchical' => false, 'with_front' => false)     ));      please tell me how do I fix this. Thanks for the help.


title: Populate Website URL at registration time

text: I am trying to automatically populate/set the "Website" under Contact Information in user profiles at registration time. I want the URL to go to their Author Archives page (i.e., http://mywordpresssite.com/author/Tom/) I am using the Paid Memberships Pro plugin for registration. I am also using Theme My Login if that makes any difference, but not for registration. The code below doesn't work because it seems that the URL for the author posts hasn't been created yet. I have tried so many different things and now I'm stumped!               function change_user_url($user_id) {             global $user_login;                  get_currentuserinfo();                  $display_name = $user_login;                  $website = get_author_posts_url();             $website = $website . $display_name;                    wp_update_user( array( 'ID' => $user_id, 'user_url' => $website ) );              }            add_action('user_register', 'change_user_url');


title: WP_Error handles errors, but how can I show success with a message?

text: My script accesses an api to populate posts. I can add any errors to the WP_Error class, but can I add success messages to a global variable?


title: Alias domain to Multi-site installation in Apache

text: This is regarding to set an Alias domain to Multi-site installation. We want to create a short domain as alias to my main website(Multi-Site enabled).I have tried it using a most common options like... 1)Creating cname records, 2)pointing to main installation location as addon domain 3)Domain parking When we try the first two options it is redirecting to sign up page of Web- Site(I think Wild card redirect for Multi-site installation is the reason). The third option is making is showing an error :"Debugging a Wordpress Network" I think that I should configure it in Apache to solve the problem(I have root access).But I am not aware of dealing with Apache When we contact our host,they are not trying to look in to the issue and simply said that they would re-install the whole web-site again. I don't want to do that. Could anybody help me with this **Update** : I needed this domain Alias for a plugin which enable us to shorten the URL with out any third party service . I have Doncha's **Domain mapping plugin** installed and I don't know how to use it in this situation Thanks! **Update 2 :** : I mean to say that the domain mapping plugin doesn't work with main site.It is only useful to map the sub-domains under a multi-site installation. I read some where over internet that the main site cannot be aliased with this plugin as it causes some problems . Could any body help to alias the main site in an alternative way ? Thanks !


title: API for wp menu hacks

text: Question changed due to new developments! I was loooking for a way to hack the menu items in the custom menu page to add a "hide" checkbox and other options. The only way I found is to override the Walker_Nav_Menu class. I think it's a quite tricky solution... In the wp_nav_menu codex anyway i found many examples with filters and action to hack custom menus. Nevertheless I haven't found any documentation about these hacks. Another idea I had is to treat menu items as custom post (they are actually), so i was wondering if the custom field api could be helpful for my purposes. Any suggestions? OLD QUESTION: There is one big but simple feature that is missing from WP and I really can't understand why!!! There isn't any way to just hide front end menu items without deleting them completely! If for example I have a complex menu with many items and submenus and i want to hide it for a while, it's not possibile to do it! Just a checkbox with a display option would be enough. It's me missing something? If it's really missing, is there an API to modify the Appearance>menu section to add more capabilities?


title: wordpress in wamp lan doesn't load css

text: I use wordpress in a lan with wamp. I can correctly see the lan from client pcs. It works perfectly with non wordpress websites so i don't think it's a lan setting problem. Is there any particular setting i should set in wordpress? Actually, it loads correctly, but without JS and CSS. UPDATE, here's how CSS and JS are loaded in the plugin:               function agenda_my_scripts() {     if ( !is_admin() ) {         // datepicker         wp_enqueue_script( 'custom-datepicker', plugins_url( 'sys/js/datepicker.js', dirname(__FILE__) ), array('jquery') );         wp_enqueue_script('jquery-ui-datepicker');         // CSS         wp_register_style( 'agenda_css', plugins_url( 'sys/css/style.css', dirname(__FILE__) ) );         wp_enqueue_style( 'agenda_css' );         // jQuery CSS         wp_register_style( 'jquery_ui_css', plugins_url( 'sys/css/jquery-ui.css', dirname(__FILE__) ) );         wp_enqueue_style( 'jquery_ui_css' );     }      } add_action('wp_enqueue_scripts','agenda_my_scripts'); Then the child theme have the classic configuration:               /*     Theme Name:   Theme name     Theme URI:    -     Description:  Description     Author:       Author     Author URI:   -     Template:     child_template     Version:      1.0     Tags:         -     Text Domain:  child_template     */          @import url("../twentytwelve/style.css");      where 'template' and 'text domain' match folder's name. Moreover, if i activate the child theme, it loads twentyfourteen!! This is very weird...


title: Update page breaks permalinks

text: I am having a strange side effect since going to 3.3.1. When updating pages (or creating new ones) all of my permalinks break - clicking view page on the updated page in question will result in 404 not found. This does not happen with posts. I was concerned it might be an issue with my new schema for permalinks /%postname%/ but I swapped it to YEAR/POSTNAME and did not see any difference. I checked and found a few duplicates in the post-name fields, I changed or deleted any questionable repeats. Still no change. Here is my htaccess -               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      I've also looked at MonkeyMan's Rewrite analyzer and nothing seems amiss there. Any advice would be appreciated. Let me know if there is other information you need.


title: Insert a div before the wp_nav_menu

text: How do I go about inserting a custom div before the wp_nav_menu() adds the ul? The problem is that the script is inserting my 'div menu button' after the nav ul instead of before it. I am trying to do this via a function because the basic idea is that on some of my menus I need to insert a div with a 'menu' button for users to click on to fire a dropdown. *I had to modify my code below because the editor keeps removing my div code from displaying. Suffice it to say I am using a proper opening and closing div Here is a link to 'proper' code as I can't figure the editor out on stack. https://gist.github.com/3120416               function tumble_menu( $args = array() ) {         /* Default arguments */         $defaults = array(             'container'         => 'ul',             'menu_class'        => 'nav',             'menu_id'           => 'top_nav',             'theme_location'    => 'top-menu',             'echo'              => true,             'before'            => '',             'after'             => '',             'link_before'       => '',             'link_after'        => '',             'depth'             => 1,             'sort_column'       => 'menu_order',             'walker'            => ''             );         $defaults   = apply_filters( 'tumble_nav_default_args', $defaults);         $args       = wp_parse_args( $args, $defaults );                                   $main_menu = wp_nav_menu( $args );      } function tumble_add_menu_wrapper($html, $begin, $end) { // wrap our original HTML with the new tags $html = $begin . $html . $end; return $html; } add_filter( 'tumble_menu_wrap', 'tumble_add_menu_wrapper', 10, 3 ); function tumble_do_menu_wrapper() { $html = tumble_menu(); echo apply_filters( 'tumble_menu_wrap', $html, 'div class="menu-button">Menu/div>','' ); } ` **Update** My question was a little confusing. I was not trying to wrap the navigation in a div element, but rather was trying to insert a self contained div prior to the navigation ul element being output. Somehow the wp_nav_menu() function is not allowing this. If I use a 'standard' html element instead, then my wrapper function works perfectly. I would like to learn someday why this simple php logic works, but not with wp_nav_menu() but I suppose that is a question for another day. Thanks Chip for the info!


title: Multisite sub-site dashboard redirects to /wp-admin/

text: I have successfully set up WordPress Multisite on a linux server. I'm able to add sites using Super Admin. When I go to Dashboard > Sites, I see the following: **Site 1** - The main Multisite website **Site 2** - A site I have recently added When I select "Dashboard" for Site 2, I am redirected to the dashboard for Site 1. To visit the dashboard on Site 2, I have to visit http://site2.mydomain.com/wp-admin via my browser. I'm a little baffled to why this is happening. Wildcard DNS is switched on for the domain. Here's the .htaccess code:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^(wp-(content|admin|includes).*) $1 [L]     RewriteRule ^(.*\.php)$ $1 [L]     RewriteRule . index.php [L]


title: Whenever I try to publish a post in wordpress, I always get redirected to the installation page...why?

text: Whenever I try to publish I post, I get redirected to the /wp- admin/install.php page. The file install.php is on the server but do I have to delete it? I recently updated a handful of plugins and after the update finished, the redirect started happening. Happens on Firefox and Chrome (the latest versions). I'm just wondering why would Wordpress redirect to the installation page everytime I try to publish a post? And then after the redirect occurs, if I try to relogin to wordpress or go to the wp-admin page, and each page redirects to the installation page. The url would look like this: mysite.com/wp-login.php/wp-admin/install.php. I don't understand. Help would be appreciated. And yes, I did clear the cache on both browsers. I'm using the latest version of wordpress. EDIT: Maybe after about 5-8 minutes, the site would work again and not redirect. But the redirect would happen if I tried to publish a post again.


title: Executing jQuery in a plugin

text: I have the following code in my plugin main file :               function my_function() {     ?>     <script type="text/javascript">          jQuery(function () {                 alert('jQuery');         });     </script>     <?php     }     add_action("wp_footer", "my_function");      My website does have jQuery loaded and operational (lots of features on my page use it and they work). Yet this alert() doesn't work. Why is that ?


Has anyone effectively integrated GD star rating and Cube Points? From the documentation: > Plugin Integration CubePoints can also be easily integrated with other > plugins. Other plugins can be coded such that certain actions trigger the > cp_alterPoints() function to add or subtract points from a specified user. **Function**               cp_alterPoints( int $uid, int $points )       **Parameters** > int $uid: ID of a Wordpress user. To get the ID of the current logged in > user, use the cp_currentUser() function. > > int $return: Number of points to add to the specified user. Example The following code will add 10 points to the current logged in user. If no user is logged in, no points will be added. You may input negative number to subtract points.               <php       if( function_exists('cp_alterPoints') && is_user_logged_in() ){         cp_alterPoints(cp_currentUser(), 10);         cp_log('hey', cp_currentUser(), 10, 1);       }     ?>      In this case, I would like to add 10 points to the user, if his or her post is voted (GD star rating's thumbs rating system). But I have no idea how to do that. Any suggestions?


title: Is it possible to remove username field from the registration page? If so, how?

text: Is it possible to remove the username field from the registration page? I want the users to enter only their email and password.   A new user should be created based on these two parameters only. Is that possible and if so, how?


title: Not able to get random post

text: I want to display a single random post out of the 5 latest posts in the category 'news'.   The approach I'm using is this:                 // Custom function to retrieve catgory ID by category name.       $cat = $lib->getCatIDbyCatName('news');       // Retrieve the 5 latest posts       $news = get_posts( array( 'numberposts' => 5,'category_name' => $cat ) );            foreach($news as $post) : setup_postdata($post);          echo the_title();          echo the_intro(); // <- Custom function to retrieve custom field       endforeach;      The above code works and I'm dispalying the title and the custom value of all 5 posts. Now I only want one random post out of these 5 posts. So I do this:                 // Get a single random post from fetched posts       $single_news = $news[rand(0, 4)];            foreach($single_news as $post) : setup_postdata($post);          echo the_title();          echo the_intro(); // <- Custom function to retrieve custom field       endforeach;      This however, is not working. Does anyone have any ideas of what I can do? OR maybe a better solution?


title: Is there a way to specify an extra class for a post or page with no title?

text: If I do a post or a page with no title, I'm left with an empty `h1` tag at the top of the post/page. I'd like to either get rid of the `h1` in these cases, or else be able to add an extra CSS class to the post/page so that I can specify how to display the post (and the `h1`) differently when the post/page is published with no title. Are either of these things possible? Thanks.


title: Place the page title into the short code

text: I have created a short code called `[contianer-narrow][/container-narrow]` which wraps your content in a twitter bootstrap class: `.container-narrow` the issue is that the page title is not included. is there a way to say: `if this short code is used, include the page title, else forget it?`


title: Wordpress Rewrites - How can I pass a variable to Custom Post Type?

text: I'm looking for a wordpress rewrite that will let me pass a query var. I have a custom post type that produces urls like this: example.com/custom-post-slug/custom-post-title/ my goal is to have example.com/custom-post-slug/custom-post-title/cid/10/ Pass the value 10 into cid Any suggestions?


title: Using PIE CSS in WordPress. "localizing" styles

text: I read before I can use wp_localize_script to replace a string in a file (adding path to admin-ajax). what if I want to do something similar, but to the template directory for CSS? PIE will get the URL relative to the document not CSS


title: Custom user registration

text: I want to Implement custom user registration process in my wordpress theme. Can anyone please explain me the complete process for user registration. **Note:** I don't want to use default register action of wordpress. I know that we can register users through url: > `http://site-name.com/wp-login.php?action=register` I want to design my own user registration form. So kindly do not suggest any plugin or gravity forms or any other third party software/plugin.


title: get_post random and order by not working

text:
I have this code that returns list of post title as links, but when I add the 'orderby' and 'order' parameters - it returns results but 'orderby, order, rand' do not work, can anyone tell me what I'm doing wrong? Thanks!
        <?php $post; $cat_posts = get_posts(array('numberposts' => 10, 'orderby' => 'rand', 'order' => ASC, 'category' => $disciplineCatID));        foreach($cat_posts as $post) : ?>        <?php $postTitle = get_the_title(); if($title != $postTitle) :?>
<a href="<?php the_permalink(); ?>">›› <?php the_title(); ?>
        <?php endif ;?>        <?php endforeach; ?>


title: How do I find PHP file that contains content of my page?

text: Let's say I have created a page in admin dashboard and put some content in it. How I can find PHP file in my hosting file manager that contains that content? ![screenshot of issue](http://i.stack.imgur.com/j6vJn.jpg)


title: Post from front-end only by logged in users, form posts as "posted by: <logged-in user's username>"

text:
I've handrolled a form for posting from the front-end, with some custom functions that I needed. However, I've made the form only accessible when a user is logged in, and I'd like to have the articles show up as being posted by that user. Thoughts?? Here is my current code: backend:               if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && ($_POST['action']== 'new_post')) {         $has_errors = false;              $title = $_POST['title'];         $tablature = $_POST['tablature'];         $performer = $_POST['performer'];         $composer = $_POST['composer'];         $submitter = $_POST['submitter'];         $cat = array( $_POST['cat'] );              if(!isset($title)) { echo '
Title required.
'; $has_errors = true; }         if(!isset($tablature)) { echo '
Description required.
'; $has_errors = true; }         if(!isset($performer)) { echo '
Performer required.
'; $has_errors = true; }         if(!isset($composer)) { echo '
Composer required.
'; $has_errors = true; }         if($cat == -1) { echo '
Please select a category.
'; $has_errors = true; }              $tags = $_POST['post_tags'];         if (!$has_errors){         // Save <title>  by: <performer>         $title .= " by " .$performer;              // Save Composed by: <composer> Performed by: <performer> <tablature>         $content = "
Composed by: ".$composer."

Performed by: ".$performer."

Submitted by: ".$submitter."

".$tablature;              $new_post = array(             'post_title' => $title,             'post_content' => $content,             'post_category' => $cat,             'post_status' => 'draft'         );         wp_insert_post($new_post);              // save email and submitter as post meta in custom fields         wp_redirect( home_url('/thank-you/') );     }      } frontend:
     <form id="new_post" name="new_post" method="post" action="">
Submitted By
     <input type="text" id="submitter" value="" tabindex="1" size="20" name="submitter" class=”required” minlength="3" />

Email Address
     <input type="text" id="email" value="" tabindex="2" size="20" name="email" />

Song Title
     <input type="text" id="title" value="" tabindex="3" size="20" name="title" class=”required” minlength="3" />

Composed By
     <input type="text" id="composer" value="" tabindex="4" size="20" name="composer" class=”required” minlength="3" />

Performed By
     <input type="text" id="performer" value="" tabindex="5" size="20" name="performer" class=”required” minlength="3" />

Song Body
     <textarea id="tablature" tabindex="6" name="tablature" cols="50" rows="6" class=”required” minlength="50"></textarea>

<?php wp_dropdown_categories( 'show_option_none=Category&tab_index=7&taxonomy=category&exclude=5&class=required' ); ?>

<input type="submit" value="Submit" tabindex="8" id="submit" name="submit" />
     <input type="hidden" name="action" value="new_post" />     <?php wp_nonce_field( 'new-post' ); ?>     </form>
      Thanks!


title: Follow me for wordpress blogs (multi-authors)

text: If we have a blog with multi-authors is there a way for each to have a follow me twitter button separated. Meaning when we see the post of an author we see only the twitter button with the author account. Or because is a one blog the only option is a Follow us button meaning one account for all the authors?


title: Why does wp_get_object_terms add a period after terms are output?

text:
I'm using the following line to output an unordered list of taxonomies and their associated terms for a custom post type. The only problem with it is that a period gets added after the term.               wp_get_object_terms( $id, the_taxonomies( 'before=

&sep=

&after=

' ) );      Here's what it outputs:

Taxname: Taxterm.

      Is there an argument I can add to `wp_get_object_terms` to remove the period?


title: Trying to display next and previous set of posts on separate page (not parent page)

text:
If anyone has any suggestions or know what I'm doing wrong would be a great help. I'm wanting 3 custom news posts per page and then links to the next list of news items and so on. I've tried next page not posts plugin and this takes me to the next parent page which would be contact page. Thanks               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;?>
<?php echo "Page " . $paged;?>
     <?php      $loop = new WP_Query(array(     'post_type' => 'news',     'paged' => $paged,     'posts_per_page' => 3,     'orderby' => 'menu_order'     ));     ?>        <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>          <?php get_template_part('news-single', get_post_format() ); ?>          <?php endwhile; // end of the loop. ?>

<?php  previous_posts_link('Previous') ?>

<?php  next_posts_link('More') ?>


title: WP_query exclude a category unless it has more then one catagory

text: I have this category `exclude_cat` with id 39 I want to exclude it from the home. So I use for `WP_Query` args like this:               $args = array (       'category__not_in' => array( 39 ), //exclude ID     );      Works. But now I want to only exclude it if is the only category on the post.   So exclude the `exclude_cat` post only if it is the only category of the post, if it has `exclude_cat` and `random_cat` I do want to include it. Is there a way to do this using `WP_Query`?   If not what's the best way to do this otherwise?


title: How to redirect to post if search results only returns one post

text: I want to send visitors to my search.php after a search to display list of posts. If there is only one search result, user can directlyto the post in question(something like GOOGLE's I am Feeling Lucky Button) Thank you all.


title: Structure and Display Content from Multiple Pages on Single Page

text: I am trying to display the content from multiple pages on a single page. However, for each page I need the title, excerpt, content and featured image. The display of each page's content has a different structure, therefore I need control over the HTML elements and their classes and ID. I also need to be able to control the order. I've read what seems like 20 forum posts and blog articles, but none of the solutions enable control of the HTML structure for each specific set of page content, nor the order in which they are shown. If anyone can assist, I'd be grateful.


title: Control time of addition of posts to RSS?

text: I have a friend who is trying to control when posts get added to the RSS feed, not when they get added to the site. Is there a way to duplicate the date published section in admin, but for the RSS feed so they can be scheduled separately?


title: delete user not working

text: Im just noticed that when I try to delete an user does remove the user, but not their comments. Also choosing the option to change the deleted user's post author to admin does not work either. Is there an action that I could use to just write my own code to make these work?


title: Quicktags on all textarea.. Not working on plugin?

text: I want to put a couple of quicktags/buttons on a textarea which is outputted by a plugin called **user submitted posts**. I have given this textarea an unique id and read this on the Quicktags documentation: >   * Run quicktags(settings) to initialize it, where settings is an object > containing up to 3 properties: >   * settings = { >   * id : 'my_id', the HTML ID of the textarea, required >   * buttons: '' Comma separated list of the names of the default buttons to > show. Optional. >   * Current list of default button names: > 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close'; >   * } * >   * The settings can also be a string quicktags_id. * >   * quicktags_id string The ID of the textarea that will be the editor > canvas >   * buttons string Comma separated list of the default buttons names that > will be shown in that instance. > Than, I put this in my **functions.php** :               <?php     add_action('admin_print_footer_scripts','my_admin_print_footer_scripts');     function my_admin_print_footer_scripts()     {     ?>     <script type="text/javascript">/* <![CDATA[ */              var id = "myID"; // this is your metabox's textarea id              settings = {             id : id,             buttons: 'strong,em,link'          }              quicktags(settings);          /* ]]> */</script>     <?php } ?>      The problem: nothing shows up. PS: I already looked here: Use quicktags toolbar on any textarea Can someone make a suggestion?


title: Using underscores instead of hyphens in the permalink

text: What's the best way to ensure that post and page slugs use underscores instead of hyphens, without needing to edit the slug manually (or updating the page manually) Current permalink:               www.<domain>.com/2011/05/this-is-a-test-post/      Desired permalink               www.<domain>.com/2011/05/this_is_a_test_post/      One approach I've tried is to hook into `sanitize_title`, but this seems to only be called when the post is updated, so not very practical for a blog of several thousand post. Is there any way to force each post to update? I need this to preserve compatibility as an old MovableType site is moved into WordPress - using .htaccess isn't really an option


title: How to add plugin to WordPress Repository?

text: I just made my first plugin and it got approved by WordPress. Great news for me, but now what? The "instructions" on the Codex are anything but clear for me. I did find an article on Dig WP and I managed to get to the 3rd line of code. After that no joy. Does anyone here have a clear set of instructions on how to do this without the need to read an entire book? I am sure that there are very experienced people here who do this stuff all the time... Thanks in advance!


title: How to get page title with the page ID?

text: My page ID is: `30601` How can get the title of this ID? I want get page's title with ID.


title: How do i edit the plugin files in DataBase via phpMyAdmin?

text: I need guidance to edit the WordPress plugin and theme files via phpmyadmin If I want to edit a particular plugin file or remove a plugin completely from database, I could able to find them ,but I can able to find the data tables for options , comments, links etc. I don't know how to edit/remove a particular plugin or theme there. Could anybody let me know how to find a particular plugin or the entire ' plugins ' folder in data base? Thank you!


title: Modify 'Read more' link adding a new class

text: I want to add a class to the 'Read more' link. Actually I have this:               <?php the_content( 'Read more...' ); ?>      Which outputs:               Read more…      How can I add a class (using PHP) to the link, so it outputs:               Read more…


title: Get current post data into array?

text: I'm trying to achieve a similar effect to get_page($id), but with the current post acting as the argument for get_post(). Something like this pseudocode: `get_post($this=>ID);` . Seems simple, but I can't find the it in the docs.


title: Roles at registration (classipress)

text: I have a classipress site and want to have the user choose upon registering with the site if they are a teacher, or student. These will be different roles. I have been trying to get roles at registration plugin to work because it is basically what I need, but since classipress has a custom reg page it does not seem to work. Any ideas?


title: Comment form problem with comment_author_url and HTML5 input placeholders

text: I'm using HTML5 on two sites running two different versions of WordPress. They both exhibit the same behaviour and I would like some help with fixing this please.               <label for="url">Website</label> <input type="url" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" placeholder="Enter Website Address (optional)" pattern="https?://.+">      In testing, we have identified a problem with comment_author_url that occurs when people do not input an URL. For some reason, WordPress is picking up the placeholder text and saving it into the database, like so: http://EnterWebsiteAddress(optional) I'm having real trouble trying to identify why this is happening. The placeholder attribute isn't inside the input value so should not be getting picked up. This same code is being used in other applications without problems. Does anyone know how to correct this in WordPress? **UPDATE:** I've done considerable research on this and thought I'd share my findings. The issues come from the comment_form function within WordPress itself. To avoid the problems there are two options:   1. Only use placeholders on required fields. When the fields get focus and something is input the placeholder gets cleared.   2. Use JavaScript to clear placeholders before the form is submitted.  I hope this helps the others that have run into the same issues. I'm not submitting a patch to WordPress because, at this time, WordPress only intends to support XHTML.


title: List posts from certain category, by tag

text:
Basically I need to get all posts from a particular category (or multiple categories), and list them out according to their tag. In Category X, there are the following tags, and under each tag is the link to all the posts with that tag. I have it MOSTLY working - except this is pulling ALL tags from ALL categories. Any way I can limit this output to just a particular category?               <?php         //get all terms (e.g. categories or post tags), then display all posts in each term         $taxonomy = 'post_tag';//  e.g. post_tag, category         $param_type = 'tag__in'; //  e.g. tag__in, category__in         $term_args=array(           'orderby' => 'name',           'order' => 'ASC'         );         $terms = get_terms($taxonomy,$term_args);         if ($terms) {           foreach( $terms as $term ) {             $args=array(               "$param_type" => array($term->term_id),               'post_type' => 'post',               'post_status' => 'publish',               'posts_per_page' => -1,               'caller_get_posts'=> 1               );             $my_query = null;             $my_query = new WP_Query($args);             if( $my_query->have_posts() ) {               echo '
' . $term->name . '

';               while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
                <?php               endwhile;               echo '
';             }           }         }         wp_reset_query();  // Restore global post data stomped by the_post().         ?>


title: editing usermeta when field is an array

text: I'm using s2member and I added a new registration field to my registration form. s2member stores all custom registration fields in an array under the meta key `wp_s2member_custom_fields`. An example array (private data is x'd out) looks like this:               a:15:{s:14:"street_address";s:19:"xx xxxxxxxx xxxxxxx";s:4:"city";s:15:"xxxxxxxxxxx xxxx";s:12:"can_province";s:2:"NS";s:7:"country";s:2:"CA";s:10:"postalcode";s:7:"xxx xxx";s:5:"phone";s:12:"xxx-xxx-xxxx";s:17:"weaving_interests";a:10:{i:0;s:6:"iw_gen";i:1;s:6:"iw_bas";i:2;s:6:"iw_bla";i:3;s:7:"iw_fash";i:4;s:5:"iw_FA";i:5;s:7:"iw_felt";i:6;s:6:"iw_lin";i:7;s:9:"iw_design";i:8;s:6:"iw_rug";i:9;s:6:"iw_sao";}s:14:"spin_interests";a:2:{i:0;s:7:"is_wool";i:1;s:7:"is_misc";}s:12:"is_misc_desc";s:110:"alpaca, bamboo, seacell...  pretty much any fibre - primarily animals based - as long as it's soft and pretty!";s:13:"dye_interests";a:2:{i:0;s:7:"id_chem";i:1;s:6:"id_nat";}s:8:"ew_count";s:1:"6";s:8:"ew_about";s:202:"36" eight shaft jack loom     45" four shaft jack loom     25" 16 shaft table loom     15" four shaft table loom     tapestry loom     1 1/2 inkle looms (the second one is under construction)     20ish" rigid heddle loom";s:7:"ec_spin";s:1:"3";s:8:"es_about";s:392:"- Ashford traveller which I love - it's my primary wheel     - a homemade wheel which is a little heavy and a tiny bit clunky, but spins nice yarn - it's at my cottage     - a small antique wheel that I use mostly for display and have never used (I haven't gotten around to putting a drive band on it yet)     - I also have a few drop spindles, including one I made this summer from a rock and a stick";s:8:"eo_about";s:80:"I love my drum carder for blending colours and making very cool rovings to spin!";}      I attempted to add my new field `loomsong_del` to this array.               a:16:{ ....;s:12:"loomsong_del";s:5:"email";} //desired result     a:2:{i:0;a:15:{ ....}s:12:"loomsong_del";s:5:"email";} //actual result      To correct the situation I tried this:                   $s2_custom=get_user_meta($u->ID, 'wp_s2member_custom_fields');         $real = $s2_custom[0];         $real['loomsong_del']='email';         update_user_meta($u->ID,  'wp_s2member_custom_fields',$real);      which resulted in this:               a:2:{i:0; a:16:{ ....;s:12:"loomsong_del";s:5:"email";} s:12:"loomsong_del";s:5:"email";}      //should be a:16:{ ....;s:12:"loomsong_del";s:5:"email";} only      How can I fix it?


title: Suggest a plugin for up/down voting posts

text: I need a free wordpress plugin that will allow the users to upvote or down vote every post. Something similar to stackoverflow.com If not give me suggestions of how to create one. I am a java programmer and have never coded anything in PHP.


title: How to remove "Connection Information" requirement on localhost install of WP on MACOSX

text: I've just installed XAMPP on Mac OSX and when trying to install a theme or plugin in WP admin, I'm getting this screen. I've never gotten this on my _shared_ hosting account. how to get rid of it on localhost? ![WordPress challenge when installing new plugin](http://i.stack.imgur.com/VgCRV.png) ![enter image description here](http://i.stack.imgur.com/mipHI.png)


title: 'Invalid Error' when saving theme options - only in Google Chrome

text: I have users when get an 'Invalid Error' when trying to edit the custom theme options in my theme, WPFolio. The options (just some CSS rules: page container color, font color, headline/body font, etc...) work as they should in Firefox, Safari, and IE and any changes they make there will show up in Chrome fine. But when they try to edit/save theme options in Chrome, they get an 'Invalid Value' error on a specific field when they try to save in Chrome, even if they haven't touched that field. The weird thing is, I can't replicate the error no matter what browser I use... Any ideas? Thanks! Have a look at the theme files on github.


title: Wordpress FLIR (Facelift Image Replacement) plugin clipping off end of text

text: I'm using the FLIR for Wordpress plugin (v0.8.9.2) with FancyFonts enabled. I'm running Wordpress 3.1. The problem I'm having is that it appears the plugin is cutting off a couple pixels off of the end of some of the text that it generates. It doesn't do it for all text, but where it happens, it happens consistently. Here are some examples: ![enter image description here](http://i.stack.imgur.com/0WV7r.png) ![enter image description here](http://i.stack.imgur.com/PU3Ik.png) ![enter image description here](http://i.stack.imgur.com/asDQd.gif) In my search for a solution, I've found a number of people with this issue, but never any solutions. Any ideas would be greatly appreciated. Thank you!


title: Is there something wrong w/ this code?

text: <?php         $rp = new WP_Query(array(         'post_type' => array( 'post','videos','projects' ),         'orderby' => 'date&order=DESC',         'posts_per_page' => 4         ));              while ($rp->have_posts()) : $rp->the_post();     ?>      I noticed that if I change `date&order=DESC` to `rand`, it makes no difference, meaning the posts don't show up in random order even after multiple refreshes. Is there something wrong w/ this code?


title: search serialised meta_value for date value?

text: i've saved and array of 'open days' as a serialised array in a meta value. I was hoping i could then just search this field for the selected dates but i can't seem to create a match. serialised = a:2:{i:0;s:10:"2011-09-16";i:1;s:10:"2011-09-17";} ; // two open dates and was trying this and some variation without luck ;               $values_serialized = serialize(array('2011-09-16')); // need to serialise???          $args =  array ('meta_query' => array(          array( 'key'=>'v-openDays', 'value'=>$values_serialized,'compare'=>'IN' )        )     )     // IN or LIKE?      will also be searching for multiple days but need to get one working first! Help appreciated, Dc


title: is it possible to get next_post_link

text: I have come across a problem whilst using the next_post_link() function. It seems that this function automatically echo's, for position reasons I need this to just return the link. Is there any available function or workaround that I can use to achieve this result?


I'm using wordpress version 3.1 and if I try to upgrade any plugin on any of my sites I get the error message `error: An Unexpected HTTP Error occurred during the API request`. Not by upgrading automatically, but manually upgrading through the dashboard plugin area I guess I mean I've google for a solutions, to no avail. I've gone into my `class-http.php` file and changed this code `'timeout' => apply_filters( 'http_request_timeout', 5)`, to `'timeout' => apply_filters( 'http_request_timeout', 30)`, Also tried request time out at 60. Also downloaded Core Control Plugin, went into External HTTP Access and disabled each of those 4 PHP HTTP Extension/Transport options one by one and still same problem.


title: custom post types don't appear in RSS

text: I created custom post-types in my site but these posts are not shown in the RSS. Only the regular posts appear there. What could be preventing them from showing up there


title: custom post type tag lists and link to post

text: I'm a newbie in custom post type. and so far I've been able to customize list of post (`archive.php` or `archive-xxx.php`), and link to individual post (`single.php` or `single-xxx.php`). All these works good. However, when retrieving tag list or list of post of a specific tag, it uses archive.php and list all posts under the specific custom post type. [question] How can I fetch list of all tags for this post_type, with posts underneath each tag? ` tag1      post 1      post 2 `


title: After Login Page says 404

text: I installed wordpress at abc.com/myblog/wp-login.php Once i login to the admin it displays the header and footer of the site and shows 404 pages in the middle portion. Is that permission issue ?