title: "Database error" with Posts 2 Posts plugin: conflict with nextGEN gallery plugin?

text: I'm using WP 3.6 and Posts 2 Posts plugin 1.6.2. I have one main CPT called 'participant' which is connected to 2 other CPTs called 'event' and 'group'. When viewing a particular 'participant' post, I normally see 2 boxes in the sidebar: 'connected events' and 'connected groups'. Since I updated WP and all plugins including P2P (edit: and NextGEN gallery, which seems to be the one conflicting with P2P), I now have this error message in these 2 boxes: > `WordPress database error: [Unknown column 'ids' in 'field list']`               SELECT          wp_posts.*, wp_p2p.*      FROM wp_posts      INNER JOIN wp_p2p      LEFT JOIN wp_p2pmeta AS p2pm_order          ON ( wp_p2p.p2p_id = p2pm_order.p2p_id AND p2pm_order.meta_key = 'order' )      WHERE 1=1          AND wp_posts.post_type = 'event'          AND (wp_posts.post_status <> 'trash' AND wp_posts.post_status <> 'auto-draft')          AND (wp_p2p.p2p_type = 'participant_to_event'              AND wp_posts.ID = wp_p2p.p2p_to              AND wp_p2p.p2p_from IN (                 SELECT ids                      FROM wp_posts                      WHERE 1=1                          AND wp_posts.ID IN (1889)                          AND wp_posts.post_type = 'participant'                          AND (wp_posts.post_status = 'publish'                              OR wp_posts.post_status = 'future'                              OR wp_posts.post_status = 'draft'                              OR wp_posts.post_status = 'pending'                              OR wp_posts.post_status = 'private')                  ORDER BY wp_posts.post_date DESC )             )      ORDER BY p2pm_order.meta_value+0 ASC, wp_posts.post_date DESC


title: Filters 'request' and 'parse_query' not firing in sites.php nor link-manager.php

text: I'm trying to make sortable columns in Sites and Links listings admin pages. `/wp-admin/network/sites.php` and `/wp-admin/link-manager.php` The problem is the following filters are not firing up in these screens, preventing the query modification. Is there other method that could be used?               function site_category_column_orderby( $vars ) {         //global $firephp;         //$firephp->log($vars, 'vars');         if ( isset( $vars['orderby'] ) && 'site_category' == $vars['orderby'] ) {             $vars = array_merge( $vars, array(                 'meta_key' => 'site_category',                 'orderby' => 'meta_value_num'             ) );         }         return $vars;     }     add_filter( 'parse_query', 'site_category_column_orderby' );               function link_thumbnail_column_orderby( $vars ) {         if ( isset( $vars['orderby'] ) && 'link_thumbnail' == $vars['orderby'] ) {             $vars = array_merge( $vars, array(                 'meta_key' => 'link_thumbnail',                 'orderby' => 'meta_value_num'             ) );         }         return $vars;     }     add_filter( 'request', 'link_thumbnail_column_orderby' );      **[UPDATE]** I'd like to sort the a Link column for this plugin: http://wordpress.stackexchange.com/a/50389/12615 And the a Site column for this other one: http://wordpress.stackexchange.com/a/50936/12615


title: "Item not updated" when try to change category properties

text: When I try to change some properties for some categories (in most categories it works without any issues), like category name, or description, I see that it is not updated, and I get an issue `"Item not updated"`.   What can be the problem?


title: Looking to implement a scrolling gallery in my theme

text: I'd like to include a scrolling gallery in a theme I am developing. Currently I have the code that "grabs" the attachments and place the thumbs inside a div (without using the gallery shortcode or anything) I'd like to build a gallery that shows the thumbs scrolling below the content and the image to display above, aside with the content. I attach a image of the design here I don't want to use NextGen or any plugin so, any help pointing me to a direction will be nice and very appreciated.!


title: Multiple Archive Pages for Custom Post Types AND Taxonomies

text: This is both a "how do I?" and "how should I?" question, as I'm thinking of ways to achieve my goal but they seem rather messy, so I'm hoping there's a neater way. Currently I have a custom post type, which has a custom taxonomy attached to it and uses a custom date field (like an "event date"). What I'd like to do is have a landing page for the post type, and somehow a combination of the following (ideally all grouped by month):   * View posts from custom post type, taxonomy term A, with event date in the future   * View posts from custom post type, taxonomy term A, with event date in the past   * View posts from custom post type, taxonomy term B, with event date in the future   * View posts from custom post type, taxonomy term B, with event date in the past I'd prefer to avoid 4 pages, perhaps having a page that shows posts with event date in the current month, and navigation to go forward or backward a month. I've got queries that compare the event date to the current date, distinguishing those in the future from those in the past, but I'm not sure a) how to display the current month with both forward and backward navigation, and b) how to group the posts by month (with the month name as a header). I'm also unsure how to create the appropriate templates and link them together. I currently have an archive-{custom post type}.php template, but what other files would I need to create (if any), and assign URLs to them? All advice appreciated. Thanks.


title: How to use the HTTP API with a Proxy?

text: If I want to route a HTTP request through a local (alias: on the current server) Proxy, how would I go around this? The allowed Proxy settings for the `wp-config.php` are the following:               # HTTP Proxies     # Used for e.g. in Intranets     # Fixes Feeds as well     # Defines the proxy adresse.     define( 'WP_PROXY_HOST',          '127.0.84.1' );     # Defines the proxy port.     define( 'WP_PROXY_PORT',          '8080' );     # Defines the proxy username.     define( 'WP_PROXY_USERNAME',      'my_user_name' );     # Defines the proxy password.     define( 'WP_PROXY_PASSWORD',      'my_password' );     # Allows you to define some adresses which      # shouldn't be passed through a proxy.     define( 'WP_PROXY_BYPASS_HOSTS',  'localhost, www.example.com' );      _This question isa follow up on this question._


title: Select post from dropdown and add query args not working

text: The behavior of the below should be that the user makes a selection on the dropdown box and the page refreshes with a query arg of `editevent=1` and also passes a value of the post ID with the selection chosen. Above the dropdown, it should say > Post ID: [post ID here] The problem is with this bit of code:               <option value="<?php the_ID(); ?>"><?php the_title(); ?>     </option>      When I put the ID of the post as the value, it makes the form redirect to the actual post instead of just refreshing the current page. I can't figure out why it's doing that. I have the form set to `action="#"` and there is no reference to the permalink of any URL in the code. Here is the full snippet:               <?php if ($_GET['editevent'] == true) {         echo 'Post ID: '.$_GET['page_id'];     }     ?>         <form method="GET" action="#">         <select name="page_id" id="page_id" onchange="this.form.submit()">             <?php             global $post;             $args = array( 'numberposts' => -1, 'post_type' => 'event', 'season' => '2013-2014');             $posts = get_posts($args);              foreach( $posts as $post ) : setup_postdata($post); ?>                 <option value="<?php the_ID(); ?>"><?php the_title(); ?>                 </option>             <?php endforeach; ?>         </select>         <input type="hidden" name="editevent" value="true" />     </form>


title: Unassign uncategorized from post with 2 or more categories

text: So I have a bunch of posts assigned categories like: a main one and uncategorized one (which I forgot to unselect). The problem is that i'm using `%category%/%postname%` as permalink which will use the lower ID category in permalink, which obviously will be `uncategorized`. How do I unassign `uncategorized` category from those posts (2000+ posts). I guess I probably need to write a query for this. Has anyone done this before? Or should I just update the ID of `uncategorized` to a very high number?


title: A refreshless WordPress website

text: As I said in my previous post, I am totally new in the WordPress world. My knowledge of PHP, Css, HTML and JavaScript is a little old but I am sure I can do this by my own with some guidance. Please consider the image below: ![enter image description here](http://i.stack.imgur.com/0oVy0.gif) It consists of four main pages. By clicking on every category, new content will be loaded without the whole page getting refreshed every time. Please help me. How should I do this in WordPress? Loop functions, plugins, widget, even if you name your options, it would be a great help for me.


title: WP List Pages - Add Title Attributes to Anchors

text: Using the default `wp_list_pages()` is there an easy way / filter to add title attribute to the anchors? Right now it just spits out the anchor with no title attribute but I would like to add it on just as the page title or something: `<a href="http://www.url.com" title="Test Page">Test Page</a>` Now I know I can do this using a big nasty walker but I feel like that's many lines of code for such a small thing. Is there a simple way / easy way to add the Title Attribute to `wp_list_pages()` anchors? Think code-golf.


title: Does WordPress automatically do 301 redirect if I change permalink

text: I don't know how to check this but it seems to do the redirection when I change the permalink structure.


title: Translating dynamic output with qtranslate

text:
I am working on a food recipe site, by using a recipe plugin, the output of the ingredients are generated thru a function inside the plugin function file. (All ingredients are saved as custom taxonomies, which I already have translated manually.) I am trying to change the output so its translated by qtranslate plugin. The function generating the ingredient list is as under.                   function recipress_recipe($field, $attr = null) {             // ingredients             case 'ingredients':             $ingredients =  $meta['ingredient'];             foreach($ingredients as $ingredient) {                 $ingredients = unserialize($ingredient);             }                $output = $ingredients;             return $output;             break;             }              // recipress_ingredients_list         function recipress_ingredients_list() {             $ingredients = recipress_recipe('ingredients');             $output = '
';             foreach($ingredients as $ingredient) {                  $the_ingredient = $ingredient['ingredient'];                 if(!$ingredient['ingredient']) continue;                 $output .= '
';                 if (isset($the_ingredient))                  $term =  get_term_by('name', $the_ingredient, 'ingredient');                 $output .= '';                 if (!empty($term)) $output .= 'slug, 'ingredient').'">';                 $output .= $the_ingredient;                 if (!empty($term)) $output .= '';                 $output .= ' ';             }             $output .= '
';                  return $output;             }      output is generated with                     echo $recipe['ingredients'] = recipress_ingredients_list();      I have tried the following option without any luck                       global $q_config;             $ingredients .= qtrans_use($q_config['language'], $meta['ingredient'];, true);             $output .= qtrans_use($q_config['language'], $the_ingredient, true);      another point is that since I have translated all taxonomies and if I call the same tax with                <?php echo get_the_term_list( $post->ID, 'ingredient', '', ', ', '' ); ?>      it does work Regards


title: How can I add a delay to the collapsible menu in Twenty Eleven?

text: The navigation menu closes _immediately_ upon moving the mouse outside of the menu item's area. How can I introduce a delay that will keep it open a second or less to keep visitors from becoming frustrated when trying to navigate to submenu items?


title: Displaying cf post formats with oembed

text: Currently using CF Post Formats ( http://alexking.org/blog/2011/10/25/wordpress-post-formats-admin-ui ) and using the following code to automatically embed a URL that has been input into the 'Audio' or 'Video' custom field:               <?php echo wp_oembed_get( get_post_meta($post->ID, '_format_audio_embed', true) ); ?>      However, if oembed does not support the service (Eg. Spotify) and the user inputs the full embed code, it does not echo out anything. How could I get around this so that if the user inserts code starting with something like:               <iframe...      then it won't use Oembed and instead it will display normally?


title: Login with Username (or Code) only

text: We are building a landing page site (only 2 pages total) for a client where they are physically mailing out access codes to specific customers. Therefore, I am trying to create a login system where ideally, a user logs in with a pre- determined access code. I have been trying different hacks of a login type of but nothing is working to create a single-step, simple process. The "verification" system that this site uses is close to what I'm looking for, but this system first verifies a purchase, then invites you to Register for a WP account. http://support.hogash.com/wp-login.php?action=register I don't want users to have to register anything - I just want have a single entry field with pre-determined access-codes that then allows access to a secondary page. This solution of pre-filling a password may have worked but the lack of pre- filling passwords won't work. We could have had the password field pre- determined and pre-filled (and possibly hidden) then the user enters his/her access code (i.e. username) How to prefill the username/password fields on the login page I have searched hours over a few days for different solutions but nothing. Any ideas on how to solve this? UPDATE 12/26/13: One of the most promising plugins that I've tried, at least on paper, is "Password Only Login" http://wordpress.org/plugins/password-only- login/ Via settings, you select what users you want to be able to login via special form w/ password only. But the shortcode to get the login form to show up on a page doesn't work. I've already reached out to the author, but ain't holding my breath.


title: Post archive for certain post format

text:
I am using the following code for a custom archive of all posts:               $taxonomy = 'category';     $param_type = 'category__in';     $term_args = array(         'orderby' => 'slug',         'order' => 'ASC'     );     $terms = get_terms($taxonomy,$term_args);     if ($terms) {         foreach( $terms as $term ) {             $args = array(                 "$param_type" => array($term->term_id),                 'post_type' => 'post',                 'post_status' => 'publish',                 'posts_per_page' => -1,                 'caller_get_posts'=> 1             );             $my_query = null;             $my_query = new WP_Query($args);             if( $my_query->have_posts() ) {  ?>
<?php echo $term->name;?>
                 <?php                 while ($my_query->have_posts()) : $my_query->the_post(); ?>

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

                 <?php                  endwhile;             }         }     }     wp_reset_query();  // Restore global post data stomped by the_post().      Now this pulls all posts, but is there a way to limit the results to only a certain post format? Same for this:               echo $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts          WHERE post_type = 'post' AND post_status = 'publish'");


title: How do I remove the calendar dashicon from posts in Sparkling theme?

text: The site in question: www.suzannelagrande.com I was able to remove the date/time but the dashicon remains. I found the CSS for it: content: "\f508"; It's identical to the calendar dashicon here:http://melchoyce.github.io/dashicons/ And yet that code is not in the CSS...?


title: Migrating from foo.com/wordpress/ to foo.com/ -- how can I do it?

text: I have a working wordpress installation at mydomain.com/wordpress/index.php (not a real domain). I want to migrate it to mydomain.com/index.php. How can I do that? I tried just unzipping a new copy of wordpress in the main domain space and copying over the config file, but I don't think I got it working, since it's not even giving me an error message--just a blank screen. Furthermore, going to mydomain.com/wp-admin/ seems to automatically redirect me to mydomain/wordpress/wp-admin.


title: Google maps plugin

text: Please recommend a google maps wp plugin that can put a map inside a wp page while other text will be situated near it (right or left hand side).


title: display taxonomy slug from term ID

text: I'm trying to display the taxonomy slug from the term ID, thus my current code is like so:               <?php $catinfo = get_category(array_pop(get_sub_field('sector_selector'))); ?>     <?php print $catinfo->slug; ?>      which isn't printing anything, a `var_dump($catinfo);` produces the following:               array(1) { [0]=> int(59) }      In theory `<?php print $catinfo->slug; ?>` should print the taxonomy slug, but it isn't? Any suggestions would be greatly appreciated!


title: How to modify the "after" of last element in wp_nav_menu

text: When using wp_nav_menu how do I make it so 'after' => does not show on the last element of the list?


title: A way to count logged in users and display count?

text: Is there a possibility to get the count of users currently logged in and display it somewhere?


title: Failed media import

text: I sat up MAMP on my mac and installed wordpress 3.1. Then, I exported my wordpress.com ina tried to import to my local wordpress.... I ticked import media option and I was hoping that I will get all my posta and attachments copied across but I got only posts imported properly... For each and every attachment at wordpress.com I got error saying media import failed!! Am I doing something wrong? Please help I have thousands of PDF/jpg attachments which I want imported...


title: page creator to leave comments ONLY

text: I am trying to set it so that the person who created a Page is the ONLY one who can comment on that particular page. This will be a logged in person. I haven't had any luck with Role Editor Plugins.


title: Can't login through wp-login.php on fresh installation

text: I have currently installed a fresh Wordpress on a dedicated server. It's the latest version with no plugins at all. Everything went successfully as always, I can see the website, but when I try to login through wp-login.php, no matter right or wrong data I'm inputting in the login form I receive "402 Payment Required" error! And a blank page, no reaction at all. I'm checking server logs and there is no any php error either. I want to note that wp-login.php is not corrupt and is working, change password functionality which is part of that page is fully working. Thanks!


title: Wordpress redirects mywebsite.com/author/admin to mywebsite.com/wp-admin

text: I got my self-hosted Wordpress installation, with a nice theme implemented. For writing blog posts I'm using the only user of the website, called "Admin". In my case I only have one author for my blog posts so i decided to disable the "author" page. I'm using the permalink standard "post name" naming structure. I configured the .htaccess file to redirect whoever tries to go to /author to the homepage.               redirect 301 /author    http://www.mywebsite.com      This works pretty well. I also configured it so whoever wants to go to /author/admin will be redirected to the homepage, using this code:               redirect 301 /author/admin    http://www.mywebsite.com      This is not working tough, it always redirects me to mywebsite.com/wp-admin I tried to disable the "canonical-redirect" function of WP, with no success. It's still redirecting to wp-admin login page. Whenever i type mywebsite.com/author/admin i keep going on /wp-admin. The url guessing stopped, but not this. I don't want this to happen, how can i fix that? Sorry for my English, it's not my native language Thanks in advance.


title: Get posts from sites in Multisite?

text:
I'm trying to pull multiple sites posts. For example, I can pull out a single site posts by a category and total posts 10. But I'm trying to pull out both posts from two separate Multisite blogs 1 & 2. But only blog 1 works. Also, I want to pull out another category from blog 1 and blog 2 by another category. How can I achieve this? Here's what I am trying to do:               <?php     global $switched;     switch_to_blog(1,2); //switched to 1 & 2 but only 1 working          // Get latest Post     $latest_posts = get_posts('&cat=64&showposts=10');     $cnt =0;?>
         <?php foreach($latest_posts as $post) : setup_postdata($post);?>
             <a href="<?php echo get_page_link($post->ID); ?>" title="<?php echo $post->post_title; ?>"><?php echo  short_title('...', 7); ?>
                                     <?php endforeach ; ?>          <?php restore_current_blog(); //switched back to main site ?>


title: Array in POST request -> is 404

text: I send array in post request               <form action='<?php echo get_permalink(); ?>' method='POST'>        <input type="hidden" name="question[]" value="<?php echo $question->ID ?>">        <input type="submit" value="Save">     </form>      and then I redirecting to 404 page. In debugger POST parameters are correct. I don't use any reserved names.


title: Convert Custom Table Data Based Plugin To Be Searchable

text: I've got a client with some very specific requirements for a feature on their WP site for a downloads system. After a lot of scouring of the web I've found an old plugin and made a few changes to improve the styling and visual output. The plugin now does 90% of what is needed. However, it stores its data in 2 custom table that are specific to only this plugin. It does not use the posts table or any other WP table. This means that the content derived from the plugin is not searchable via WP's built in functionality, and there doesn't seem to be any logical means to rectify this. As a result, it seems my only option is to try and convert the plugin so that is uses custom posts to store the data related to the downloads. Im fairly new to WP and a bit rusty on my PHP, so I could really do with some help / pointers of how to best go about solving the search issue. Here are the details of the tables.... TABLE: wp_download COL1: id COL2: category_id COL3: name COL4: description COL5: url_file COL6: image COL7: hits COL8: created(datetime) COL9: modified(datetime) * * * TABLE: wp_category COL1: id COL2: name COL3: description COL4: image COL5: created(datetime) COL6: modified(datetime) * * * Essentially, I looking for clarification of how this data would be re- distributed to be better integrated with WP and therefore searchable. For example.. What data, goes where? Do I need to create custom post types etc? Thanks in advance, any help will be greatly appreciated.


title: Is it necessary to escape LIKE term in WP_User_Query?

text: While searching for partial string searches using `WP_User_Query` I came across this answer by @kaiser who has provided some great answers here on Stackexchange. However, I was confused over the use of `esc_attr` to escape the LIKE term (`'search' => '*' . esc_attr( $your_search_string ) . '*'`). I believe `WP_User_Query` makes use of prepared statements where such escaping would be unnecessary and a futile exercise. Am I right? Secondly, if at all, escaping has to be done, wouldn't `like_escape()` suit the purpose better?


title: How to use relative path with my plugins folders?

text: Hi i tried for picking all images in a folder so that what ever images user puts in a specified folder inside my plugin i can take and use it in plugin. I tried the following php functions to pick images or files in folder               glob          scandir      When i try the above in wordpress framework am getting error `The system cannot find the file specified.` when i try in my local server other than wordpress area it is picking files in the specified folder.               <?php     foreach(glob('../images/*.png') as $filename){          echo $filename;      }?>      scan method               <?php      foreach(scandir('../images/') as $filename){          echo $filename;      }?>      The above working fine outside the WordPress Framework Same thing i tried in WordPress for my plugin in my plugin folder and i can't accomplish the task.This is not working. **Attempt 1**               <?php     foreach(glob('../images/*.png') as $filename){          echo $filename;      }?>      i got nothing no error,no warning and no output. **Attempt 2**               <?php          foreach(scandir('../images/') as $filename){              echo $filename;          }?>      I got Warning `Warning: scandir(../images/,../images/): The system cannot find the file specified. (code: 2)`                Warning: scandir(../images/): failed to open dir: No such file or directory      The file am trying this is in different folder but same directory. For example   * Php file with this code is in `inc` folder `inc/settings.php`   * The images am looking is in `images` folder   * Both folder are inside my plugin folder               - myplugin                myplugin.php                /images                /inc                /documentaion      **Now how to get all images names in my images folder?** NOTE: I use to include my other php file in my main file like `include('inc/settings.php');` These thing works fine so most likely there is no problem in path specifying, May be the problem in using `scandir` or `glob` function. I can't able to guess.Can anyone help me? When i simply use the below               foreach(glob('images/*.png') as $filename){              echo $filename;          }          ?>      **Am getting images from`wp-admin/images` folder any idea?**


title: Vanderlee jQuery color picker and WordPress Errors

text: Has anyone gotten the Vanderlee jQuery color picker to work with WordPress? I'm evaluating color pickers with alpha support for my theme and this one just refuses to work. https://github.com/vanderlee/colorpicker Originally I must have been loading the script too early because it was throwing this error: `TypeError: 'undefined' is not a function (evaluating '$('.my- color').colorpicker()')` I loaded the script in the footer and that error disappeared but now I'm getting this error: `TypeError: 'undefined' is not a function (evaluating '$('.ui-colorpicker-ok', part).button()')` The page loads fine by itself but the minute you click in a color field, that error appears and the HTML for the picker is loaded at the very end of the document. This is on a WP 3.7.1 installation so it's jQuery 1.10.2. I saw a similar problem listed in the issues list at https://github.com/vanderlee/colorpicker/pull/60 but that was fixed in the latest version 1.0.5. My scripts are enqueued like this:               wp_enqueue_script( 'vancolor', CHILD_URL.'/lib/js/colorpicker/jquery.colorpicker.js', '', '', TRUE );     wp_enqueue_script( 'my-admin-script', CHILD_URL.'/lib/js/admin.js', array( 'media-upload','thickbox' ), '', TRUE );      And in my admin.js file, I'm initializing the color picker like this:               jQuery(document).ready(function($) {       $('.my-color').colorpicker({         alpha: true,       });     });      My HTML is something like this: `<input type="text" class="my-color" />` This one has stumped me and there's very little documentation in the wild so any help and insight here would be appreciated.


title: How to query for a page, get data, then query for child pages of that page

text: Basically, I want to query PARENT for a bunch of custom field data and echo it out. Then, I want to query all of the CHILD pages of that parent and echo out more data. What's the best way to do it?   1. Top level query for parent then within that query a sublevel a query for the children.   2. 2 seperate top level queries   3. Other? Best to use `wp_query` or `get_posts` or combination of both? UPDATE: Looks like I might have to explain a little better. If the structure of pages looks like this:               Page Parent ID(2)      1. Child 1 ID(3)      2. Child 2 ID(4)      3. Child 3 ID(5)      4. Child 4 ID(6)      And the parent query looks like this:               $parent = new wp_query(post_id=2)     while             //do page parent stuff, eg get the_title(); of the parent page     endwhile      Do I have to run another instance of wp_query to get the child pages, using `post_parent=2`, or can I somehow re-use the original parent query and extend it with extra parameters to cut down on query calls? I'm looking for optimisation of the wp_query here when a child query uses the same parameters as the parent plus a couple more. Thanks.


title: How to order posts by slug using query_posts/ Wp_query

text: I want to display posts sorted by slug on a page. Is it possible to order posts by slug using query_posts or Wp_query?


title: Wordpress Backend Fine, All Themes Return a Blank Page?

text: I have this issue, where I can't access the frontend without a blank page anymore. It drives me crazy. The backend seems to be up just fine, but the frontend is white. When trying to chose another theme (twentyten) this one also returns white, already in the preview. What can I possibly do? Edit 1: This is what I get `Notice: Constant TEMPLATEPATH already defined in /site.com/html/wp- includes/default-constants.php on line 278` `Notice: Constant STYLESHEETPATH already defined in /site.com/html/wp- includes/default-constants.php on line 284` `Warning: Cannot modify header information - headers already sent by (output started at /site.com/html/wp-includes/default-constants.php:278) in /site.com/html/wp-includes/pluggable.php on line 897`


title: Can I set the post_type query_var as a link is clicked?

text: I have 2 custom post types that use some of the same taxonomies. I would like to be able to show all entries in the taxonomy ( no problem here) and then just each of the post types. But I would like to do it without creating a mess of custom pages using a template. Can I set up a function to change the post_type query_var when the link is clicked? SO if I had a set of navigation links in my left sidebar, the set to 'designer' post type would set the post_type query_var to 'designer'. The same would need to happen for the 'boutique' post type navigation links. I think I may need to use some javascript but am unsure. Is this possible? I'm not an expert by an means but I believe this MIGHT be possible, Thanx in advance!


title: How can I create a private site that is inaccessible from the outside?

text: I need a safe place where I can store data about projects that I am working on. This data includes text and files (pictures, sound and video). I want to create a private "blog" for this purpouse that is accessible only by myself. The reason behind this is that I can access the data from anywhere, the solution is platform independent, searching the data should be easy using the Wordpress search bar and metadata can be added to all the uploaded files. My only concern is security - what are my options in securing the contents of the web repository? The problems I am still facing: If someone breaks past .htpasswd (by brute forcing it, **is there a way to block access to the server for a day after several tries at htpasswd?** ) all uploaded files (images, sounds and movies) can be accessed if the attacker can guess the direct url for the file. My vision is to use .htaccess for 80% of the security measures - it is Wordpress independent and should survive software upgrades. But I am really unsure about all the potential holes that I have to plug in Wordpress. **Can you point out other security issues that I have missed and ,ideally, also a solution for them?**


title: Create anchor from Wysiwyg editor

text: Is there any way to create internal anchors without using the HTML rendering option? I don't mind but I guess my customer will ;) Thanks!


title: Custom Post Type uses Custom Tags in add_filter?

text: Having just grasped Custom Post Types I ventured into an article on how to Build a custom image slider using a Custom Post Type wherein I understand everything in the code (i.e. the creation of the CPT and the Meta Boxes). But there is a segment of code which I simply do not get...               add_filter("manage_feature_edit_columns", "feature_edit_columns");         function feature_edit_columns($feature_columns){             $feature_columns = array(                 "cb" => "<input type=\"checkbox\" />",                 "title" => "Title",         );         return $feature_columns;     }      The Codex says that the first argument to add_filter is **$tag** (The name of the filter to hook the $function_to_add to), but the "tag" used in the above code is ... **what?** A _Custom_ Tag? please illuminate... Thanks


title: Rewriting WordPress URLs

text: I've got a plugin which takes input through a GET request via a shortcode. The shortcode is placed on a page with the address /search, and the query used to execute this particular piece of the search is /search/?venueName=. This works fine. However, I need to rewrite it such that when a user goes to /venue/ it loads the aforementioned search. This gist contains my original code (which failed), and Pippin's suggestion as to where I should be (also failed). I've tried everything I can think of, and it always results in either a 404 error, or redirection to the homepage (which makes NO sense). I've also tried every rule I've come up with manually through the Rewrite plugin, and the result is the same. Any help you can provide would be greatly appreciated. Unfortunately, I'm on a deadline on this project so I'm stressing out a little about it. This piece is the last big thing needed before the initial soft launch which is supposed to happen in just under 36 hours.


title: Create Unique ID for user

text:
I have to create a membership site, but I need to give every user that registers a automatic ID number. For example,   * User 2 - has a code - pay-102   * User 3 - has a code - pay-103 I did a forum search and found this, its pretty much what I am asking - What is the fastest way to generate a unique id number when registering a user I've got a piece of code that will add it to the user panel in the admin area:               function fb_add_custom_user_profile_fields( $user ) {     ?>
<?php _e('Extra Profile Informations', 'themename'); ?>

                              <?php _e('memnumber', 'themename'); ?>             	                              <input type="text" name="memnumber" id="memnumber" value="<?php echo esc_attr( get_the_author_meta( 'memnumber', $user->ID ) ); ?>" class="regular-text" />
                 <?php _e('Please enter your Membership number.', 'themename'); ?>

     <?php }     function fb_save_custom_user_profile_fields( $user_id ) {     if ( !current_user_can( 'edit_user', $user_id ) )         return FALSE;     update_usermeta( $user_id, 'memnumber', $_POST['memnumber'] );     }     add_action( 'show_user_profile', 'fb_add_custom_user_profile_fields' );     add_action( 'edit_user_profile', 'fb_add_custom_user_profile_fields' );     add_action( 'personal_options_update', 'fb_save_custom_user_profile_fields' );     add_action( 'edit_user_profile_update', 'fb_save_custom_user_profile_fields' );      How do I populate that field, with an incremental number that is assigned?


title: Rewrite slug of custom post type to include post-id

text: My current permalink setting is `/%postname%/%post_id%/`. Would like to use the same with CPT. Currently the URL looks as site.com/questions/title/ Would like to get post id at the end of the url on every single cpt post, similar to that of post type post... The closest function i found is... (which outputs site.com/questions/postid/)               add_filter('post_type_link', 'change_post_type_link', 1, 3);          function change_post_type_link( $link, $post = 0 ){         if ( $post->post_type == 'questions' ){             return home_url( 'questions/' . $post->ID );         } else {             return $link;         }     }          add_action( 'init', 'change_rewrites_init' );          function change_rewrites_init(){         add_rewrite_rule(             'questions/([0-9]+)?$',             'index.php?post_type=questions&p=$matches[1]',             'top' );     }      TIA


title: My post views doesn't seem to be counted correctly

text: I'm using the following codes to count my posts views, so that I can use it in a widget, but it doesn't seem to be updating correctly. I know some posts have more views than the ones showed on the widget now, cuz Jetpack Stats is also counting the views. I'm using this in my theme's function.php:               <?php     // function to display number of posts.     function getPostViews($postID){         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');             return "0 View";         }         return $count.' Views';     }          // function to count views.     function setPostViews($postID) {         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             $count = 0;             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');         }else{             $count++;             update_post_meta($postID, $count_key, $count);         }     }               // Add it to a column in WP-Admin     add_filter('manage_posts_columns', 'posts_column_views');     add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2);     function posts_column_views($defaults){         $defaults['post_views'] = __('Views');         return $defaults;     }     function posts_custom_column_views($column_name, $id){         if($column_name === 'post_views'){             echo getPostViews(get_the_ID());         }     }     ?>      This in my single.php:               <?php setPostViews(get_the_ID()); ?>      And this in the widget:               global $post;             $args = array(                 'numberposts' => $number,                 'meta_key' => 'post_views_count',                 'orderby' => 'meta_value_num'             );      I have no idea of what's causing this! Thanks


title: Defining a custom 404 for non-WordPress parts of site

text: I have a site with WordPress located in a directory under the root. The root directory contains the main files for the non-WordPress part of the site. Wordpress is included in all of these pages by inclusion of wp-load.php and this is working fine. My question is about how best to handle 404 errors generated in this external part of the site. I'd like to have a single 404 page and ideally to use the WP 404 page for this purpose. Is this possible and does anyone know how it could be accomplished?


title: Wordpress post-type create url rewriting

text: i create a new post-type in wordpress. The new post-type is called work. I want to customize the link when the user click "details button". The link is `work/post_id/postname` I have a trouble to connect the link to a details page. The details page is called `single-work.php` In my `functions.php` I write these rules:               add_action( 'init', 'wpse26388_rewrites_init' );         function wpse26388_rewrites_init(){         add_rewrite_rule( "work/([0-9]+)/([0-9]+)?$", "single-work.php", 'top' );      }      But there is a trouble because when the user click the link, he sees the `index.php` and not `single-work.php`. How can I fix that?


title: In big trouble - Allowed memory size of 268435456 bytes exhausted

text: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 81 bytes) in /home/public_html/hol/wp-includes/meta.php on line 571      I'm receiving this error when I try to log into my wordpress blog as admin. If I login anything else lower than level 3 everything works fine! I tried removing all custom functions.php, error remains. But I don't understand why meta.php? what is there on line 571? What do I do to diagnose the bad code? btw, I removed db and went back with same php files to db of 1 week ago and all works fine. So there must be something in DB? but what?? I have 256mb allocated in php.ini, should be mooore than enough! **EDIT** As advised I tried to test out every plugin and theme for memory usage. First thing I did, is to reinstall wordpress on my test server, turn on custom theme and all plugins... Max I got was 50mb. ![enter image description here](http://i.stack.imgur.com/pu9xz.png) I reimported DB from 1 week ago. And memory usage was double, but still not bad. ![enter image description here](http://i.stack.imgur.com/ywG1q.png) At this point, I reimported current DB and memory error re-emerged. At this point I disabled all plugins and enabled 1 by 1. When I reached sendpress plugin error came back! But sendpress is a simple plugin, all it does is collect emails and create a list of emails. It was not giving errors 1 week ago (have this plugin installed for about 2 month had no issues before) So my question now is, what is happening? why would sendpress cause issues?


title: Get data from plugin People list in author template

text: I use Theme Mystique for my site, and the plugin People list. I have created several new fields for the profiles of authors in the plugin. Now I want to get these fields in the authors template. How do I do that?


title: Difficulty with PHP function that displays a post's format in WordPress

text:
I am working on a WordPress theme using Bones. I would like to be able to show some text just above the title of each post if the post is either featured, password protected or private. So far I came up with the following - this is directly inserted into `index.php`, `single.php`, `archive.php` and `search.php` (not in a function in `functions.php`)               <?php if(is_sticky()): ?>
<?php _e('Featured', 'bonestheme'); ?>
     <?php endif; ?>     <?php if($post->post_password): ?>
 <?php _e('Protected', 'bonestheme'); ?>
     <?php endif; ?>     <?php if($post->post_status == 'private'): ?>
 <?php _e('Private', 'bonestheme'); ?>
     <?php endif; ?>      The code above works fine, however, I would like to improve it and put it a function in `functions.php`. So far I have come up wit the following.               function print_post_format(){          if(is_sticky()):       printf( __( '
%s
', 'bonestheme' ), 'Featured' );          else($post->post_password):       printf( __( '
%s
', 'bonestheme' ), 'Protected' );          else($post->post_status == 'private'):       printf( __( '
%s
', 'bonestheme' ), 'Private' );          endif;     }      When calling this function, 'Featured' shows up, however, 'Protected' and 'Private' do not. Any help would be greatly appreciated. Thank you, Ian


title: Change Default Custom Fields Metabox Name on cctm plugin

text: i found this thread Change Default Custom Fields Metabox Name and i also want to change this cctm plugin generated Custom Field header to something else,so i tried to add ` global $wp_meta_boxes; add_filter('add_meta_boxes', 'change_meta_box_titles'); function change_meta_box_titles() { $wp_meta_boxes['my_post_type']['normal']['core']['cctm_default']['title']= 'Details';} ` to my wordpress functions.php,but it not worked for me,i also tried second code found there,but still not worked for me. Is the wordpress functions.php correct file where to put this code,or is it cctm plugin plugin functions.php correct and on which line i must add code if correct file is cctm plugin functions.php?


title: Wordpress Multisite plugin delegation

text: I'm currently familiarising myself with the Wordpress Multisite feature, but there appears to be an option missing: **If I want to install a specific plugin for one of my sites, but not for any of the other sites, is there a way I can do this without the plugin being displayed as available on the other sites?** As far as I'm aware, I have to add the plugin at Network level and make it available to ALL sites, not just a specific site, which means all of my other sites will have that plugin displayed when you go to the Plugin section. This is not practical in my scenario, as I'm using Wordpress Multisite as way to manage several client websites that have absolutely no link whatsoever. So I could potentially have a recruitment website that requires a powerful recruitment plugin as one of my sites, but that plugin will also display for a ecommerce site I have. Thanks guys


title: Creating a dashboard menu page similar to the "Pages" page

text: I'm looking to create a group of static pages for a "staff" category, and then have a separate menu option for them in the dashboard, similar to the "pages" option that already exists. What I'm wondering is if there's a built in wordpress functions that would speed along this development. If you have a suggestion on where to start looking, that would be great, as my current searches are stymied by countless tutorials of how to add a new page or how to duplicate a page, as opposed to duplicating the "pages" menu. Apologies for the broad, vague nature of this post. I'm new to wordpress, and I'm still absorbing this vast knowledge base.


title: Own plugin corrups plugin-activation

text: I am currently working on a simple plugin. Activating my plugin works fine. However, I can't activate any other plugin as long as mine is active. Also, the edit links won't work. Any help with this would be great! Below is the code for the main plugin file sponsoren.php               <?php       /*      Plugin Name: Sponsoren     Plugin URI:      Version:      Author:      Description:      */            // Enqueue Scripts     add_action( 'admin_enqueue_scripts', 'sponsoren_admin' );     add_action('admin_menu', 'sponsoren_custom_menu_page');     add_action( 'wp_enqueue_scripts', 'sponsoren_frontend' );          function sponsoren_custom_menu_page() {        $page = add_menu_page( 'Sponsoren', 'Sponsoren', 'manage_options',             'sponsoren/sponsoren-admin.php', '', plugins_url( 'sponsoren/images/icon.png' ), 33 );     }          function sponsoren_admin() {         wp_enqueue_style( 'sponsoren-admin-style', plugins_url('/stylesheet.css', __FILE__) );         wp_enqueue_script( 'sponsoren-admin-script', plugins_url('/script.js', __FILE__) );     }          function sponsoren_frontend() {         wp_enqueue_style( 'sponsoren-frontend-style', plugins_url('/sponsoren.css', __FILE__) );         wp_enqueue_script( 'sponsoren-frontend-script', plugins_url('/sponsoren.js', __FILE__), array( 'jquery' ) );     }          // Create database table upon activation     function jal_install() {        global $wpdb;             $table_name = $wpdb->prefix . "sponsoren";             $sql = "CREATE TABLE $table_name (        id int NOT NULL AUTO_INCREMENT,        name tinytext,        bild tinytext,        url tinytext,        PRIMARY KEY id (id)         );";          }          register_activation_hook( __FILE__, 'jal_install' );          // Ajax action used in sponsoren-admin.php     add_action('wp_ajax_sponsor_delete', 'sponsor_del');     function sponsor_del() {         global $wpdb;         $wpdb->delete( $wpdb->prefix.'sponsoren', array( 'id' => $_POST['deleteid'] ) );         die();     }          // Widget     function widget_sponsoren_frontend($args=array(), $params=array()) {              $title = get_option('widget_sponsoren_title');              echo $before_widget;         echo $before_title . $title . $after_title;         // some more widget output              echo $after_widget;      }          wp_register_sidebar_widget('widget_sponsoren','Unsere Sponsoren', 'widget_sponsoren_frontend');          // Widget Options     wp_register_widget_control(         'widget_sponsoren',     // id         'widget_sponsoren',     // name         'widget_sponsoren_control'  // callback function     );          function widget_sponsoren_control($args=array(), $params=array()) {              if (isset($_POST['submitted'])) {             update_option('widget_sponsoren_title', $_POST['widgettitle']);         }              $widgettitle = get_option('widget_sponsoren_title');         ?>              Widget Title:<br />         <input type="text" class="widefat" name="widgettitle" value="<?php echo stripslashes($widgettitle); ?>" />              <input type="hidden" name="submitted" value="0" />         <?php     }


title: Is there a drush equivalent for WordPress yet?

text: I'm working with Drupal on a project right now, and for all it's faults, having a commandline interface like drush to the Drupal framework is a godsend. Is there an equivalent for using Wordpress to let you control which plugins a site is deployed with, or what ddefault settings should be? Or is the current best approach just to drop this stuff into wp-config or somewhere similar?


title: Plugin Paths Issue

text: I am using a plugin which has several instances where it is using a hardcoded path rather than using the WP function to find a path. The problem here is that it's referring to wp-content but I've changed the WP_CONTENT_FOLDERNAME setting in the wp-config file (there was a past requirement to do that). Anyways, is there a way to achieve this without updating the plugin codebase itself (i.e. allow it to be upgradable in the future). I guess this goes with the whole idea of extending a plugin without having to edit the codebase.


title: Can I use a space in an option name/key?

text: Is there any reason at all that I can't use a space in a WP option name/key? Ex. `update_option( 'my option name', 'abc' );` I can't find anything that states I can't, but every example uses an underscore instead. I want to know if using a space will actually break anything now or in the future.


title: Translate widget titles using qTranslate plugin

text: I'm actually using the qTranslate plugin to translate my website. It works really well with everything except one thing. the titles of my sidebar widgets. Actually, to translate some words we need to put tags like this:               <!--:en-->My English Title<!--:--><!--:fr-->My French Title<!--:-->      When I use this in the content of my widget it works well. But in the title when I save the widget. It actually remove my tags and just displays:               My English TitleMy French Title      Anyone know how to fix this?


title: wp_editor doesn't work in front end area

text: I am developing a theme where I would like to have a front-end area, but when I try to include the `wp_editor()` in the page template I am getting this result: ![wp_editor\(\) problem](http://i.stack.imgur.com/xW4PO.png) P.S. The wordpress editor works fine in the dashboard. ![wp editor in the dashboard works fine](http://i.stack.imgur.com/Fzv14.png) Pietro


title: Breadcrumbs with Custom Post Types?

text: I've tried both Yoast Breadcrumbs and Breadcrumbs NavXT and I can't seem to get either to work with custom post types. Anyone had any luck with this? A single 'News' post on my site displays: Home -> Blog -> My News Post Instead of correctly displaying: Home -> News -> My News Post


title: Override database config for WordPress multiblog

text: Our team has run in to a problem working with wordpress 3 multiblog. We usually work with a local copy of the site (localhost/testsite) but with the same database to keep all changes up to date. This works fine in a single install because you can override the database configs from php with:               define('URL',$path);       define('WP_HOME',$path);       define('WP_SITEURL',$path);       define( 'WP_CONTENT_URL', $path.'/wp-content');        But this doesn't work on the multisite because of the extra tables (`wp_blogs`, `wp_site`) and they have the path to the blog in their settings. Does anyone know how to override these settings? I would like the site to run on domain **localhost** for our developers, **developerdomain.com** for our test servers and then **realdomain.com** when the site goes live. It feels kind of overkill if we have to setup different databases for each of them and change the domain and path manually and then copy the post, blog and userdata between the databases to do debugging and continue the development..


title: functions.php / replacing div's with new ones?

text:
I'm not sure the best way to tackle this one: I have a menu I saw and like and want to use it as a basis for my own. I have the CSS for it. On the page it comes from its all labeled differently to my own menu on my own wordpress custom theme. Should I be using functions.php to call the new CSS divs in place of my own or would there be a better way to do this? I am not super good with coding but im willing to give anything a go =) The Div classes and ID's I want to use in place of my own:

      This is the existing code in headerstyle3.php that I want to replace:

      im pretty sure the navigation element for both is "pageHeader" for the new and "container" for the old one. Any help much appreciated! =)


title: User Without Email?

text: When creating a user in Wordpress an email address is required for that user. The website I'm working on requires that users remain anonymous (it's part of a research study) and I'd consider email to be an identifying piece of data. Users will be added manually, so email is not required to confirm accounts or prevent spam sign-ups. Am I going to have to provide a fake email address for each account, or is there a way to leave this field blank?


title: Limit taxonomy results to a single cpt

text: I have two cpt's, events and reports, they both share the taxonomy locations, I have my taxonomy-locations.php, but that is showing reports & events for location, I just want to show reports for location. Can someone help me out with how this query should go? Thanks


title: Wordpress posts for multiple years

text: Trying to get posts from a **specific category** for **specific years**. Nothing is working, including this:               <?php $args=array(     'cat' => '11', //Category I'm targeting     'year' => 2008,2009,2010 //Years I want     );     $my_query = new WP_Query($args);     if( $my_query->have_posts() ) {     while ($my_query->have_posts()) : $my_query->the_post(); ?>      That code will only display posts for 2008.


title: Separator for custom nav menu

text: I creating a custom footer navigation in wordpress. I looked all over the wordpress documentation and still haven't found anything. So, what I'm trying to do is add an "|" in the navigation like this: > Home | Link 1 | Link 2 | Link 3 | Contact I know there's a way in CSS, but I know this is generated by wordpress so I'm a little stumped on how to do this.


title: Custom Menu in Themes not working even in Twenty Eleven theme

text: I am currently having problems with a Wordpress installation. The remote site I was supposed to theme uses WP 3.2 so I used 3.2 I created a theme that supports custom menus and it works fine on my localhost. But when I uploaded it to the remote test site, I notice that I can't add any custom menu. I see that the "Theme Locations" thing on the left side isn't there. So I tried to revert to the TwentyEleven theme and I still get the same situation. Disabling all plugins doesn't work either. I notice that I have file permissions error since I get a 403 error in the Ajax request when I try to upload any file using the file uploader. Could that be one of the cause why my custom menu is acting weird?


title: query_posts call sets is_home() to true

text: I have a custom home page (`home.php`). I want to show the original home page's posts on `/blog/`. I created a new blog.php file, with Template Name: Blog, added               query_posts('numberposts=5&paged=' . get_query_var('paged'));     require dirname(__FILE__) . '/index.php';      to the file. The problem is that this `query_posts` call sets `is_home()` to true. I have some code in `header.php` that needs to be run only on the home page, but it runs on this template's pages too. What's the best way to do this?


title: Custom Rewrite Rules Not Sticking

text: I've written some custom rewrite rules for a special feature on http://www.pewhispanic.org/states/. States is a page with a custom page template, page-states.php. The logic for returning the right data based on the request is done there. I created custom rewrite rules so I could have a pretty urls with custom parameters that get sent to page-states.php. The following code is in my themes functions.php file:               //Rewrites for the States and Counties Database     function filter_statedb_rewrite_rules( $wp_rewrite ) { //Lets us have URLs like /states/state/md/ etc.         $statedb_rewrite_rules = array(             "states/counties/([a-zA-z]{2})/?$" => "index.php?pagename=states&counties=" . $wp_rewrite->preg_index(1),             "states/county/(\d+)/?$" => "index.php?pagename=states&countyid=" . $wp_rewrite->preg_index(1),             "states/state/([a-zA-z]{2})/?$" => "index.php?pagename=states&stateid=" . $wp_rewrite->preg_index(1)         );         $wp_rewrite->rules = $statedb_rewrite_rules + $wp_rewrite->rules;     }     add_action('generate_rewrite_rules', 'filter_statedb_rewrite_rules');               function kill_statesdb_canonical_redirect($redirect_url, $requested_url) {         global $wp;              $statedb_rewrite_rules = array(             "states/counties/([a-zA-z]{2})/?$",             "states/county/(\d+)/?$",             "states/state/([a-zA-z]{2})/?$"         );              if( in_array($wp->matched_rule, $statedb_rewrite_rules) ) {              return false;         } else {             return $redirect_url;         }     }     add_filter('redirect_canonical', 'kill_statesdb_canonical_redirect', 10, 2);               function add_statedb_query_vars($query_vars) {         $query_vars[] = 'counties';         $query_vars[] = 'countyid';         $query_vars[] = 'stateid';              return $query_vars;     }     add_filter( 'query_vars', 'add_statedb_query_vars' );      For some reason the rewrite rules fail to stick **sometimes** (I hate when things only work sometimes). I visit Settings -> Permalinks to flush the rewrite rules and everything is working great. A couple days go by and then I get an email saying pages like http://www.pewhispanic.org/states/state/md/ are returning a 404. Crap. I go and flush the rewrite rules and everything is fine again. What am I missing here? Why are my custom rewrite rules sometimes not being applied? Is there a better action than `generate_rewrite_rules` to hook on to? Do I even need to mess with the `redirect_canonical` filter? I don't think it's doing anything. Any insight would be most appreciated.


title: Custom columns for taxonomy list table

text: I have the following code to add a new column to my taxonomy edit screen (edit-tags.php?taxonomy=book_place&post_type=books)               function add_book_place_columns($columns){         $columns['foo'] = 'Foo';         return $columns;     }     add_filter('manage_edit-book_place_columns', 'add_book_place_columns');          function add_book_place_column_content($content){         content = 'test';         return $content;     }     add_filter('manage_book_place_custom_column', 'add_book_place_column_content');      Its working, but i need to access the current term id in the "add_book_place_column_content" function. How can i do that?


title: Can Permalink structure of %postname%/%post_id% improve performance

text: Since the post_id is unique and no full text search is needed. So is the structure **%postname%/%post_id%** really improve performance?


title: Can I create drag and drop widgets like iGoogle in WordPress?

text: I want to make something like iGoogle in WordPress, in which I can drag and drop the widgets. How could that be done in HTML 5?


title: How to use wp query posts with current post meta value in text widget

text:
I would like to query information in my sidebar text widget. I added the function. The php query working. (see the code below) I have single posts with wine tastings. I would like to show in right sidebar which cellar producted it. I added the same custom field key `cellar_slug` and value `somloi-apatsagi-cellar` each post. Code below can show the cellar. But how can I using on all posts? Every post have different meta value. Is there any solution using current post meta value instead of a fix value?                   <?php           $cellars = new WP_Query(array(          'post_type' => 'post',           'numberposts' => -1,          'posts_per_page' => '1',      'meta_query' => array(               array(                'key' => 'cellar_slug',                'value' => 'somloi-apatsagi-cellar',               )),          'orderby' => 'menu_order',           'order' => 'ASC'     ));               if ($cellars->have_posts()) : ?>          <u1>          <?php           while ($cellars->have_posts()) :           $cellars->the_post(); ?>

<a href="<?php the_permalink(); ?>">                    <?php the_title(); ?>
<?php the_post_thumbnail('widget-text-post-thumbnail'); ?><?php the_excerpt(); ?>
            <?php endwhile; ?>     </u1>     <?php endif; ?>


title: Problem in logging in as admin

text: When I am trying to login as admin to my site I am redirecting to another unknown page. The login page is pointed to a page-Id2 .I don't understand why it is happened and how to solve it. The links to admin page are redirecting to that page Id-12 . Could any one help me to resolve the issue


title: Is there a (preferable built-in) way to check what custom queries are used in a theme?

text: I've build a theme using custom post-types with queries like               $my_custom_post_type_query = new WP_Query( array( 'my_arg' => 'value' ));      Now I'm writing a plugin where I need to do something like               $wp_query->get_queried_object_id();      but for `$my_custom_post_type_query` instead of `$wp_query`. **How can I** (from my plugin file)   1. check if there _are_ any custom queries, and if so    2. call a specific custom query within my plugin? Any ideas much appreciated!


title: Twenty Ten child theme has post on an inner page. Cant get that page to use my desired template

text:
I have a child theme based on Twenty Ten. I have split out the sidebar and secondary side bar so they can be used on different pages. sidebar.php file:

              <?php         /* When we call the dynamic_sidebar() function, it'll spit out          * the widgets for that widget area. If it instead returns false,          * then the sidebar simply doesn't exist, so we'll hard-code in          * some default sidebar stuff just in case.          */         if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
                 <?php get_search_form(); ?>

<?php _e( 'Archives', 'twentyten' ); ?>

                     <?php wp_get_archives( 'type=monthly' ); ?>

<?php _e( 'Meta', 'twentyten' ); ?>

                     <?php wp_register(); ?>
<?php wp_loginout(); ?>
                     <?php wp_meta(); ?>

              <?php endif; // end primary widget area ?>

      sidebar-2.php                   <?php         // A second sidebar for widgets, just because.         if ( ! dynamic_sidebar( 'secondary-widget-area' ) ) : ?>

                     <?php dynamic_sidebar( 'secondary-widget-area' ); ?>

     <?php endif; ?>      I want to display sidebar-2 (the secondary sidebar) in my post pages. I call them using:               <?php get_template_part(‘sidebar’,2); ?>      (in the following files: archive.php, post.php, author.php, category.php) instead of `<?php get_sidebar(); ?>` I've set my 'Settings' for 'Reading' so that the page is for displaying 'Posts'. When I visit the page, it displays the primary sidebar. You can see for yourself at http://akhomehealth.com/newsletter/ Sidebar should show search, archive, category and recent posts.


title: prevent users from changing their email address

text: does anybody know how to hook or filter the user-edit.php file so that an user's email address is disabled from editing akin to how the username is disabled ..??.. i can edit the core file (gasp) and include disabled="disabled" in the form and this works but i'm at a loss as to how to add the disable via hook or filter .. i can also run a function like this that hides the email address via css               /* Change WordPress dashboard CSS */     function custom_admin_styles() {     echo '';     }     add_action('admin_head', 'custom_admin_styles');      but that pulls out the whole email thus form looks funny and then i believe that with a DOM Editor like Firebug, one can still access that email field thus change it ... ugh ... ideally, i would like to replace this entire user-edit.php code from this ->               <?php _e('E-mail'); ?> <?php _e('(required)'); ?>	<input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" disabled="disabled" class="regular-text" /> <?php _e('Emails cannot be changed.'); ?>      to something like this ->               <?php _e('E-mail'); ?> 	<?php echo esc_attr($profileuser->user_email) ?>" Please Contact Tech support to change your email      thanks in advance for any pointers you can share ... cordially, chuck scott


title: How can I have multiple URLs pointing to single WordPress installation?

text: Here's my scenario: I have three specific jobs sites: LAMPJobsLA.com, MobileJobsLA.com, SocialMediaJobsLA.com I'd like to run them under on "master site": TechJobsLA.com but keep the URLs intact when a visitor lands on the page with the posts matching the categories or tags (taxonomy). For example, if someone visits MobileJobsLA.com, the two URLs that would both work are: http://techjobsla.com/tag/mobile-ios-android/ or http://mobilejosbsla.com/ default page redirects to ---> http://mobilejosbsla.com/tag/mobile-ios-android Hope that makes sense. I see from some of the previous questions/answers, WordPress MU Domain Mapping plugin might work for me.


title: update_post_meta not working?

text: The value is not updated when using the following code:               add_action( 'save_post', 'updatethumb' );          function updatethumb( $post_id ) {              //verify post is not a revision         if ( !wp_is_post_revision( $post_id ) ) {                  //$thumb = get_post_meta(get_the_ID(), 'thumb', false);             $ft=get_post_meta(get_the_ID(), 'thumb', true);             //echo '<script>alert("'.$ft.'")</script>';             update_post_meta(get_the_ID(), 'thumb', 'testxxx');               }          }      Why is that?


title: Looking for a Table of Contents (TOC) plugin for WordPress

text: I am looking for a simple TOC plugin for WordPress that would create a ToC similar to the one from MediaWiki (Wikipedia). Usually I need this only for big pages and the TOC needs to be generated based on heading from the post. Considering that the number of pages need TOC is quite small, it should be ok to enable this plugin only for some of them. I found several solutions, but none of them seamed ok. The closest one was Hackadelic SEO Table Of Contents, but this one had two big issues: contained a AD link and no way to enable it only for specific pages.


title: Widget with random posts from a blog for external sites

text: How can I create a customizable widget with random posts from my blog that can be published on another site as js, iframe or div. Is there any Wordpress plugin for that?


title: wp-content/uploads returns a 404

text: I was doing some speed tests on my site recently and I noticed that my wp- content/uploads folder takes a long time to connect and then gives a 404 error. Does anyone know what might be causing this?


title: Show Multiple Size URL of one Featured Image/Thumbnail?

text:
Is it possible to print two different url's from the same featured image/thumbnail? So i have set up my image size..               add_image_size( 'full-size', 460, 9999 );      add_image_size('fixed-height', NULL, 75, false);      I need to pull the url of these two images sizes into the post like so..

      Obviously i could not use the normal way..
<img src="<?php the_post_thumbnail('full-size'); ?>" ref="<?php the_post_thumbnail('fixed-height'); ?>" >
      Is it possible to do what i'm after, or no go? Thanks for anyone that can help :)


title: How not to display ALL items of a database

text:
When I select a category from the head navigation bar in a database http://www.taracomplementos.com/tara/, the default display is all the items of the DB, and you must select one of the categories inside of the page to see related articles. I wish I knew how to have displayed ONLY the items belonging to a specific category. I think that the trick must be in these lines, but I can't figure out how to modify it:

<?php _e('todo', 'ux') ?>
                 <?php wp_list_categories(array('title_li' => '', 'exclude' => $excludecat,'taxonomy' => 'skill-type', 'walker' => new Walker_Category_Filter())); ?>

         <?php endwhile; else : endif; ?>

         <?php $args = array(            'post_type' => 'portfolio',            'orderby'=>'menu_order',            'order'     => 'ASC',            'posts_per_page' => '-1',            'skill-type' => get_query_var('skill-type'),            'tax_query' => array(            array(                    'taxonomy' => 'skill-type',                    'field' => 'id',                    'terms' => $excludecat,                    'operator' => 'NOT IN',                    )                ) // end of tax_query            );         ?>         <?php $query = new WP_Query($args); ?>      Can anybody help me? TIA, guido


title: How do i show wordpress attachments from current post?

text:
So with my blog i have a photo attachment page but it only shows to photo's at a time, and those two photo's are used as the navigation and i hate that. I want the attachment page to show all the photo's that goes along with the rest of that set. Here is the current code

<?php next_image_link() ?>

<?php previous_image_link() ?>
      How do i change that to show all the post attachments?


title: email sends from wordpress@domain.com even though I have it set to something else

text: My wordpress settings email is contact@domain.com. When I search my entire database for the email of wordpress@domain.com, it does not exist. Yet my registration emails are still sent from wordpress@domain.com for some reason. The only thing I can think of is that when I look in my wp_users table, I have no user with the ID of 1. I believe this is the default admin ID. I'm not sure who did it or when, but I think the default admin was deleted a long time ago and I just made my username admin. Perhaps if wordpress doesn't find an admin email, it automatically goes to wordpress@? I'm confused with this one.


title: Code for Recent Posts Widget

text: I want to make changes to code of the Recent Posts widget – could anyone please tell me where that code is located? Thank you in advance!


title: can I run the test suite without a web server?

text: I'm trying to set up a Test Driven Development environment and I was wondering if it's possible to run the WordPress test suite without a web server. I'm on a mac (10.7.5) and I've set up phpunit and the mysql server.


title: Creating an events calendar where users can enter events via a custom post type

text: I'm building a plugin that enables users to add events via a custom post type. The custom post type with have a meta box with two fields: one for the event date and one for the event time. I know how to create the custom post type and the meta fields, but I don't know how to take this stored info from the database and put it into a calendar. My Question: should I use HTML, such as the `table` html tag to create the layout of the calendar? How would you do this part? I'm new to WordPress development & PHP, so would appreciate a bit of guidance.


title: jQuery Image Annotation

text: I'm bascially looking for something that lets visitors to my page comment on photos. When they hover over the photo the image notes will load. Best would be if those notes would also show up in the comment-list with a thumbnail of the commented photo next to the comment. I know it's possible. I've seen it here. I only could find 2 plugins (which are pretty much the same anyways) in the Wordpress Plugin Dabatase. However, after months of trying and even asking here for advice, I have to give up as these plugins just don't work for me. There seem to be other options out there. When I googled, I found that there is a jquery-image-annotation thingie, though I couldn't find any further information about it. As I don't know too much about javascript, I wouldn't be able to write something like that myself anyways. This seems to be something similar at least. This person is obviously using Wordpress, so I was wondering if that is a plugin as well. I looked at the scripts that he's using but couldn't figure out what exactly he's using for the image notes. So, basically I was wondering if it's possible at all to create an image annotation for my users in Wordpress and if there are any other plugins you know of that do something similar? Thanks a lot in advance.


title: Metabox with multiple fields added by user and upload box

text: I'm trying to build system, where user can add as many fields as he needs to the post. I'm using code from this thread. Everythings works fine, except I can't get my upload working. Here's code I've added inside foreach loop in `dynamic_inner_custom_box()` function:               <input class="upload_file" type="text" size="45" id="items[%1$s][picture]" name="items[%1$s][picture]" value="%6$s" />     <input class="upload_button button" type="button" value="Upload File" />     <input class="upload_file_id" type="hidden" id="items[%1$s][picture]_id" name="items[%1$s][picture]_id" value="%6$s" />      The `%6$s` value is `item['picture']` ofc. I don't understand how this works. There are two fields for upload - `.upload_file` and `.upload_file_id`. If I'm correct, I need to add `_id` to my `.upload_file`'s name, and save it as `.upload_file_id`'s name. The problem is, when I choose some image from the upload thickbox, it doesn't put the link in my input field. I've been playing for a while now, and I've been able to get this link in place by playing with names/id's but than I couldn't save the data. What's incorrect in my code? Do I need to extend somehow save function? @edit After changing code to this:               <input class="upload_file" type="text" size="45" id="picture_%1$s" name="picture_%1$s" value="%6$s" />     <input class="upload_button button" type="button" value="Upload File" />     <input class="upload_file_id" type="hidden" id="picture_%1$s_id" name="items[%1$s][picture]" value="%6$s" />      I am finally saving something and I'm able to get attachment link in right place for a moment. When I coose a picture, a link is inserted where it should be, but after saving only some numbers are stored in databse ( attachment ID maybe? ).


title: Cannot enqueue jQuery correctly using Google CDN

text: # The problem: I understand how to regularly enqueue jQuery UI in functions.php. My problem is that I'm using a selectmenu widget that doesn't come with WordPress by default: http://wiki.jqueryui.com/w/page/12138056/Selectmenu ...and it only works if I enqueue jQuery using:                   wp_enqueue_script(         'uicore',         'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js',          array('jquery')      );      This works without conflict with datepickers but as soon as I call a jQuery UI button, all the jQuery elements on my page breaks. # Live examples: A test example of button, selectmenu and datepicker working together: http://www.dominornovus.com/jquery-test-environment/ The actual example where the call to button breaks all jQuery elements: http://www.dominornovus.com/killyliss-country-house/test/ # The code:                   //wp_enqueue_script('jquery-ui-datepicker');         //wp_enqueue_script('jquery-ui-button');         //wp_enqueue_style( 'uicss', 'http://dominornovus.com/wp-content/themes/killylisscountryhouse/jquery/custom-theme/custom-killyliss.css' );         //wp_enqueue_script( 'uisel', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.js' );         //wp_enqueue_style( 'uicss2', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.css' );          add_action('wp_enqueue_scripts','enq_menu_scripts_and_styles');          function enq_menu_scripts_and_styles() {         // UI Core, loads jQuery as a dependancy              wp_enqueue_script(             'uicore',             'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js',              array('jquery')          );              // jQuery         //wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"' );              // jQuery UI         //wp_enqueue_script( 'jqueryui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js' );              // UI Theme CSS         //wp_enqueue_style( 'uicss', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css' );         wp_enqueue_style( 'uicss', 'http://dominornovus.com/wp-content/themes/killylisscountryhouse/jquery/custom-theme/custom-killyliss.css' );              // Datepicker JS         //wp_enqueue_script('jquery-ui-datepicker');         //wp_enqueue_script( 'uidate', 'http://jquery-ui.googlecode.com/svn/branches/1.7.3/ui/ui.datepicker.js' );              // Button JS         //wp_enqueue_script('jquery-ui-button');         //wp_enqueue_script( 'uibutton', 'http://jquery-ui.googlecode.com/svn/branches/1.7.3/ui/ui.button.js' );              // Selectmenu JS         wp_enqueue_script( 'uisel', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.js' );              // Selectmenu CSS         wp_enqueue_style( 'uicss2', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.css' );          }      Any help would be greatly appreciated.


title: How to stop filter from running on the index.php page?

text:
I'm trying to make a Wordpress function and currently I have this in my functions.php file:                function find_my_image($content) {          if(is_single()) {              if (preg_match('#()#', $content, $result)){                  $content .= '
Image has been found
';              }         else{                  $content .= '
Sorry, no image here!
';              }          return $content;           }      }          add_filter('the_content', 'find_my_image');      The function works perfectly on a single post page, but my index.php is now blank (only the titles of the posts are displayed, but no post content). I tried removing:               add_filter('the_content', 'find_my_image');      from function.php, but that's stops the function from executing on my single.php. Also I tried using this (I don't know if it's correct):                if(is_single()) {               add_filter('the_content', 'find_my_image');          }      But that's just cancels the function on single.php. My guess is that add_filter('the_content', 'find_my_image'); is the problem here, but I can't figure it out, so can anyone help me out a bit?


title: How to correctly limit the content and strip HTML?

text: I have been using this code for a long time :               $temp_arr_content = explode(         " ",         substr(             strip_tags(                 get_the_content()             ),             0,             720         )     );     $temp_arr_content[count( $temp_arr_content ) - 1] = "";     $display_arr_content = implode( " ", $temp_arr_content );     echo $display_arr_content;     if( strlen( strip_tags( get_the_content() ) ) > 0 )         echo "...";      To limit my content to 720 characters and strip html from it   However, today I used it again in my new theme but I noticed that it also outputs the HTML codes (the HTML code is not working, but shows up in the content) .   I have also used this code in my theme :               $excerpt = get_the_excerpt();     echo string_limit_words( $excerpt, 55 );      and this code on my Function.php :               function string_limit_words( $string, $word_limit ) {         $words = explode( ' ', $string, ( $word_limit + 1 ) );         if( count( $words ) > $word_limit )             array_pop( $words );         return implode( ' ', $words );     }      to limit words and strip HTML , however, when I change 55 to 150 the code does not work and it still shows 55 words.   can someone please help me resolve this issue ? thanks


title: Google calendar in wordpress showing events

text: How can I have the google calendar in wordpress showing my events?


title: How to remove duplicate link from add_menu_page

text: In the theme admin menu below, the "MyTheme Menu Label" is being duplicated twice on the sidebar menu, once for the main menu link and again for the first submenu link. How can I remove the 2nd instance of the link               add_menu_page(         "MyTheme",          "MyTheme Menu Label", //THIS IS REPEATED TWICE IN THE MENU         "edit_themes",          "functions.php",          'theme_admin',          get_bloginfo('template_directory') .'/img/favicon.png',31     );          add_submenu_page(         'functions.php',          "SEO Options",         "SEO",         'edit_themes',          'my-seo-options',          'theme_admin'     );          add_submenu_page(         'functions.php',          "Misc Options",         "Misc",         'edit_themes',          'my-misc-options',          'theme_admin'     );           //etc...


title: how to set context in Wordpress for unit testing

text: I have created a wordpress plugin which converts shortcodes to content based on the entry saved on the dataase:                   global $wpdb;              $post_id = get_the_ID();         $post_content = get_the_content();              $pattern = '/\[zam_tweets page=([0-9])\]/';         preg_match($pattern, $post_content, $matches);              if(!empty($matches)){                  $tweets_table = $wpdb->prefix . 'zam_tweets';             $result = $wpdb->get_var("SELECT tweet FROM $tweets_table WHERE post_id = '$post_id'");             $content = $result;         }              return $content;      My problem is how do I set the context to be that of a specific post so that I will get an actual post id when using the `get_the_ID()` method. Is this how I'm supposed to go with this or do I just have to specify them as arguments?


title: How to display php source code inside a post using visual editor?

text: **NOTE** I don't want the php code to be executed, only displayed. I want to display this php code `<?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?>` inside a post. I cannot make it work. If I go to text type of editor and type `<pre class="lang:php nums:false"> <?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?> </pre>` there and save. I can see what I want to. But when I switch to visual editor the php text is not there. There is box for it but the text is not there. If I save the post now html comments are added to the source code and it looks like `<pre class="lang:php nums:false"> <!--?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?--></pre>`. So when I then refresh the post page I got `!--` characters there, something that shouldn't be there. Any idea how to display php code with syntax highlight?


title: update_post_meta not saving when value is zero

text: I have a problem with the `update_post_meta` function.   I have a user submitted value, which I pass via `$_POST` and then saving to post meta. All is working fine, but when the value is `'0'` the post meta is not updated. My code:               $id = absint($_POST['ex_id']);     $key = (string) $_POST['id'];     $value = (string) $_POST['value'];          echo update_post_meta($id, 'wpptabs_' . $key, $value);      Does anyone have any idea what might be wrong?


title: Best practice way to delete user meta data during plugin uninstall?

text: If a plugin stores data in the usermeta tables what is the best practice method to delete these entries for all users in uninstall.php? I could access the database directly but is there another way?


title: WP_query parameters for date range

text: I'm using the events manager plugin to create custom posts for events. I do not have a need for a blog, so I modified my theme's `index.php` file (using a child theme) for its query to retrieve the "event" post type on the home page. `new WP_Query ( array( 'paged' => $paged, 'post_type' => 'event', 'posts_per_page' => 4 )` (I have only included the 'event' post type). So far, so good. But it displays current, past and future events on the home page. I want it to only display current and future events (that is, **I want events that haven't started yet to be shown on the home page too. I only want to prevent past events from being shown** ). I have taken a look at the codex page for WP_Query and used the following code excerpt:               // Create a new filtering function that will add our where clause to the query     function filter_where( $where = '' ) {         // posts for March 1 to March 15, 2010         $where .= " AND post_date <  CURDATE() ";         return $where;     }          add_filter( 'posts_where', 'filter_where' );     $query = new WP_Query( $query_string );     remove_filter( 'posts_where', 'filter_where' )      It doesn't produce the desired result because the event date isn't stored on `post_date` on the DB. However I suppose there's some easy way to reference the events' dates, because the date automatically displayed on the home page isn't the posts publication date, _but rather the event start date, without any modification being made_.


title: Problem in creating table through plugin code

text: I'm using the following code to create the database table using plugin. However, the table is neither getting created nor I'm getting any error message. The code is as follows:                   global $wpdb;         $table_name = "tbllb_club";              $sql = "create table $table_name (         club_id int(11) NOT NULL auto_increment,         project_name varchar(500) NOT NULL,         first_name varchar(100) NOT NULL,         school_status varchar(50) NOT NULL,         school_name varchar(200) NOT NULL,         school_city varchar(50) NOT NULL,         school_state varchar(50) NOT NULL,         year_in_school varchar(50) NOT NULL,         age int(2) NOT NULL,         email varchar(200) NOT NULL,         mobile varchar(15) NOT NULL,         chat_id  varchar(50) NOT NULL,         facebook_page_link varchar(200) NOT NULL,         mailing_address_street varchar(50) NOT NULL,         mailing_address_city varchar(50) NOT NULL,         mailing_address_state varchar(50) NOT NULL,         mailing_address_zip char(6) NOT NULL,         social_networking varchar(50) NOT NULL,         organization_involvement varchar(2000) NOT NULL,         yesclub_heard varchar(50) NOT NULL,         volunteer_experience varchar(2000) NOT NULL,         volunteer_reason varchar(2000) NOT NULL,         skills varchar(2000) NOT NULL,         creative_ideas varchar(5000) NOT NULL,         other_information varchar(2000) NOT NULL,         face_photo_url varchar(200),         school_image_url varchar(200),         video_clip_url varchar(200),         PRIMARY KEY  (club_id)         );";              require_once(ABSPATH . 'wp-admin/includes/upgrade.php');         dbDelta($sql);      I have followed the rules as mentioned the Wordpress Codex. Please help!! Thanks in advance.


title: Display Images from Array with wp_get_attachment_image()

text: I'd like the client to be able to type any image ID (number) from any gallery / attachment and then displaying it with wp_get_attachment_image(). Here is my code:               if ( $images ) {         foreach ( $images as $image ) {            echo '<li>';            echo wp_get_attachment_image( $images, 'thumbnail' ); // notice this part            echo '</li>';           }      When I do print_r $images, I get this array: Array ( [0] => 318 [1] => 304 [2] => 301 [3] => 299 [4] => 297 ) and it works if I hardcoding the array, like               echo wp_get_attachment_image( 304, 'thumbnail' );,       but of course I'd like it to appear dynamically. How to do that? Thanks in advance.


title: Set start page depending on screen width

text: I'm building a responsive theme and would like to have different start pages depending on screen width. In this case, the start page is set in WP admin and contains an image map built on a cunstom page template. On mobilde devices this image map doesn't work so well, so I'd like set one of the other pages as start page. I guess I can merge front-template with standard-template and somehow achieve this with media queries, but would prefer a javascrip/jQuery solution. Thanks


title: Trying to add taxonomy to get_categories() but it's not working. How to fix this?

text: I have this template I purchased and I'm trying to customize. I added a new taxonomy category called location and I'm trying to replace the default categories being loaded in the theme with my new taxonomy categories. here's the current code and where it loads the categories:                $cats_array = get_categories('hide_empty=0');      $pages_array = get_pages('hide_empty=0');      $site_pages = array();      $site_cats = array();           foreach ($pages_array as $pagg) {     $site_pages[$pagg->ID] = htmlspecialchars($pagg->post_title);     $pages_ids[] = $pagg->ID;      }           foreach ($cats_array as $categs) {     $site_cats[$categs->cat_ID] = $categs->cat_name;     $cats_ids[] = $categs->cat_ID;      }                   array( "name" => "Featured Category",                "id" => $shortname."_feat_cat",                "type" => "select",                "options" => $site_cats,                "desc" => "description"),      Ideally, this change should work:               $cats_array = get_categories('hide_empty=0&taxonomy=location');      but it doesn't! I'm obviously missing something and don't know how to fix this. Any help is appreciated. Here's the register taxonomy part:                   // Register custom taxonomy         register_taxonomy(  "location",                              array(  "woo_estate"    ),                              array ( "hierarchical"      => true,                                      "label"             => "Locations",                                      'labels'            => array(   'name'              => __('Locations'),                                                                     'singular_name'     => __('Location'),                                                                     'search_items'      => __('Search Real Estate'),                                                                     'popular_items'     => __('Popular Locations'),                                                                     'all_items'         => __('All Locations'),                                                                     'parent_item'       => __('Parent Location'),                                                                     'parent_item_colon' => __('Parent Location:'),                                                                     'edit_item'         => __('Edit Location'),                                                                     'update_item'       => __('Update Location'),                                                                     'add_new_item'      => __('Add New Location'),                                                                     'new_item_name'     => __('New Location Name')  ),                                      'public'            => true,                                     'show_ui'           => true,                                         "rewrite"           => true )                             );      The pages codes can also be found at: http://codepad.viper-7.com/4Wkgg3 http://codepad.viper-7.com/n2hZRI I wasn't able to fix the issue in the end, but instead of using the theme options file to dynamically select the category I want, I used an override code to directly (statically) select the category I wanted and it worked.


title: How to make “Upload files”selected by default in Insert Media?

text: I am frustrated having to click on the "Upload Files" constantly instead of the first choice being Upload Files in posts editor....How can i make “Upload files” selected by default instead of "Media library"? ![](http://i.stack.imgur.com/nIcMv.jpg)


title: Noob Question - Buddypress Dynamic content on static page

text: Sorry for posting such a noob question but I am totally stuck and don't know what I am looking for. So basically I have a buddypress website with a static homepage. On the homepage I need to add a dynamic area where the admins can add a news story, this story will change maybe once a month. I just need to know what I am looking for, is it widgets or sidebars or something else? Once again sorry for the noob question, I am new to all the WP/BP stuff. Its the latest version of WP/BP. Kyle


title: How to stop wordpress from showing the selected category on top of others in the category selection?

text: By default in the category chooser at the edit post screen wordpress displays the selected categories on top of the others, i find that extremely annoying and i would like to disable the feature even if i need a hack for this.


title: Which WordPress books should I recommend to a beginning web designer?

text: I have a friend who has a background in graphic design. She has taken a particular interest to web design. I am a software developer/system administrator, not a web developer, and I'm certainly not a designer; I couldn't design a good-looking site to save my life. However, I am aware of the technologies involved and the skills that she would need to acquire. For the first book, I have recommended Head First HTML with CSS & XHTML for it's non-threatening, yet practical approach to teaching. This book introduces the reader to the modern technologies which are used by the browser to display web pages, and explains how to use them. As most of you know, that is only the tip of the iceberg. Most sites today rely on some sort of back-end (CMS, et cetra). So, any web designer should be able to work with at least one kind of CMS. I think WordPress would be a great place to start (and who knows, maybe even specialise in) because it is highly scalable, yet easy to use for developers, designers, server administrators, and end users alike. It is used by individuals, small businesses, and enterprise. At the same time, it is simple enough to design for that I don't think it would scare her off with too much programming. Disclaimer: I use WordPress for most of my personal sites, so I am more than a tad bias. However, I'm not sure which book/tutorial to recommend to her for WordPress design. Below is a list of books which I have found, and my thoughts on them: Head First WordPress: A Brain-Friendly Guide to Creating Your Own Custom WordPress Blog - It explains in plains in plain English what WordpPess is, how it works, and how to use it. I love the format for this purpose, but it has a very short theme chapter. It may be good for supplementary reading. Smashing WordPress: Beyond the Blog (Smashing Magazine Book Series) - It is well laid out, and up to date. It has an entire section on WordPress theme development. But, I would prefer a book which specialises in theme development. WordPress 2.8 Theme Design - This book is written to be a step-by-step guide to designing, building, and tweeking a WordPress theme. But, it's a bit out of date. Could this be a problem? Build Your Own Wicked Wordpress Themes - I have mixed feelings about this book. Is moderen, design orientated, and nice to look at. However, it bases much of of the work on the Automattic theme framework. On one hand, this minimises hand-coding, making it easy to learn and use, especially for someone without a background in programming. On the other hand, I'm concerned that such an approach might not prepare one for the "real world" of theme development, if one ends up applying for work at a design company, rather than doing freelance work. Is this a valid concern? How widely are frameworks used? As I said, web design/development is not my field, so I don't know much about the industry. Any help is appreciated.