title: custom menu not found

text:
I am trying to use a menu which I have partially working, I have setup functions.php:               if (function_exists('register_nav_menu')) {       register_nav_menu('main-menu', 'Main Menu');     }      I have configured the menu in Appearance -> Menus with 2 Pages: Home & Sample Page. My Problem: When I call the menu using wp_nav_menu() like this: CODE#1               wp_nav_menu( array( 'theme_location' => 'main-menu', 'container' => false ) );      I get no menu - nothing prints to screen When I access the elements manually like this: CODE#2               $menu_name = 'main-menu';          if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {            $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );       $menu_items = wp_get_nav_menu_items($menu->term_id);       $menu_list = '
';            foreach ( (array) $menu_items as $key => $menu_item ) {         $title = $menu_item->title;         $url = $menu_item->url;         $menu_list .= '
' . $title . '
';       }       $menu_list .= '
';     } else {       $menu_list = '

No Menu

';     }     echo $menu_list;


title: How can I list URLs of all audio files within my media gallery?

text: I have a music player in my theme that generates its playlist from a javascript file that looks like this               var myPlaylist = [          {             mp3:'track url goes here',             title:'title here',             artist:'artist',         }         {             mp3:'track url goes here',             title:'title here',             artist:'artist',         }      etc...          ];      How can I query the media library so it will echo the track url, title text and maybe an existing audio parameter like "description" for the artist value? I know enough about php to put them in the right places once they're queried, I just needto know how to pull them from the wp database!


title: Filter custom comment type from Manage Comments & Dash Widgets

text: I use comments with a custom comment type in my plugin to notify users of various events created by the plugin. The problem is I don't want these cluttering up the standard comments so I need to filter out those custom comments from the manage comments screen as well as the recent comments dashboard widget. Does anyone have any ideas on how to do this?


title: Count user posts by user ID, Post type and Post status

text: What I am trying to do is modification of this function on codex http://codex.wordpress.org/Function_Reference/count_user_posts Check the title **adding post type support** bottom of the page. The function is:               function count_user_posts_by_type($userid, $post_type='post') {       global $wpdb;       $where = get_posts_by_author_sql($post_type, TRUE, $userid);       $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" );       return apply_filters('get_usernumposts', $count, $userid);     }      What I want is to add post status to the function. So, I assume I have to add a WHERE to the query but not sure how to do it. Any help will be appreciated. Thanks!


title: List archive year - post by post

text:
I want to do a list archive "post by post", but separated by year. Like this:
2014

     Post 4     Post 3     Post 2     Post 1

2013

     Post 3     Post 2     Post 1
      is there a way to do this?


title: Localizing strings that come from outside of plugin?

text: Plugin queries remote API and under certain circumstances (mostly errors) displays textual messages from API responses. All messages in API responses are in English, but since they are more or less integrated in plugin it would make sense to make them localized and display-able in different language to match plugin's interface. Theoretical question - should such messages be localized at all or are they out of scope for localization? Coding question - how do you even localize such and retain compatibility with related tools? Does something like `__( $message );` even make sense? In the past I used Codestyling Localization which relies on scanning plugin's source to extract strings... But there is nothing to extract since strings are not contained in plugin's body.


title: URL to an image in a post is changing when permalink is set to custom. Can I avoid this?

text: I have a buy-button image set in all posts on the entire site. When permalink settings are default the URL to that image file is www.mydomain.com/images/buy-button.gif. When permalink settings are custom the URL to that image file is generated dynamically to www.mydomain.com/permalinkcustom/images/buy-button.gif. The result is that the buy button is not visible any more on the posts as its URL remains the same as if when permalink settings is still default. How can I configure this URL- rewrite? Many thanks for any help. Ruediger


title: Not receiving mail using wordpress function

text: I'm not receiving emails when using the following function. Is there another method that works or that I can test?               <?php      $data = ob_get_clean();          require_once(dirname(__FILE__).'/make-pdf.php');     require_once(dirname(__FILE__).'/attach-mail.php');          $pdf = make_pdf($data);     $filename = 'confirmation_'.date('Ymd_his').'.pdf';          $to = $_POST['admin_email'];     $from = 'my@email.com';     $subject = "Enquiry";          mail_attachment($filename, $pdf, $to, $from, $subject, $message);     echo $data;          } ?>      attach-mail.php               <?php     function mail_attachment($filename, $data, $mailto, $from_mail, $subject, $message) {         $file_size = strlen($data);         $data = chunk_split(base64_encode($data));         $uid = md5(uniqid(time()));         $header = "From: ".$from_mail."\r\n";         $header .= 'Cc: my-other@email.com' . "\r\n";         $header .= "MIME-Version: 1.0\r\n";         $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";         $header .= "This is a multi-part message in MIME format.\r\n";         $header .= "--".$uid."\r\n";         $header .= "Content-type:text/html; charset=iso-8859-1\r\n";         $header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";         $header .= $message."\r\n\r\n";         $header .= "--".$uid."\r\n";         $header .= "Content-Type: application/octet-stream; name=\"".$filename."\"\r\n"; // use different content types here         $header .= "Content-Transfer-Encoding: base64\r\n";         $header .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n";         $header .= $data."\r\n\r\n";         $header .= "--".$uid."--";         mail($mailto, $subject, "", $header);     }     ?>


title: Does loading of sub pages in menu cause load to the server?

text: I am working on a wp site where I need to manage 500s of child pages for a single page such as About menu can have more child pages need to manage those child pages as sub menu and I have more than 5 such menus. My client is saying that it will cause load to the server. Does this create a problem in server? If yes, is there any way to load the menu that will not cause any problem to the server. Thanks in advance...


title: Creating multiple pages

text: I have a few pages and I'm trying to import subpages into each like this:                wp_insert_post (       array(         'post_title' => $something,         'post_type' => 'page',         'post_author' => 1,         'post_status' => 'publish',         'post_parent' => array(17, 25, 27, 29)       )      );      So the structure should looks like:               first->imported_name     second->imported_name     ...      But this doesn't work, it creates only 1 subpage. Should I copy that code 5 times for 5 pages?


title: 404 permalink errors on Pages only

text: I am having a strange issue with permalinks while using the `/%postname%/` structure. I can access my custom post types using the pretty permalink `localhost/cpu/<post-type>/<post-title>/` but I am getting a 404 error on Pages. The url of a page is `localhost/cpu/<page-title>/` My `.htaccess` file (generated automatically when saving permalinks):               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /cpu/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /cpu/index.php [L]     </IfModule>          # END WordPress      My WordPress(version 3.4.2) installation is in a folder called `cpu`. I don't have any issues with the default permalink structure `url/?p=123`. The problem does not go away when I disable all plugins. Any possible solution? Is there a way to debug what's happening? **UPDATE:** Following _Code Monkey_ 's answer, I added the following to functions.php I changed the filter from `rewrite_rules_array` to `page_rewrite_rules` \- the WP_Rewrite Class reference suggests: > To filter the rewrite rules generated for your Pages, use > page_rewrite_rules. So, here's the code I added:               add_filter('page_rewrite_rules', 'rewrite_rules_array_filter_debug', 10000);          function rewrite_rules_array_filter_debug($rules){       echo '<pre>';         var_dump($rules);       echo '</pre>';       return $rules;     }      And the output from saving the post permalinks on `wp-admin/options- permalink.php`:               array(11) {       [".?.+?/attachment/([^/]+)/?$"]=>       string(32) "index.php?attachment=$matches[1]"       [".?.+?/attachment/([^/]+)/trackback/?$"]=>       string(37) "index.php?attachment=$matches[1]&tb=1"       [".?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$"]=>       string(49) "index.php?attachment=$matches[1]&feed=$matches[2]"       [".?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$"]=>       string(49) "index.php?attachment=$matches[1]&feed=$matches[2]"       [".?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$"]=>       string(50) "index.php?attachment=$matches[1]&cpage=$matches[2]"       ["(.?.+?)/trackback/?$"]=>       string(35) "index.php?pagename=$matches[1]&tb=1"       ["(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$"]=>       string(47) "index.php?pagename=$matches[1]&feed=$matches[2]"       ["(.?.+?)/(feed|rdf|rss|rss2|atom)/?$"]=>       string(47) "index.php?pagename=$matches[1]&feed=$matches[2]"       ["(.?.+?)/page/?([0-9]{1,})/?$"]=>       string(48) "index.php?pagename=$matches[1]&paged=$matches[2]"       ["(.?.+?)/comment-page-([0-9]{1,})/?$"]=>       string(48) "index.php?pagename=$matches[1]&cpage=$matches[2]"       ["(.?.+?)(/[0-9]+)?/?$"]=>       string(47) "index.php?pagename=$matches[1]&page=$matches[2]"     }      Anything wrong in it? **UPDATE 2:** I found my error when using `var_dump($wp);`. I got this response:                 ["query_string"]=>       string(25) "statut-membre=sample-page"       ["request"]=>       string(11) "sample-page"       ["matched_rule"]=>       string(10) "([^/]+)/?$"       ["matched_query"]=>       string(25) "statut-membre=sample-page"       ["did_permalink"]=>       bool(true)      Wordpress was querying a taxonomy called `statut-membre` while looking for my pages. I noticed I had an empty rewrite slug(`'rewrite' => array('slug' => ''),`) in that `register_taxonomy` function. I added a slug and resaved my permalink structure, now my I can access my pages. Now the query looks fine too:                 ["query_string"]=>       string(20) "pagename=sample-page"       ["request"]=>       string(11) "sample-page"       ["matched_rule"]=>       string(20) "(.?.+?)(/[0-9]+)?/?$"       ["matched_query"]=>       string(26) "pagename=sample-page&page="       ["did_permalink"]=>       bool(true)


title: Site admin in a network install can't edit users?

text: For the Stack Exchange Community Blogs, we have a network install that we've set up. I am being told that the site administrator role is not allowing an option for user editing. On the site's users page when hovering over a user, there is only an option for `delete`, not one for `edit`. The only option related to user permissions is the following, but not really what I'm going for here... ![add new users](http://i.stack.imgur.com/a8s0v.png) How can I enable the site administrator to have full control over the users on that specific site?


title: Post thumbnails not working in my new install of WP 3.1 with Twenty Ten theme

text: I am working in a new project, and I just realized that in the page/post edit pages, I don´t have the option to set a featured image/ post thumbnail. I have checked and Twenty Ten has thumbnails support by default ( add_theme_support( 'post-thumbnails' is in functions.php). I also tried setting the thumbnails size with set_post_thumbnail_size, but no luck. Any ideas? P.D: I installed this in a new server, is it possible that it has something to do with that? Are there any specific requirements to use post thumbnails?


title: adding a URL to a post meta

text:
OK, a pretty dorky question, but I am new to PHP so bear with me. How would I add an a href link to the code below so the custom meta field is linked on the front-end?                 <?php if(get_post_meta($post->ID, "leetpress_website", true)) { ?>

Movie Website:       <?php echo get_post_meta($post->ID, "leetpress_website", true); ?>

     <?php } ?>      Thanks for putting up with my dorky-ness... UPDATE: Got it working! Thanks for the help pointing me in the right direction Bainternet!               <?php if(get_post_meta($post->ID, "leetpress_website", true)) { echo '

Movie Website:  ID, "leetpress_website", true).'" target="_blank">'.get_post_meta($post->ID, "leetpress_website", true).'

'; } ?>


title: Changing subdir multisite install to subdir core directory structure

text: Now that WordPress 3.5 is supposed to work with core files in subdirectory, I decided to move my local development setup (subdirectory multisite) to that configuration. Fast forward and what I have is following: `wordpress` (3.5 core) `wp-content` (content dir, configured via `WP_CONTENT_DIR` and `WP_CONTENT_URL`) `.htaccess` with:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) C:\server\www\dev\wordpress/wp-includes/ms-files.php?file=$2 [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) C:\server\www\dev\wordpress/$2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ C:\server\www\dev\wordpress/$2 [L]     RewriteRule . index.php [L]      `wp-config.php` with:               define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', false);     define('DOMAIN_CURRENT_SITE', 'dev.rarst.net');     define('PATH_CURRENT_SITE', '/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);      `index.php` with:               define('WP_USE_THEMES', true);     require('./wordpress/wp-blog-header.php');      Status:   * network admin works at `/wordpress/wp-admin/network/` but all links try to point to `/wp-admin/network/` which errors `Forbidden` with `The given path was above the root path: AH00127: Cannot map GET /wp-admin/network/ HTTP/1.1 to file`   * root site works at `dev.rarst.net` with admin at `dev.rarst.net/wordpress/wp-admin`   * other subdir sites (`dev.rarst.net/*`) have broken uploads, and links to admin and stuff, hadn't got to them yet. The question in a nutshell - **in what direction do I need to move from here to get everything working?** What admin links are even supposed to be with this setup (since core is in "real" subdir and sites are in "virtual" subdirs)?


title: custom post type and custom taxonomy url conflict

text: I have custom post type called `paintings` and it has a custom taxonomy called `paintings_category`. Currently I have this situation:   * `example.com/paintings/` > A page using `page-paintings.php`   * `example.com/paintings_category/landscape/` > Lists all `landscape` items in `taxonomy.php`   * `example.com/paintings/landscape/painting-title/` > Displays single painting post types, eg. `single-paintings.php` If I try changing the slug as below, I get a 404 error on: `example.com/paintings/landscape/painting-title/`               register_taxonomy(          'paintings_category', array('paintings'),          array(              'hierarchical' => true,              'label' => 'Categories',              'singular_label' => 'Category',              'rewrite' => array( 'slug' => 'paintings' )         )     );      I'd like behaviour to be:   * `example.com/paintings/` > ideally list `paintings_category` as links   * `example.com/paintings/landscape/` > lists all items of `landscape` taxonomy   * `example.com/paintings/landscape/painting-title/` > displays single item Any thoughts on how I can achieve this? I tried adding `paintings` as a parent of `landscape` category in `paintings_category` but this still leaves me with a 404 on the single.


title: custom fields cannt be seen with version 3.1

text: I had a Theme that worked OK with ver 2.7. Now that I upgraded to 3.1; I cannot see the "custom fields" in the posts(may be hidden??). Can someone help.Thanks


title: Problem with comment box

text: The "Reply" option on the comment box is not working. Please let me know how to make that work? Note: I am able to reply on comments from admin area (wp->comments->...) but the site visitors are not able to reply. For example check this: www.linuxstall.com/linux-command-line-tips-that-every- linux-user-should-know/ Click on "Reply" there. You will not be able to reply to that comment. You can add new comment though but "reply" will not work. Let me know how to solve this issue. Thanks.


title: Ajax request sends url rather than data

text: I have a very weird error running on my plugin. I am currently developing a plugin that will allow the user to create routes and specific dates for the route. The dates are more or less tickets that can be purchased by the visitor. I am running ajax request for the data creation and removal of a date. The return of these ajax requests are HTML snippets that are used to update the table that shows the available dates for the route. When I create a route I get the proper HTML back and put it into the table via jQquery. However, when I run pretty much the same request to delete a row from the table I do not get the same result back. Instead of getting the HTML back I am getting the URL back of my website. I have looked everywhere and cannot find anything why this could happen. The codex says, that in term of an error I get -1 or 0 back. The ajax request works fine and the row gets deleted just as I request. I hope somebody could find the little devil who is preventing my code from being executed properly. Here are the following files: PHP: witchroute/index.php witchroute/wit_witchroute.class.php witchroute/wit_date.class.php HTML: witchroute/views/date-display.html witchroute/views/date-display- table.html witchroute/views/date-insert-form.html What you should know: The ajax remove request is located in the wit_witchroute.class.php in the constructor               add_action('wp_ajax_remove_date_from_route', function()                     {                         $wit_date = wit_date::getInstance();                         $wit_date->removeDate($_POST);                     });      the actual method is in the wit_date.class.php The jQuery request is started in the date-display.html with the following testing code:               jQuery(function() {             jQuery(".witchroute_delete_btn").click(function(){                      var id      =   jQuery(this).attr('date-id');                      var deleteData  = { id: id,                                       action: "remove_date_from_route",                                     security: '<?php print wp_create_nonce("adsfadsfasdfadsfd"); ?>'                                 };                      var r2 = jQuery.ajax({                     url: ajaxurl,                     type: "POST",                     data: deleteData,                     dataType: "html"                 });                      r2.done(function(msg) {                     //jQuery("#witchroute_date_display_body").html(msg);                     alert(msg);                 });              });              });      Please not, that I am fairly new to the plugin development. I havent done any form validation yet as I am still testing, so please dont comment on that. However, if you had some tips for structuring or so I would appreciate any help- that might even help solving my problem ? I am looking forward to your help and hope somebody can see what I cannot see :) All the best, Richard


title: Is it possible to remove the "standard" post format?

text: I'm using post formats heavily on a project, but have no current need for the standard option. Beyond being an unnecessary bit of UI, it actually causes broken behavior if it does get mistakenly selected. I might, with some convoluted logic, be able to set up a template for Standard that properly handles the incoming content of other formats, but all that would really do is hide the fact the posts are assigned incorrectly, making them even harder to hunt down. (And this workaround may or may not always be viable.) The real problem is that the radio button just shouldn't be there. The only option I've seen for removing format support in any way is `remove_theme_support('post-formats')` which kills the feature altogether. I just want that one option gone.


title: Deleting first four characters from all Post Titles

text: I have a wordpress autoblog.. I need to delete first four characters from each single post title automatically.. How can I achieve it?


title: How can I add text on top of slideshow?

text: I would like to add text on top of the slide show of the following theme: http://themeforest.net/item/newcastle-a-woocommerce-powered-wordpress- theme/full_screen_preview/3887883 The home page is a specific template and writing on the home page template adds text below the slideshow as opposed to above. I would like to have text above and below. How do you recommend doing this?


title: Video playing from featured image?

text: If I embed a YouTube video into a post, how do I put a play button over the featured image so that the video can be played without having to open the whole post? I.e Flipboard the iOS app has a function which allows you to watch videos from the featured image stage.


title: Grey out nav buttons unless is_user_logged_in()

text: I'd like to show my users some features I offer if they register in a special nav bar. I've created this for a logged in version and a logged out version:               if ( is_user_logged_in() ) {         $menu = wp_nav_menu( array( 'theme_location' => 'logged-in-menu', 'container' => '0', 'fallback_cb' => 'wp_page_menu', 'echo' => '0' ) );         echo $menu;         } else {         $menu = wp_nav_menu( array( 'theme_location' => 'main-menu', 'container' => '0', 'fallback_cb' => 'wp_page_menu', 'echo' => '0' ) );         ?>          <style>#menu-item-1046{opacity : 0.4; filter: alpha(opacity=40);}</style>         <?php         echo $menu;     }      I'm trying to grey out (disable but leave visible) nav buttons by ID. Obviously my CSS in there works but doesn't disable the button... I tried `<script>$('#menu-item-1046').button('disable');</script>` But I've barely dabbled in jQuery as of now.


title: How to bypass the username as a required field in registration and just use email address instead?

text: Is there a clean way of doing so? I would prefer doing that in functions.php using some action and/ or filter hooks. The 2nd-best option would be using some good plugin out there. (I haven't seen 1 suitable though) I can always generate random and unique strings to be usernames in the registration forms and just hide it with CSS. I would imagine meddling with wp-login.php but that would be so ugly. I am able to let users log in using email address and password, but not username now, partly referencing this. However, username still appears as a required field on the registration page which confuses people. **Updates**   I've found that Register Plus Redux handles the login using email address instead of username well. However, I need to be able to modify the labels and texts on the registration page too (I need to put in Thai). It looks like there's no clean way but one will have to edit the codes in the plugins directly


title: Ordering posts by custom taxonomy in admin area

text: **EDIT** @kaiser - this question is slightly different to the answer you posted in that I am talking about sorting by clicking the column title rather than adding a dropdown to filter by taxonomy term (which you'll see I've already done in the screenshot). Like Otto says in the answer Milo linked to: 'it is not possible to order by taxonomy, because from a certain type of standpoint, that doesn't actually make much sense...the point of having a taxonomy on posts would really be to have terms in that taxonomy that are shared between posts'. I see his point, as you can have multiple terms attached to a post, sorting by them is a bit pointless. I've decided to scrap the idea, so feel free to delete this post if it's of no use. Thanks. **ENDEDIT** Been scouring the net for the solution to this, but not finding the specific answer to my issue. I've registered a custom post type and a couple of custom taxonomies, but I'm trying to allow admins to _sort_ posts by a taxonomy, just like you can with the Date column - see screenshot here: ![enter image description here](http://i.stack.imgur.com/wWF0N.png) Does anyone know how to do that? Here's how I'm registering the custom post type if it's of any use:               Class OSUFestivals         {             public static function init()             {                 add_action( "init", array( __CLASS__, "register_directory_cpt" ) );                 add_action( "init", array( __CLASS__, "register_workshop_type_taxonomy" ) );                 add_action( "init", array( __CLASS__, "register_day_taxonomy" ) );             }                  public static function register_directory_cpt()             {                 $labels = array(                     'name'               => 'Festival Items',                     'singular_name'      => 'Festival Item',                     'menu_name'          => 'Festival',                     'name_admin_bar'     => 'Festival Item',                     'add_new'            => 'Add New Item',                     'add_new_item'       => 'Add New Item',                     'new_item'           => 'New Item',                     'edit_item'          => 'Edit Item',                     'view_item'          => 'View Item',                     'all_items'          => 'All Items',                     'search_items'       => 'Search Items',                     'parent_item_colon'  => 'Parent Items:',                     'not_found'          => 'No Items found.',                     'not_found_in_trash' => 'No Items found in Trash.',                 );                 $args = array(                     'labels'        => $labels,                     'public'        => true,                     'hierarchical'  => false,                     'has_archive'   => true,                     'show_in_admin_bar' => true,                     'menu_position' => 5,                     'supports'      => array( 'title', 'editor', 'thumbnail', 'author', 'excerpt', 'revisions', 'page-attributes' ),                     'rewrite'       => array(                         'with_front'    => false,                         'slug'          => 'festival-Items'                     )                 );                      register_post_type( 'lkfestival', $args );             }                  public static function register_workshop_type_taxonomy()             {                 $labels = array(                     'name'                      => 'Workshop types',                     'singular_name'             => 'Workshop type',                     'search_items'              => 'Search workshop types',                     'all_items'                 => 'All workshop types',                     'parent_item'               => 'Parent workshop type',                     'edit_item'                 => 'Edit workshop type',                     'update_item'               => 'Update workshop type',                     'add_new_item'              => 'Add new workshop type',                     'new_item_name'             => 'New workshop type',                     'choose_from_most_used'     => 'Choose from most used workshop types'                 );                      $args = array(                     'hierarchical'      => true,                     'labels'            => $labels,                     'show_admin_column' => true,                     'rewrite'           => array( 'slug' => 'event-type' ),                     'capabilities'      => array (                         /* Only let Andrea assign workshop types */                         'manage_terms'  => 'manage_options', // by default only admin                         'edit_terms'    => 'manage_options',                         'delete_terms'  => 'manage_options',                         'assign_terms'  => 'edit_posts'  // means administrator', 'editor', 'author', 'contributor'                     )                 );                      register_taxonomy( 'lktypes', 'lkfestival', $args );             }                  public static function register_day_taxonomy()             {                 $labels = array(                     'name'                      => 'Festival days',                     'singular_name'             => 'Festival day',                     'search_items'              => 'Search festival days',                     'all_items'                 => 'All festival days',                     'parent_item'               => 'Parent festival day',                     'edit_item'                 => 'Edit festival day',                     'update_item'               => 'Update festival day',                     'add_new_item'              => 'Add new festival day',                     'new_item_name'             => 'New festival day',                     'choose_from_most_used'     => 'Choose from most used festival days'                 );                      $args = array(                     'hierarchical'      => true,                     'labels'            => $labels,                     'show_admin_column' => true,                     'rewrite'           => array( 'slug' => 'day' ),                     'capabilities'      => array (                         /* Only let Andrea assign festival days */                         'manage_terms'  => 'manage_options', // by default only admin                         'edit_terms'    => 'manage_options',                         'delete_terms'  => 'manage_options',                         'assign_terms'  => 'edit_posts'  // means administrator', 'editor', 'author', 'contributor'                     )                 );                      register_taxonomy( 'lkdays', 'lkfestival', $args );             }              }              // Load Class         OSUFestivals::init();      I thought the 'sort' parameter in `register_taxonomy()` would allow sorting, but it looks like that's related to the order in which terms are added to objects.


title: has_term() does not return when term is assigned post?

text: Ok, I have an archive loop. In this loop I have this...               <?php if ( has_term('race') ) { ?>        <?php the_title($event); ?>     <?php } ?>      But it does no show whats anything!? And I have these terms assigned to the post...   * Tax: report-type Term: race   * Tax: season-year Term: motogp-2013 My question is why does this not return nothing? Or what function should I be using to display something (in the loop) if the post has the term assigned to it? Weirdly this works...               <?php if ( has_term('race', 'report-type', $post->ID )) { ?>


title: Custom Field Search

text: I'm trying to create a custom search form that searches a custom post type that I have created. The form would need to search two custom taxonomies (similar to tags and categories) and the body text of the post. There would be a search input that would search the body text and tags and a dropdown that would filter by category (Any, Category 1, Category 2, Category 3). What kind of templates would I need to make and what kind of code would this require? Thanks a ton!


title: DataTables plugin, javascript not working

text: The javascript (sorting, number of rows, paging) is not working although i have datatables js options enabled in the tablepress plugin. The console does not show any error (like unknown datatables()). Here is the page Here is my setting:               · Website: http://koerner.li/wordpress     · TablePress: 1.0     · TablePress (DB): 18     · TablePress table scheme: 3     · Plugin instal          led: 2013/07/24 10:00:46     · WordPress: 3.6     · Multisite: no     · PHP: 5.4.23     · mySQL (Server): 5.1.72-log     · mySQL (Client): 5.1.72     · ZIP support: yes     · UTF-8 conversion: yes     · WP Memory Limit: 40M     · Server Memory Limit: 256M     · Magic Quotes: off     · WP_DEBUG: false


title: Wordpress working only in directory named "wordpress"

text: I have this strange problem. Can't get wordpress running in any sub directory except domain.com/wordpress. Files are clean wordpress download and working on other hosting (tested). Any recomendations? edit: wordpress gives "white screen of death" when moved to other than domain.com/wordpress directory, except root (domain.com)


title: get_template_directory adding FTP root folders in urls

text: I am creating a theme, and now I am adding some functionality for my custom post type, such as different metaboxes in post page, extra post config page. It seems when I try to get the sites theme directory so I can enqueue a custom css file and php file for the seperate post page I am getting FTP root folders in the url, causing it to 404. Here is the way I am adding it. I have a seperate file with all of the custom post type functions in it, and I am adding it as a dependency through my functions.php. I wanted to go with the separate file, for neatness so I don't have a million functions in my functions.php. I also have a css file in a folder inside of my includes dir. The CSS is for the backend, for the custom post pages in the admin. EDIT: I just checked and it adds the FTP root info even if I manually add the path instead of a function(get_template_directory()), now this really confuses me as all of the functions anywhere else work fine, just in this file with the post_type functions. I have other post_type functions in my functions.php folder and they work fine too. Anyone care to lend a brain? When using get_template_directory() :               wp_register_style('PostTypeStyleSheet', get_template_directory() . '/inc/post-types-functions/css/cpadminstyles.css');     wp_enqueue_style( 'PostTypeStyleSheet');      I get a url like this back:               Failed to load resource: the server responded with a status of 404 (Not Found) http://mythemesite.com/home2/jname/public_html/sandbox/wp-content/themes/mytheme/inc/post-types-functions/css/cpadminstyles.css?ver=3.5.1      I am not sure why this is happening, I use get_template_directory() almost everywhere else and do not have this issue. Can anyone tell me why it could be happening?


title: Amazon S3 + Cloudfront with Wordpress

text: I put together a wordpress site on a heroku free instance and I'm making all images to go to an S3 bucket and a Cloudfront distribution with this plugin . The thing is, it only uploads the images to S3 and serves them with the proper CNAME I set up. What I want is to serve the wp-content (all my plugins and themes) through S3. I know it's possible because I've read about it, but all tutorials around are explaining the Origin pull and not this configuration. Can anyone tell me more about how can I achieve this? Thank you!!


title: Get posts that have been read by logged in users

text: I am using buddypress. I want to know what posts each user has read, and show a list of read and unread post for users. I don't know how to do this. Should I be using custom fields, via `add_user meta`? What do you think is the best way?


title: wp_mail file attachment not being placed in upload folder?

text: I have a form where I want users to be able to select an image to upload. The image gets temporarily uploaded to the wp-content/uploads folder, is attached to the e-mail and then is destroyed. Right now, the form is submitting and I can see that the image is being processed in the response headers, but there is no image included in the e-mail and there is no image file in the uploads folder. Does anyone see any issues with this code? Here's the form:               <form id="shareForm" action="<?php echo get_template_directory_uri(); ?>/library/file-form.php" method="post" enctype="multipart/form-data">         <input type="text" id="name" name="name" placeholder="Name" />         <textarea rows="4" cols="50" name="message" id="message" placeholder="Message"></textarea>         <input type="file" id="photo" name="photo" class="upload">         <input type="submit" name="submit" value="Submit">     </form>      And here's my PHP mail script:               <?php         require( '../../../../wp-load.php' );          if(isset($_POST["name"])){              $name = $_POST["name"];         $message = $_POST["message"];              $fName = str_replace(array(' ', ',', '\'' ), '-');              $date = new DateTime(null, new DateTimeZone('America/Chicago'));         $myDate = $date->format("m/d/Y H:i");         $fileDate = $date->format("m-d-Y");         $homeUrl = home_url('/');              if($_FILES["file"]["type"] != ""){                  $allowedExts = array("jpg", "png", "gif");             $extension = end(explode(".", $_FILES["file"]["name"]));             $newFileName = $fName . $fileDate."." .$extension;                  if ($_FILES["file"]["error"] > 0) {                 $myPath =  $homeUrl . 'share/?upload=error';                 wp_redirect($myPath); exit;                       } else {                 move_uploaded_file($_FILES["file"]["tmp_name"], WP_CONTENT_DIR . "/uploads/user-submitted/" . $newFileName);             }              }              $to = 'my@email.com';         $subject = $fName . " submitted a photo";              $message = "Date: " . $myDate . " EST \n";         $message .= "Message:  " .$message. "\n";              $attachments = array(WP_CONTENT_DIR . "/uploads/user-submitted/".$newFileName);          $headers[] = 'From: Photo Submissions <my@email.com>';              wp_mail( $to, $subject, $message, $headers, $attachments);              unlink(WP_CONTENT_DIR . "/uploads/user-submitted/" . $newFileName);              $myPath =  $homeUrl . 'share/?upload=success';         wp_redirect($myPath);          exit;             }          ?>


title: I do not want my front page sticky post to show up in a category

text: I have a welcome paragraph on me front page. I did this using sticky post. But the welcome to my website sticky post also shows in my category? Is there a way to have it show on the front page only?


title: modify default HAVE_POSTS() Loop without inserting new variable (i.e. $loop->HAVE_POSTS)

text: i want to modify               while ( have_posts() ) : the_post();      the default way is:               $loop = new WP_Query($args);     while ( $loop->have_posts() ) : $loop->the_post();      but i dont want to insert a new $loop variable, but want to have still `while ( have_posts() ) : the_post();` with modified parameters. how to do that?


title: Pre-Populate $wp_query settings with custom rewrite rules and custom template_redirect

text: I'm currently working on a file browser plugin which requires frontend editing capabilities for a registered user. For this scenario, I have registered some custom rewrite rules for my custom post type. ## Rewrite Analyzer ![Rewrite Analyzer Window](http://i.stack.imgur.com/rRhSC.png) As you can see in the screenshot above, the plugin has a basic CRUD interface for managing the downloads. The routing is made through the `template_redirect` hook, which checks if the query variable `action` is set and then make a call to the appropriate action method.               add_action('template_redirect', array($this, '_requestHandler'), 9);     // ...     public function _requestHandler() {         try {             $requestedPage = get_query_var('pagename');                  if((isset($requestedPage) && $requestedPage == 'webeo-download')) {                 $action = get_query_var('action');                 $this->action = (isset($action)) ? $action : null;                      $downloadId = get_query_var('download');                 $this->downloadId = (isset($downloadId)) ? (int) $downloadId : null;                      if(isset($this->action) && !is_null($this->action) && strlen($this->action) > 0) {                     $method = 'action' . ucfirst($this->action);                          if(method_exists($this, $method)) {                         call_user_func(array($this, $method));                     } else {                         throw new Webeo_Exception(sprintf(__('Action method <code>%s</code> does not exists.', WEBEO_DOWNLOAD_TEXTDOMAIN), $method));                     }                 } else {                     $this->actionIndex();                 }                      echo $this->view->render($this->view->viewTemplate);                 exit();             }         } catch (Webeo_Exception $e) {             $this->view->assign('error', $e);             echo $this->view->render('default.phtml');             exit();         }     }      This works really well, except one thing. I wanted to prevent WordPress from generating any default rewrite rules for my custom post type. Access to my posts from outside should also be restricted. Only my controller above should be responsible to serve any download data to the user. To do this, I have set the arguments `public` and `publicly_queryable` to false inside the `register_post_type` function. I've also set the argument `exclude_from_search` to `true`. This seems to work. No post is showing under the default rewrite rule (e.g. `example.com/downloads/<postname>`) nor is a download listed in the default search results. Unfortunately the `$wp_query` arguments are also not set anymore. Therefore I'm not able to use `comments_template()` or any other loop-function inside my templates. It's clear: WordPress doesn't know my page structure and is not able to generate the correct settings. I've tried to manually pre-populate the `$wp_query` arguments before the redirect inside the `template_redirect` method. But this doesn't seem to work. I'm probably to late in the chain.               global $wp_query, $post, $withcomments;     $wp_query->is_single = true;     $wp_query->is_page = true;     $post = get_post($this->downloadId);     $withcomments = true;     wp_reset_query();      Any suggestions? Thanks in advance Roman


title: How to add search form in main page body?

text: I'm fairly new to wordpress. I'm trying to develop a website with search option to find available room information. I would like to add a search box where people would be able to enter their information and hit the Search button. Then it'll display the available rooms. Something like the below website http://www.easytobook.com/?amu=1972100201 If it's a duplicate question please accept my apologies. Thanks.


title: Crop image sizes directly from Media Library across network (not attached to post or page but sidebar)

text:
I have a MU network setup and I'm pulling in media library images and displaying 4 of those images randomly from across the entire network. I've seen a few people on here using similar codes to do the same thing, my questions is: **How do I crop images pulled directly from the media library dynamically?** Currently the code works however it merely scales the image size and on right click > view image it shows the image in full size and not as a cropped thumbnail etc. This obviously boosts the page size if each image is 5mb (x4 = 20mb) which is unnecessary, here is the code:               function get_images_from_media_library() {         $args = array(             'post_type' => 'attachment',             'post_mime_type' =>'image',             'post_status' => 'inherit',             'posts_per_page' => 4,             'orderby' => 'rand'             );         $query_images = new WP_Query( $args );         $images = array();         foreach ( $query_images->posts as $image) {             $images[]= $image->guid;         }         return $images;     }          function display_images_from_media_library() {         $imgs = get_images_from_media_library();         $html = '
';         $html .= '
Oriel / Gallery
';         foreach($imgs as $img) {             $html .= '';         }         $html .= '
Weld mwy o / View more
';         $html .= '
';         return $html;     }      Any help or suggestions would be much appreciated.


title: Recents posts pulling from different post type

text: This blog page is pulling from a Page Template called full-width-blog.php. The left of the content is where the supposed general posts should appear. On the right is the sidebar. How could you make the main left area pulling from Recent Articles and not from Testimonials? See image for an example: http://i.imgur.com/gVsnb.png full-width-blog: http://pastebin.com/R6BD1R8u


title: Find first image on paginated post for Pinterest

text: I've been looking for days, yet can't find a good answer. Perhaps the SE crowd can be of assistance. Any help is much appreciated. I am using a custom-coded pinterest button included on posts that pulls the first image of the post OR the featured image (if exists).               <a href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink($post->ID)); ?>&media=<?php      if ( (! has_post_thumbnail()) || ($paged != 0) ) {      echo catch_that_image();     } else {      // Has featured img     $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );     echo $image[0];      }      ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin It      Now, the function that fetches the first image of a post looks as follows:               function catch_that_image() {     global $post, $posts;     $first_img = '';     ob_start();     ob_end_clean();     $output = preg_match_all('//i', $post->post_content, $matches);     $first_img = $matches [1] [0];          if(empty($first_img)){ //Defines a default image     $first_img = "http://static.purseblog.com/default.jpg";     }     return $first_img;     }      Any idea how to modify the catch_that_image function to take into account the pagination and find the first image on the current page a user browses? I'd like to then send the URL to pinterest for more accurate pinning. Thanks so much in advance.


title: Switching database on the fly

text: I have read here about switching the current wp database on the fly using               $wpdb->select('database_name');      Once done, I understand that i will have to issue the same statement to the original database. Questions:   * Right after changing the database, do i need to flush caches or similar stuff to get things working properly? Will I need to call again WP header?   * Potential issues?


title: How do I turn off wordpress comments ability to capture a users ip address?

text: Going through the comments table on my wordpress site, I noticed that wordpress is storing the ip address of everyone who makes a comment on my site. How do I remove this functionality? I'm not just talking about the display of the ip in the template, I mean I don't want wordpress to capture it in the first place.


title: Randomise results from a category page?

text: I have my standard category page. On this page, I'd like to put a button which, when clicked, randomises the results shown on the category page. I know I could make a rand-category.php page and send the user on to that page. Ideally though, I'd like a more elegant solution, possibly something that refreshes the results without moving the user on/away from the page.


title: Featured image loads correctly while gallery images returns 404

text: I can't get why the featured image is loading correctly while those in the gallery returns a 404 if the links is to the attachment page. If i link to the file, the file is shown but if activate the "jQuery lightbox for native galleries" plugin, they won't load anymore. I tried deleting the .htaccess file to force the creation of a new one entering in the permalinks option page but nothing is changed.


title: how to show a category from a CPT?

text: I have a custom post type called 'seasons' and in there i have 3 categories (summer,winter and spring.) I want to show 10 random post from the winter category on a page. Please help.


title: Cron job to call php to email last 24 hours posts

text: We have been trying to call via CronJob a PHP script that will email the past 24 hours posts using the `'post_type' = 'reservations'` filter.               <?php       query_posts( array( 'post_type' => 'reservations', 'showposts' => 10 ) );       if ( have_posts() ) : while ( have_posts() ) : the_post();     ?>     <?php _res_name; ?>          <?php endwhile; endif; wp_reset_query(); ?>      I know this is wrong but for the life of me I cannot get my head round the sequence for this. Any advice?


title: Posting error with P2 theme

text: I'm getting the error: "Whoops! Looks like you are not connected to the server. P2 could not connect with WordPress." when trying to reply to comments/posts on P2, I'm on v1.5.2 Anything I can do to fix this?


title: Pull the content out of a page

text:
I wanna pull the data from this area "see the red area on the image below" ![enter image description here](http://i.stack.imgur.com/CQXVs.jpg) Out to a specific template I have a page template named page.php
             <?php while ( have_posts() ) : the_post(); ?>                 <?php get_template_part( 'content', 'page' ); ?>                 <?php comments_template( '', false ); ?>             <?php endwhile; // end of the loop. ?>

      but this just send me a comment field.. i need the text in the page and i need the header


title: How to resize images due to container width automatically server side/without CSS

text: Does anyone know how to resize the served images, so the image has a width due to the content containers width. I do not mean to resize the image via 100% width css, but instead resize the actual dimensions and size if the image itself. For e.g.: An image in an article which has the dimensions of `400px × 300px`. But in the overview I only need `200px × 150px`. But I do not want to edit every part of my theme to do so, because there are a lot of different sizes. Is there any possibility that this works automatically?


title: How do I know what variables are passed in a filter/action and what their meaning is?

text: Something I have seen several times now and I don't understand is the following: In a theme's `functions.php` a function is defined and then attached to a hook, like so (simplified example):               function do_stuff($a, $b) {         // Do stuff with $a and $b     }     add_filter( 'bloginfo_url', 'do_stuff', 10, 2 );      Basically I think I understand whats happening there, but how do I know what `$a`and `$b`is?   In a "traditional" PHP way, one would call the function maybe like that:               do_stuff("var a content", $var_b_content);      Then its clear what `$a`and `$b` contain, but how can I know that with Wordpress? Real life example, take the following function (credit to Frank Bültge):               if ( ! function_exists( 'fb_css_cache_buster' ) ) {             function fb_css_cache_buster( $info, $show ) {                     if ( ! isset($pieces[1]) )                             $pieces[1] = '';                     if ( 'stylesheet_url' == $show ) {                                  // Is there already a querystring? If so, add to the end of that.                             if ( strpos($pieces[1], '?' ) === FALSE ) {                                     return $info . "?" . filemtime( WP_CONTENT_DIR . $pieces[1] );                             } else {                                     $morsels = explode( "?", $pieces[1] );                                     return $info . "&" . filemtime( WP_CONTENT_DIR . $morsles[1] );                             }                     } else {                             return $info;                     }             }                  add_filter( 'bloginfo_url', 'fb_css_cache_buster', 9999, 2 );     }      The function can be used for CSS versioning by attaching the date of the last change (using `filemtime`) as querystring to the CSS call. You can see, the uses `$info` and `$show` as variables that are passed to that function. But how can I know what these variables contain? He even uses these variables in conditional logic (`'stylesheet_url' == $show`) so somehow there something must be passed automatically?


title: I don't have comments.php... how do I customize my comment fields

text: My page in question is here. I have tried to add a `comments.php` to my custom theme so I can remove the website field and so I could edit the default values of the fields and remove the labels. When I add a `comments.php` all of my comments disappear and the comments are no longer functional. I have no idea how to make these modifications. I've tried editing `comments-template.php` but removing the field in that file doesn't remove it from the site, I am assuming because it is already in the database. I am new to PHP so any details on how I can get these text fields edited would be great.


title: Recent comments per tagged post?

text: Could you please help me with some code to get all recent comments for posts that are tagged with for example "XYZ"? Thanks in advance, you guys are great!


title: How to have different header.php based on the user logged in?

text: I’ve a created wordpress membership site using wishlist member plugin. But I want to have different `header.php` based on different logins. Eg: Users are: Print, Web and Free   1. When Free user logs in – I want `header1.php` to load and stay till he logs out    2. When Print user logs in – I want `header2.php` to load and stay till he logs out    3. When Web user logs in – I want `header3.php` to load and stay till he logs out If nobody has logged in the default `header.php` stays. Please assist on how to do this. Regards, Raghav.


title: why does get_option( 'home' ) not work while using in plugin

text:
I'm working on a wordpress plugin and am running into an inssue with `get_option( 'home' )`. What I'm trying to do: if the user (or admin) is not logged in then a login form will appear on a custom page I've built (from the plugin). I had tried doing this from scratch but everything I was finding was telling how to do it from in the root theme folder... if anyone can help me do this (from scratch) from within a plugin I'm willing to try! Here is my source code...               <?php get_header(); ?>

                     <?php if ( is_user_logged_in()) { ?>                       <?php } else { ?>                                                             <form name="loginform" id="login_form" class="login_form wpcf7-form" action="<?php get_option( 'home' ); ?>/wp-login.php" method="post">
                             <input type="text" name="log" id="user_login" class="input" placeholder="Username" />

                             <input type="password" name="pwd" id="user_pass" class="input" placeholder="Password" />
                              <button name="wp-submit" id="wp-submit" class="btn wpcf7-submit"><?php _e("Sign in", "shorti"); ?></button>                          </form>                                           <?php } ?>

          <?php get_footer(); ?>      This is from a custom page template file that the plugin has created. The problem I'm having is when I go to sign in I'm redirected to a 404 error page saying, "url can't be found"... the reason for this is that it's only looking for `/wp-login.php`. I'm new to working with plugins... so it might be just a simple path defining issue or something noobish like that. My plugin folder looks something like this: photo-uploadr (main folder)/photo- uploadr.php (main file)/templates (secondary folder)/custom-uploadr.php (file with issue) Thanks & if you see anything that might not be best practice, let me know. ;)


title: Set posts of a custom post type to be private by default?

text: Say I created a custom post type called 'Private Posts' (`$post_type` = `itsme_private_posts`) and want all posts under the custom post type to be set to 'Private' automatically when published i.e. by default. How do I do it? Based on @brasofilo's answer to a related question on StackOverflow, I tried this:               add_filter( 'wp_insert_post_data', 'itsme_cpt_private', '99', 2 );     function itsme_cpt_private( $data , $postarr ) {         if( $postarr['post_type'] == 'itsme_private_posts' ) {             $data['post_status'] = 'private';         }         return $data;     }      It doesn't work i.e. it doesn't do anything; everything's the way it was before adding the function. It's as though the function doesn't exist or simply does nothing. Then, based on this article titled, "Force custom post type to be private", I tried this:               add_filter( 'wp_insert_post_data', 'itsme_cpt_private' );     function itsme_cpt_private( $post ) {         if( $post['post_type'] == 'itsme_private_posts' ) {             $post['post_status'] = 'private';         }         return $post;     }      It works, in that, when I publish or update a post it turns private. Good! But when I create a new post ('Add New') and leave without doing anything, it creates a 'private' (auto-)draft and saves it. Moreover I can't even trash that thing! Essentially I can't figure out how to do it. So, how do I set posts of a custom post type to be private by default?


I'm trying to insert Highcharts JS into one of my blog posts. Inserting the code into the text view didn't work and seemed messy anyway. I've also tried using `wp_register_script()` and `wp_enqueue_script()` in functions.php               global $post;     if( is_page() || is_single() )         {             switch($post->post_name)              {                 case 'test-post':                     wp_register_script( 'charts', get_template_directory_uri() . '/js/standalone-framework.js', array('jquery'));                     wp_enqueue_script('charts');                     wp_register_script( 'mychart', get_template_directory_uri() . '/js/my-chart.js', array('jquery'));                     wp_enqueue_script('mychart');      Using `is_page()` in header.php to create an if statement to output the script tags.               <?php if ( is_page('test-post')) { ?>         <script type='text/javascript' src="<?php bloginfo('template_directory'); ?>/js/standalone-framework.js"></script>         <script type='text/javascript' src="<?php bloginfo('template_directory'); ?>/js/my-chart.js"></script>     <?php } ?>      Finally I tried using custom fields without much luck either. What's the most efficient way to include this javascript in only a single post? There are lots of questions and answers with many being fairly old now.


title: Retrieve Array from within Array

text: I have an array being created within another array in Wordpress and I need to get the ID value from each Array. This is the code I am using to pull the array               <?php $pages = get_field('products');     get_field('product_id', $pages->ID); ?>      If I use `print_r($pages)` I get the following output:               Array     (         [0] => Array             (                 [product_id] => WP_Post Object                     (                         [ID] => 35238                         [post_author] => 13                         [post_date] => 2014-06-05 15:33:27                         [post_date_gmt] => 2014-06-05 15:33:27                         [post_content] => 40G parallel optics transceivers (40GBASE-SR4) ...                         [post_title] => 40G QSFP+ (MTP/MPO) to 4x10G SFP+ (8xLC) Assembly                          [post_excerpt] =>                          [post_status] => publish                         [comment_status] => closed                         [ping_status] => closed                         [post_password] =>                          [post_name] => 40g-qsfp-mpomtp-4x10g-sfp-8xlc-assembly                         [to_ping] =>                          [pinged] =>                          [post_modified] => 2014-07-01 08:34:38                         [post_modified_gmt] => 2014-07-01 08:34:38                         [post_content_filtered] =>                          [post_parent] => 36259                         [guid] => http://www.fibrefab.com/?page_id=35238                         [menu_order] => 0                         [post_type] => page                         [post_mime_type] =>                          [comment_count] => 0                         [filter] => raw                     )                  )              [1] => Array             (                 [product_id] => WP_Post Object                     (                         [ID] => 34484                         [post_author] => 13                         [post_date] => 2014-06-05 15:16:04                         [post_date_gmt] => 2014-06-05 15:16:04                         [post_content] => MTP/MPO QSFP+ trunk/ patchcord assemblies are ...                         [post_title] => 40G QSFP+ (MTP/MPO) to QSFP+ Assembly                         [post_excerpt] =>                          [post_status] => publish                         [comment_status] => closed                         [ping_status] => closed                         [post_password] =>                          [post_name] => mtpmpo-microcable-qsfp-40gb-trunk-patchcord-assembly                         [to_ping] =>                          [pinged] =>                          [post_modified] => 2014-07-01 08:34:24                         [post_modified_gmt] => 2014-07-01 08:34:24                         [post_content_filtered] =>                          [post_parent] => 36259                         [guid] => http://www.fibrefab.com/?page_id=34484                         [menu_order] => 0                         [post_type] => page                         [post_mime_type] =>                          [comment_count] => 0                         [filter] => raw                     )                  )          )      How I display the [ID] from each of these arrays?


title: Custom Fields and performance

text: My question : how many custom fields or even taxonomies WordPress can handle without affecting performance? The reason I ask, is because I started building a custom theme and I might need to have around 10 to 20 custom fields, and thinking if this will affect the speed of the site. I understand that speed also depends on server/hosting and number of visits, cache techniques, etc... I also expect that a post with one custom field will be faster then one post with ten custom fields. But, let's say a site that haves around 10,000 visits a day with a post with one custom field will the speed difference be much more different from a site with the same 10 000 visits a day with a post with 10 custom fields. Just trying to figure it out how much of a difference a custom field can make. Also in terms of custom searching using wp_query and custom fields parameters will the speed be affected. Thank you.


title: Best Way to Upgrade from WP 2.8 (!)?

text: I offered a friend to help translate from English some parts of his (mostly) Hebrew install. Then he told me two things: 1) That he's running 2.8 (he was worried about updating because he didn't want the design to break) and 2) That he has reason to suspect that the site is infected with a trojan horse since it gets blocked by some antiviruses. 1) What is the best way to go about upgrading? is it even feasible to start on a fresh installation and still have everything intact? including redirects? or will I have to go about it as per WP's documentation: step by step upgrading. 2) What can be done about the trojan horse? this is why I'm contemplating a fresh install, which I know is probably not recommended. Thank you in advance


title: Upgrading from 3.4.2

text: I recently took on a new client who runs a fairly active news site powered by WordPress. Part of what he wishes me to do is upgrade his WordPress version, something he's neglected to do since 3.4.2, my question is now: Would it be feasible to upgrade to 3.8.1 straight away or should I opt for taking it in small steps (start by upgrading to 3.5, then 3.6 etc.)? What would be appropriate security measures to take to prevent loss of data when doing this? I reckon problems will arise with the active plugins and his current theme so will I need to do a full backup of all files a database dump or will less suffice? Thanks in advance


title: sub CPT and CRUD

text: I need to create a child CPT for a parent CPT and display CRUD for the child CPT in a metabox of the parent CPT 'create post page'. For example: Suppose a vendor have different products. I need to display related product CRUD feature right under VENDOR creation page in a metabox. I don't want to use any plugin. Is there any wp way to do it? I can create hidden post type + meta and display them in metabox. Mostly I need the CRUD functionality like wordpress's **_view all post_** page. Can you please give me some hints?


title: How to migrate a database from a server to another

text: I try the export method of phpmyadmin, but the user is exported with the data... so there is no way to re import it into another database without error message. The old user is name : oldserver_username, and the new server user is called : some_text_server_name_new_user So there is NO WAY i can have the same username to export-import... how can i export and re import without having to have username check or bypass that ? i am completely lost in MySQL !


title: Custom permalinks - post type - hierarchical taxonomy's

text: I did folowed the steps / solution from Jeff it helped me alot with he's settings, got it for about 90% working properly. But getting stuck on the post / postname. It loads now the producten/%taxonomy_products%/ without the 404 errors. But when i click further on a post i get the 404 errors again. Maybe you can see what i'am doing wrong? **Custom post type and taxonomy settings 'Sorry for the dutch words' :**                   add_action( 'init', 'products_taxonomy_options' );     function products_taxonomy_options() {          //=============== Register custom post type - PRODUCTS ================          register_post_type('products',       array( 'label'                    => __('Producten'), // Postype              'labels'                   => array( 'name'                => __('Producten'),                                                   'singular_name'       => __('Producten'),                                                   'add_new'             => __('Product toevoegen'),                                                   'add_new_item'        => __('Nieuw product'),                                                   'edit_item'           => __('Wijzig product'),                                                   'new_item'            => __('Nieuw product'),                                                   'all_items'           => __('Alle producten'),                                                   'view_item'           => __('Bekijk producten'),                                                   'search_items'        => __('Zoek producten'),                                                   'not_found'           => __('Er zijn geen producten gevonden'),                                                   'not_found_in_trash'  => __('Geen producten gevonden in de prullenbak')                                                                            ),               'public'                  => true,               'can_export'              => true,               'show_ui'                 => true,    // UI in admin panel               '_builtin'                => false,   // It's a custom post type, not built in               '_edit_link'              => 'post.php?post=%d',               'capability_type'         => 'post',               //'menu_icon'             => get_bloginfo('template_url').'/images/favicon.ico',               'hierarchical'            => true,               'rewrite'                 => array(   "slug" => "producten"), // Permalinks               'supports'                => array(   'title',                                                     'editor',                                                                                'thumbnail',                                         ),                              'show_in_menu'            => true,               'taxonomies'              => array('productcat')             )         );               //=============== Register custom taxonomy - PRODUCTS CATEGORY ================           register_taxonomy(  "productcat",                      array(  "products"  ),                      array ( "hierarchical"      => true,                              "label"             => "Product categorieën",                              'labels'            => array(   'name'              => __('Product categorieën'),                                                             'singular_name'     => __('Product categorie'),                                                             'search_items'      => __('Categorieën zoeken'),                                                             'popular_items'     => __('Populaire categorieën'),                                                             'all_items'         => __('Alle categorieën'),                                                             'parent_item'       => __('Huidige categorie'),                                                             'parent_item_colon' => __('Huidige categorie:'),                                                             'edit_item'         => __('Wijzig categorie'),                                                             'update_item'       => __('Update categorie'),                                                             'add_new_item'      => __('Nieuwe categorie toevoegen'),                                                             'new_item_name'     => __('Nieuwe categorie')                                                 ),                                'show_ui'         => false,                               'query_var'       => true,                               '_builtin'        => false,                               'paged'           => true,                               'rewrite'         => array(   'hierarchical'      => true,                                                              'slug'              =>'products',                                                             'with_front'        => false                                                 ),                             )                     );          }      **Jeff's settings:**               add_filter('rewrite_rules_array', 'mmp_rewrite_rules');     function mmp_rewrite_rules($rules) {         $newRules  = array();         $newRules['producten/(.+)/(.+)/(.+)/(.+)/?$'] = 'index.php?products=$matches[4]'; // my custom structure will also have the post name as the 5th uri segment         $newRules['producten/(.+)/?$']                = 'index.php?productcat=$matches[1]';               return array_merge($newRules, $rules);     }          function filter_post_type_link($link, $post)     {         if ($post->post_type != 'products')             return $link;              if ($cats = get_the_terms($post->ID, 'productcat'))         {             $link = str_replace('%taxonomy_products%', get_taxonomy_parents(array_pop($cats)->term_id, 'productcat', false, '/', true), $link); // see custom function defined below         }         return $link;     }     add_filter('post_type_link', 'filter_post_type_link', 10, 2);          // my own function to do what get_category_parents does for other taxonomies     function get_taxonomy_parents($id, $taxonomy, $link = false, $separator = '/', $nicename = false, $visited = array()) {             $chain = '';            $parent = &get_term($id, $taxonomy);              if (is_wp_error($parent)) {             return $parent;         }              if ($nicename)                 $name = $parent -> slug;             else                 $name = $parent -> name;              if ($parent -> parent && ($parent -> parent != $parent -> term_id) && !in_array($parent -> parent, $visited)) {                 $visited[] = $parent -> parent;                 $chain .= get_taxonomy_parents($parent -> parent, $taxonomy, $link, $separator, $nicename, $visited);              }              if ($link) {             // nothing, can't get this working :(         } else                 $chain .= $name . $separator;             return $chain;         }      **Permalink settings:**               /producten/%taxonomy_products%/%postname%/      Working with the Taxonomic SEO Permalink plugin Thanks!


title: Add 'Description' to taxonomy 'Quick Edit'

text: This seems fairly straight forward, but I cannot find a definite guide on how to add the taxonomy description field to the quick edit box. I've followed several tutorials on adding fields to the custom quick edit box, but the core fields (name, description and slug) do not follow the same guidelines as adding custom fields to the taxonomy quick edit box. Is it even possible to do so? If not - I guess the best alternate is to create another 'Description' meta-field and that way add it to the taxonomy quick edit box. Thanks for any input. Roc.


title: Downgrading a WP3.3.1 Network Install

text: Good Morning-- Today I need to downgrade a site from a WP network install to a normal WP install. I thought this would be simple -- just removing these lines from wp- config.php: define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', false ); $base = '/xxx/blog/'; define( 'DOMAIN_CURRENT_SITE', 'xxx.xxx.xxx' ); define( 'PATH_CURRENT_SITE', '/xxx/blog/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 ); and changing define('WP_ALLOW_MULTISITE', true); to define('WP_ALLOW_MULTISITE', false); But I consistently am getting a: You do not have sufficient permissions to access this page. when I try to login as an administrator on the site. Any thoughts on how to accomplish this? Thanks in advance for all your insights! Stephen


title: Get basic Image Uploader on User Profile Page

text:
I am trying to add an image uploader to the user profile pages. I do have it up and running on a basic registration page, but somehow the same, but slightly adjusted code does not work when added to functions.php. The field is loaded and WordPress does allow easy updating, but in profile view no image is shown. To get the image and store it I use               /********************************************************************     Profile Image Upload Field Code     *********************************************************************/     require_once( STYLESHEETPATH . '/img_upload_resize_crop.php' );          add_action( 'init', 'custom_img_uploader' );          function custom_img_uploader () {              if (isset($_FILES['profilePicture']['name'])!= "" ) {          if ( $_FILES['profilePicture']['name']!="" ) {         $your_image = new _image;         $upload_dir = wp_upload_dir();         //To Upload         $your_image->uploadTo = $upload_dir['basedir'].'/';         $upload = $your_image->upload($_FILES['profilePicture']);                   //To Resize         $your_image->newPath = $upload_dir['basedir'].'/thumbs/';         $your_image->newWidth = 150;         $your_image->newHeight = 200;         $resized = $your_image->resize();         $profilePicture=str_replace($upload_dir['basedir'].'/thumbs/', "", $resized );         unlink($upload);     }else{         $profilePicture='';     }     }     }      To display the field in HTML I have:
     <?php _e("Profile Image"); ?>	          <input type="file" name="profilePicture" id="profilePicture" style="float:left;" />
      And to save it I use this:               update_user_meta( $user_id, 'userphoto_thumb_height', 59);     update_user_meta( $user_id, 'userphoto_thumb_width', 80 );     update_user_meta( $user_id, 'userphoto_thumb_file', $profilePicture );      Does anyone see why in Profile View this code:               <?php if(get_the_author_meta( 'userphoto_thumb_file', $getId )!=""){?>                             <img src="<?=$uploads['baseurl'];?>/thumbs/<?=get_the_author_meta( 'userphoto_thumb_file', $getId );?>" />      does not load a stored image? **Update I and II** Basic debugging **Update III** After adding an `isset()` I got a little further:               [28-Mar-2012 07:14:46] PHP Notice:  Undefined variable: profilePicture in /home/user/public_html/wp-content/themes/theme-name/functions.php on line 346      On that line I have `update_user_meta( $user_id, 'userphoto_thumb_file', $profilePicture ); ` ~~Seems like even though I have the variable`profilePicture` defined, it is not grabbed~~ Was just a notice and does not seem to be relevant nor causing the upload issue. **Update IV** I wrapped the image uploader code in a function and added it as an action. See code with updates above. I still have an undefined variable `profilePicture` nor is the image uploaded. Entire functions.php file is here http://pastebin.com/YGYz3Qnv **Update V** I just realized I do not not have a good $_POST option for the profilePicture. Looking at the plugin mentioned by a @brasofilo at http://plugins.svn.wordpress.org/user-avatar/trunk/user-avatar.php I see this code I might be able to use, but I need to adjust it a lot:               <form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo admin_url('admin-ajax.php'); ?>?action=user_avatar_add_photo&step=2&uid=<?php echo $uid; ?>" >                 <?php _e('Choose an image from your computer:','user-avatar'); ?>
<input type="file" id="upload" name="uploadedfile" />                 <input type="hidden" name="action" value="save" />                 <?php wp_nonce_field('user-avatar') ?>
<input type="submit" value="<?php esc_attr_e('Upload'); ?>" />
         </form>      I just wonder if a form is needed as it wasn't for the other text fields and how I need to add `$user_id` and how to adjust `update_user_meta` **Update VI** Made `$profilePicture` global as recommended by contributor **Update VII** Considering using option from Unrelated Media here. But as it will still take quite a bit for time for me to integrate this into my current functions.php I will keep this thread opened until I have managed to do this.


title: Why won't is_search work inside functions.php?

text: I'm trying to use is_search to output some stuff from functions.php. I'm using is_search on the actual search page itself and it works fine:               if(is_search()) {        echo get_search_query( '<h1>', '</h1>' );     }       But from functions.php this doesn't work:               function data_scroll_all(){        if(is_search()) {          $offset = $_POST['offset'];          $category = $_POST['cat'];          $args = array('posts_per_page' => 3, 'category__not_in' => 1, 'offset' => $offset, 'orderby' => 'date', 'cat' => $category);          $loop = new WP_Query($args);            if($loop->have_posts()) {            while($loop->have_posts()){            $loop->the_post();             get_template_part( 'content-archive' );            }         } wp_reset_postdata();      } else {         echo "Nope!";        }     die('');      } With this I just get "Nope!" when I'm on the search page. I have my search template setup like this:               <?php     /*     Template Name: Search Page     */     ?>     <?php     global $query_string;          $query_args = explode("&", $query_string);     $search_query = array();          foreach($query_args as $key => $string) {         $query_split = explode("=", $string);         $search_query[$query_split[0]] = urldecode($query_split[1]);     } // foreach          $search = new WP_Query($search_query);     ?>      I have a a waypoint "infinite-scroll" function that triggers when reaching the bottom of the page:               var ajax_url = $('.loadAll').attr('data-url');     var cat = $('.loadAll').attr('data-cat');     var offset = -3;     $('#infinite-load').waypoint(function (direction) {         if (direction === 'down') {             offset = parseInt(offset) + 3;             $.ajax({                 dataType: "HTML",                 url: ajax_url,                 type: 'POST',                 data: {                     action: 'data_scroll_all',                     cat: cat,                     offset: offset                 },                 beforeSend: function () {                     $(".loading").show(); //show image loading                 },                 success: function (data) {                     $(".loading").hide();                     $('#infinite-load').append(data);                     $.waypoints('refresh');                 }             });         }     }, {         offset: 'bottom-in-view'     });


title: How to handle image resize in media_handle_sideload?

text: I am using `media_handle_sideload` function to upload images in my plugin. Is it possible to disable image resize or set it to a specific size and do not make copies (upload only resized image).


title: Remove custom taxonomy column from my custom post type columns

text: I am using wp 3.5 i have a custom post `(sp_product)` and also i have custom taxonomy. I want to remove that custom taxonomy filter column but i don't want to make `'show_admin_column' => false`. I wanna unset from `$columns['']` . How should i do that ? i also want to add some css/js when it will show in column and top select menu. (showing in this image like)


title: Is it safe to use the file editor to make customizations?

text: I'm constantly reading stuff on the wordpress forum where people are making all mannar of customizations by modifying php or css files using the file editor. But aren't all those files generated? Don't these files get reverted when a change is made to the website through the wp-admin console or when wordpress updates?


title: Reservations as Post

text: I am creating a multi-user, multi-product, multi-product-category reservations engine proof of concept. As I need to build it really fast I am using Wordpress's custom post types to manage a lot of the data. I have reached a cross roads as I have modelled individual reservations as a post type, however, as the ones who will be making said reservations may not be registered and/or will be users with the subscriber role. Is it possible for them to still create a reservations post type?


title: wordpress blog in subdirectory or subdomain

text: I'm using Wordpress for my website. Now I'd like to add a blog section to my website. I'd like it to be accessible like this: http://www.mywebsite.com/blog or even better, as a subdomain: http://blog.mywebsite.com I've done some research and my understanding is that the second option would be possible using a multiple-site configuration. I've tried and I broke everything :) Otherwise I could just install a new wordpress instance but it's going to be tedious. So the first option seems more feasible but I'm not sure how to implement it ?


title: When is wp_trim_excerpt() called?

text: There doesn't appear to be any reference to wp_trim_excerpt() outside of it's declaration - I've checked both the Trac and Xref - when does it work its magic?


title: Show menu only if_page is

text: I have created 4 menus (submenus) in wordpress. I need to know how show this menus only if pages ids are "10 and 11 for example. Is possible? I'm desperated after two hours... thanks! This is my code for one of them:               <?php if( has_nav_menu( 'smone-menu', 'responsive' ) ) { ?>             <?php wp_nav_menu( array(                                    'container'      => '',                                    'menu_class'     => 'smone-menu',                                    'theme_location' => 'smone-menu'                                )             );             ?>              <?php } ?>


title: Display Tags of Child Pages

text:
I'm trying to display tags of child pages on the parent page. In my functions.php:               // add tag support to pages     function tags_support_all() {     register_taxonomy_for_object_type('post_tag', 'page');     }          // ensure all tags are included in queries     function tags_support_query($wp_query) {     if ($wp_query->get('tag')) $wp_query->set('post_type', 'any');     }          // tag hooks     add_action('init', 'tags_support_all');     add_action('pre_get_posts', 'tags_support_query');      In my page template:
      <?php          $pages = get_pages('child_of='.$post->ID.'&sort_column=menu_order');     $count = 0;     foreach($pages as $page)     {         $content = $page->post_content;         $images = get_field('gallery', $page->ID);         $thumbnail = $images[0];          ?>

<a href="<?php echo get_page_link($page->ID) ?>" target="_blank"><img src="<?php echo $thumbnail['url'] ?>"/>

<a href="<?php echo get_page_link($page->ID) ?> "target="_blank"><?php echo $page->post_title ?>

<?php echo $page->post_tag ?>

          <?php     }     ?>
      This displays the thumbnails and titles of the child pages, but not the tags. What could be the issue?


title: Mapping Domains to Permalinks (not multisite)

text: I am trying to do this on a standalone WP installation (not multisite). What I am trying to achieve is:   1. User saves `domain.com` on usermeta. (done)   2. User creates a new CPT, say `company`. Which is accessible via by default `original.com/company/example-company` (done - by default)   3. I need all the posts created by the user to make available also via `domain.com/company/example-company` when the usermeta `domain` is set. I understand that the DNS and domain should be pointed to current WP installation (irrelevant), but not sure how to map the domain to a permalink. **Algorithm Should Be Something Like This**   1. Check if `company` CPT single page is shown.   2. Check if the author set a domain.   3. If `domain` is set, modify the permalink.


title: Count Words using tinymce in the front-end

text: i am using a front built in (article directory plugin) tinymce with wp_editor.   what ever i tried i cant get the word counter to work automatically.. i can count the words fine in the HTML tab using a jquery word counter but not   in the wysisyg tab since its an iframe... i got some new white hairs dealing with this issue and would really appreciate   your input / help or even a gr8 reference to a solution. **Here is the code i currently have (relevant part of the page) including   the jquery counter which i would rather not use and would rather use wordpress   or to be precise tinymce build in plugin / ability to count words as if inside the dashboard.**                    <?php             wp_print_scripts('quicktags');             require_once(ABSPATH . '/wp-admin/includes/post.php');             function richedit() { return true; }             add_filter('user_can_richedit', 'richedit');                 //wp_tiny_mce( false, array( 'height' => '370' ) );             if ($options['default_editor'] == 'html') {                 add_filter( 'wp_default_editor', create_function('', 'return "html";') );             } else {                 add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );             }             wp_editor($_POST['post'], 'minword' , array('textarea_name' => 'minword', 'editor_class' => 'count[50,0]'));         } else {             echo '';             wp_editor($_POST['post'], 'minword' , array('textarea_name' => 'minword', 'editor_class' => 'count[50,0]'));         }     ?>      . **REVISED TO BETTER EXPLAIN @bueltge AND OTHER'S MY PROBLEM...**   i have uploaded a temp version online so i can show you the problem. The website is in hebrew so you need to login   with the demo user / pass combination which is: temp / temp Url: HERE Then Click the last button meaning the first from the left...   there you would see the editor. trying to write it would results   with the chars counter not changing but if you click the HTML tab you   would see the chars counter is working.. **So.. How can i get the counter to count when in wysisyg mode?** this example uses the code buelge suggested which a minor change   to the id - here is the revised top two lines which i have changed               var comment_input = $( '#articleSubmit textarea' );     var submit_button = $( '#articleSubmit #submit' );


title: Switching MultiSite installation from HTTP to HTTPS

text: I installed MultiSite with the URL set as _http://example.com_ , but now I want to force all requests to go over HTTPS, so I'm trying to change the URL to be _https://example.com_. I've gone through the database and updated all the `siteurl` and `home` values to have _https_ , but the site still loads over HTTP, instead of being redirected to HTTPS. I know that I could setup some htaccess rules, but that's prone to errors. In regular installations WordPress will automatically redirect all requests to the canonical URLS defined in the `siteurl` and `home` settings, so I'm assuming that MultiSite does too.


title: Wordpress admin post meta boxes RESPONSIVE

text: is it possible to add custom post type meta box under text editor when I am in less then 600px width ? Because after text editor goes right sidebar.


title: Reset default roles and capabilities

text: I've been having a difficult time adding custom post type capabilities to roles (Adding capabilities to default roles) and I suspect that my muddling around may have caused some problems. I also have installed and de-installed various plugins some of which added capabilities. As a result My WP Role object is a bit of a mess. Does anyone know of a way to reset capabilities or do I need a fresh install?


title: URL to download latest version of WP for other languages than English

text: I'm considering he possibility of automating/scripting a basic WP install. Part of it will include downloading the latest WordPress version. The en-us version can be obtained by downloading http://wordpress.org/latest.zip (or tar.gz), is there any way to get an always up-to-date file URL for other languages?


title: Customized title tag for each page in pagination?

text: **With the reference of below questions.**   How to change title tags on paginated posts?   Paginate tags page   How to change title tags on paginated posts?   Add Page number to Meta Description in Wordpress SEO by Yoast   I am using **WP Page Numbers** plugin for pagination But plugin didn't offer different options. I would like to add different **title tag** for each page in my **pagination pages**. Below are different pages **Pagination for all Index pages (50 pages and increasing)**   http:// domain.com/page/2/ **Pagination for all Categories(20 pages each in 4 categories and increasing)**   http:// domain.com/this-is-category-no-1/page/2/   http:// domain.com/this-is-my-cat-no-2/page/3/


title: Use a hierarchical custom post type for a main blog and subblogs?

text: After some trouble with custom post type/custom taxonomy permalinks I'm trying out custom post types with hierarchy = true and capability_type = 'page'. Would I miss out on any blog capabilities or go against some unspoken WordPress rule if I used this structure for my blog and my subblogs?   * Blog (hierarchical CPT)      * Subblog nr1 (CPT page)        * Blogpost nr1       * Blogpost nr2       * ...etc     * Regular blog post (page!) in the 'main blog'     * Another regular blog post (page!) in the 'main blog'     * Subblog nr2 (CPT page)        * Blogpost nr1       * Blogpost nr2       * ...etc Would this be a bad idea for some reason - I'm used to blogposts being _posts_ but maybe this is just as good? The reason why I want this structure is because it's easy to rewrite the permalinks the way I want them. For instance, I will create a tag taxonomy for each subblog and then it's easy to rewrite the tag archives like this: /blog/subblog_nr1/tags/tag_name Also, of course, the subblog posts will automatically have the most obvious permalink: /blog/subblog_nr1/blogpost My only problem then is how to show the subblog archive. I guess I could hack the single-blog.php to show the blogpost children if the blogpost has children. Any other ideas?


title: How to add just one page in Arabic

text: Hi I have a WordPress site where all the content is in English, however I need just one page to be in Arabic with left to right text, plus some bullets which obviously appear on the right instead of on the left, how do I go about creating such a page?


title: How to change the text of link 'Home' in bbPress forum breadcrumb?

text: I just installed bbPress 2.0.2 forum plugin for WordPress, and would like to change the text of link `Home` to `iGeek` (or anything else, for that matter). So the breadcrumb `Home › Community` becomes `iGeek › Community` (or something like that). How do I do that? In case it helps, this is the code in `\wp-content\plugins\bbpress\bbp- includes\bbp-common-template.php` that determines the text:               /** Home Text *********************************************************/          // No custom home text     if ( empty( $args['home_text'] ) ) {              // Set home text to page title         if ( $front_id = get_option( 'page_on_front' ) ) {             $pre_front_text = get_the_title( $front_id );              // Default to 'Home'         } else {             $pre_front_text = __( 'Home', 'bbpress' );         }     }      ![bbPress Breadcrumb](http://i.stack.imgur.com/Ki4qD.png)


title: How to let users choose where to search for posts?

text: I have no code to let you correct/see, I'm still in 'thinking stage'. What i would like to achieve is this: A real estate website with a few search functionalities. This new agency (REALLY NEW we have no office actually!) will split the city in 4 (or more) parts, in each one of these part there will be different houses, each house will have different number of rooms or will be available only to girs/boys. So the user when reach my website have to be able to choose: Search Form 1   * Which Part of the city      * Accept boy/girls/both     * Budget Search Form 2   * Accept boy/girls/both      * Budget     * Which part And so on... Maybe the best way to have a simpler search query would be to use Custom Field, Am I wrong? Is there anyone who can help me to find a tutorial, or can point me to the right direction or has/know a plugin to do something similar?


title: How to change the "All Categories" label within the panel of my custom post type?

text: I just created a custom post type and a custom taxonomy:               // === CUSTOM TAXONOMIES === //     add_action('init', 'my_custom_taxonomies', 0);          function my_custom_taxonomies() {         register_taxonomy(             'location',     // internal name = machine-readable taxonomy name             'static_content',       // object type = post, page, link, or custom post-type             array(                 'hierarchical' => true,                 'labels' => array(                     'name' => __( 'Location' ),                     'singular_name' => __( 'Location' ),                     'add_new_item' => 'Add New Location',                     'edit_item' => 'Edit Location',                     'new_item' => 'New Location',                     'search_items' => 'Search Location',                     'not_found' => 'No Location found',                     'not_found_in_trash' => 'No Location found in trash',                 ),                 'query_var' => true,    // enable taxonomy-specific querying                 'rewrite' => array( 'slug' => 'location' ), // pretty permalinks for your taxonomy?             )         );              wp_insert_term('Footer', 'location');         wp_insert_term('Header', 'location');     }               // === CUSTOM POST TYPES === //     add_action( 'init', 'create_my_post_types' );          function create_my_post_types() {         register_post_type( 'static_content',             array(                 'labels' => array(                     'name' => __( 'Static Content' ),                     'singular_name' => __( 'Static Content' ),                     'add_new_item' => 'Add New Static Content',                     'edit_item' => 'Edit Static Content',                     'new_item' => 'New Static Content',                     'search_items' => 'Search Static Content',                     'not_found' => 'No Static Content found',                     'not_found_in_trash' => 'No Static Content found in trash',                 ),                 '_builtin' => false,                 'public' => true,                 'hierarchical' => false,                 'taxonomies' => array( 'location'),                 'supports' => array(                     'title',                     'editor',                     'excerpt'                 ),                 'rewrite' => array( 'slug' => 'static_content', 'with_front' => false )             )         );     }      But when I enter the edit page of my custom post type, on the sidebar it says "All Categories." It should say "All Locations." How do I change that label?


title: How to display retweet count and likes in the meta above the excerpt

text: There are several plugins that insert buttons to retweet and like into a post. You can see the count of retweets and likes at the top of single blog posts. What I want to do is show the retweets and likes in the blog home page, which has excerpts and thumbnails Like this Fabuous Post Title Retweet (button) - 45 18 likes [excerpt] There must be a way to edit functions.php for this but I don't know what to do. How is this done? THanks Examples of desired display: http://epiclaunch.com/ http://wptricks.net/