wp_enqueue doesn't work

Some of you might know that I've been really struggling with trying to enqueue Javascript to my Wordpress theme and I just can't get it to work. I need to get this done somehow. I will keep this question updated, I will edit and I hope you will work together with me through this step by step! It's been a few months now and I still can't get it to work and I have no clue why! **Step 1:** I want to move all the script calls in my header.php into my function.php. I transfered everything to my function.php: **(updated!)**               function add_my_javascripts() {         /* If this is the admin area of WordPress, don't do anything */         if( is_admin() )             return;              /* Register all of our scripts */         wp_register_script('jquerytools', 'http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js', array('jquery'));         wp_register_script('jquery.form', get_template_directory_uri() . '/js/jquery.form.js', array('jquery'));         wp_register_script('sprinkle', get_template_directory_uri() . '/js/sprinkle.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'));         wp_register_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery'));         wp_register_script('tooltip', get_template_directory_uri() . '/js/tooltip.js', array('jquerytools'));         wp_register_script('tooltip', get_template_directory_uri() . '/js/sliding_tabs.js', array('jquerytools'));         wp_register_script('contact-form', get_template_directory_uri() . '/js/contact-form.js', array('jquery', 'jquery.form'));              /* Enqueue the ones that need to be enqueued */         wp_enqueue_script('sprinkle');         wp_enqueue_script('custom');         wp_enqueue_script('tooltip');         wp_enqueue_script('sliding_tabs');         wp_enqueue_script('contact-form');          }     add_action('wp_enqueue_scripts', 'add_my_javascripts');      Here's my **whole function.php** just to make sure that there's not some other mistake that keeps interfering with the wp_enqueue or something: http://pastebin.com/mhCNZbFW Also, I entered the code into my **PARENT THEME's function.php!** I do not use a function.php for my child theme at all. And I tried to call the action in my header.php: **(UPDATE: Currently NO HOOK at all, also no CALL in my header.php!!)** **Result:** All the scripts are properly loaded (checked with Firebug), but none of them actually works! Only the "custom.js" works (even without the action being called in the header.php). Why does this not work? Please help me working through this as it's causing so many problems! **Step2:** (RESOLVED) Next step will be to provide no.Conflict wrappers to every jQuery JS (which also doesn't work). What I already tried: - deactivated all plugins (no effect) - created a function.php for my child theme and moved the code above from the parent theme's function.php there (result: error message               Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'get_my_scripts' was given in /hermes/bosweb25a/b155/ipg.zoomingjapancom/wp-includes/plugin.php on line 405      - tried another theme (TwentyEleven): same issues - I tried to call it like that in the header.php (as that's how it's done in the TwentyEleven theme:                <?php wp_enqueue_script( 'jquery', 'jquerytools', 'jquery-ui-person', 'jqueryform', 'sprinkle', 'custom', 'tooltip' ); wp_head(); ?>          </head>      That also doesn't work ... **LATEST NEWS:** See updated function.php code above. I got to work quite a few things now. As for the jquery-form that was needed for the contact.php I just took the direct script call out of the contact.php and put it into its own js file, then wrapped it with a no_Conflict wrapper and now it works just fine! Only thing I'm worried about is whether Wordpress will now load it on every single page although it's only needed on the contact.php??!! **THE ONLY THING THAT IS STILL NOT WORKING is sprinkle.js:** Possible reason is that there might be a conflict with the ui-tabs and the jquerytools-ui- tabs. I should do something like this, but don't know where to put it:               <script type="text/javascript" src="jquery-1.6.2.js"></script>        <script type="text/javascript" src="jquery.tools-1.2.6-dev.js"></script>             <!-- must do this before including jquery-ui -->        <script type="text/javascript">           // change name of jquery tools tabs so that jquery UI doesn't barf           jQuery.fn.jtTabs = jQuery.fn.tabs;        </script>             <script type="text/javascript" src="jquery-ui-1.8.14.js"></script>      If you need any further information, please let me know! Here's my website for reference. I just can't do this on my own. Please give me some advice! Anything might help :) Thanks so much in advance!


Will the following code make my css deal with images in the optimum way?

In Appearance/Editor, the Stylesheet for my theme has in it the following code:                   #content img {     margin: 0;     max-width: 640px;         }         #content .attachment img {     max-width: 900px;      Does this mean that if I use the 'Add an image' button in WordPress, and then pick 'From url' to post an image in a blog post, that if the image at the url is bigger than the maximum width of my blog post, that it will not matter? -- That it won't result in the image taking longer than otherwise necessary to load on the users computer?


Passing user meta through comment form

I want to create a hidden field in the user comment form storing the logged in users info (already created a custom field at registration) so I can pass it to the comments section to display on the website. How can I create a hidden field and display it in the recorded comment section, or is there a better way of 'stamping' a piece of user meta data in a comment? Thanks.


How to query term_id of a Custom Taxonomy by name

I have created a custom taxonomy "Birthday" within which i have created various dates like "December-12", "April-15" How to get the term_id of the "December-12" by a query. Thanks.


What is the difference with get_sidebar and dynamic_sidebar?

I was wondering which one I should use. Maybe one use widgets and the other one doesn't?


Gallery Inside One Post

For image galleries, I need a code that uses next/previous links to bring you to the next/previous image **in that post** and **keeps the images in the correct order you chose while inserting them into the post**. (Every major news site seems to have this feature.) Currently, if you add `<?php next_image_link( false, 'Next Image' ); ?>` and `<?php previous_image_link( false, 'Previous Image' ); ?>` to your image.php or your attachment template in WordPress **the links may bring you to a gallery in a different post if the image is used elsewhere**. To further illustrate this proble, take a look at this gallery. There are three images. If you click the penguin and start using prev/next links to scroll through them you'll see additional images which should not be displayed! **This problem still has been solved. I had to use the media editor to attach the posts... too bad WP isn't always doing this natively when the image is uploaded.**


Remove image classes from post thumbnail output

I wish to remove the image classes generated by default in the output whenever post_thumbnail() is called -               <img width="1024" height="768" src="http://example.com/wp-content/uploads/2013/01/example-1024x768.jpg" class="attachment-large wp-post-image" alt="Yet another example">      I've read a bit about the remove_action() filter and this seems the way to go but I'm not sure how to use it.


How to change user email and password from frontend?

I am making a frontend user backend where they can edit profile. Every other field can be changed but email and password cannot be changed . i have tired every solution but no success. I am using this code to change the email but nothing happens wp_update_user( array( 'ID' => $user_id, 'user_email ' => $_POST['email'] ) ); i tried this but wont work ........... any ideas ??


Trying to get author'email for sending email from single.php page in wordpress?

I am trying to get author's email in order to send a email form `single.php` page in WordPress. Actually I would like to get output in quotes in order to send email with `wp_mail` function. Right?? Here is my code for doing it all               add_action('wp_ajax_sendmail', 's3_sendmail');     add_action('wp_ajax_nopriv_sendmail', 's3_sendmail');     function s3_sendmail()     {     if(isset($_POST['submitted'])) {               if(trim($_POST['earnings']) === '') {     $earningsError = 'Please enter your earnings.';     $hasError = true;     } else {     $earnings = trim($_POST['earnings']);     }          if(trim($_POST['earnings']) === '') {     $earningsError = 'Enter an hourly rate.';     $hasError = true;     }      else if (!preg_match("/^\d+$/", trim($_POST['earnings']))) {     $earningsError = 'Please Enter a numeric value in Estimate Earnings.';     $hasError = true;     } else {     $earnings = trim($_POST['earnings']);     }          if(trim($_POST['Duration']) === '') {     $DurationError = 'Please enter duration.';     $hasError = true;     } else {     $duration = trim($_POST['Duration']);     }          //if(trim($_POST['email']) === '') {     //$emailError = 'Please enter your email address.';     //$hasError = true;     //}      //else if (!preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+.[a-z]{2,4}$/i", trim($_POST['email']))) {     //$emailError = 'You entered an invalid email address.';     //$hasError = true;     //} else {     //$email = trim($_POST['email']);     //}          if(trim($_POST['comments']) === '') {     $commentError = 'Please enter a description.';     $hasError = true;     } else {     if(function_exists('stripslashes')) {     $comments = stripslashes(trim($_POST['comments']));     } else {     $comments = trim($_POST['comments']);     }     }                    if(!isset($hasError)) {     $emailTo = get_the_author_meta( $field, $userID );     $subject = 'email subject goes here'.$name;     $body    = "Name: $Name Duration: $duration Comments: $comments ";     $headers = "Reply-To: '".$name."' <$email> rn";     if(wp_mail( $emailTo , $subject, $body, $headers ))     {     echo "
Proposal Sent<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
";     }     else     {     echo "
Mail function Error! <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>

";     }     }     else     {     $error="

";          if($commentError!="")     {     $error=$error.'
'.$commentError.'
';     }          if($earningsError!="")     {     $error=$error.'
'.$earningsError.'
';     }          if($DurationError!="")     {     $error=$error.'
'.$DurationError.'
';     }               $error=$error."
";     echo $error;     }     }     else     {     $error="
Error!
";     }     die();     }


Add parent template name to body class filter when visiting subpage or single post

how would I go about creating a filter for the `body_class()` tag that allows me to add the the parent pages slug name as a class to the body whenever visiting a subpage or post?


Showing only certain buttons on tinymice content editor

I was wondering how to display just the following buttons: bold italic underline unordered list ordered list insert link unlik blockquote -- Thanks in advance.


Best Practice for re-using API Data in WordPress?

I'm using an API which is accessed with ID/Secret, etc. and use it in different widgets. In each widget however, I'm repeating the entire JSON process (i.e. file_get_contents, decode, etc.). I can't help but think this must be slowing the entire process down. What would be the best way of going about only calling this API once and then grabbing various data from it in different widgets, theme components, etc.? Thank you! Noel


Search by category displaying wrong items

http://www.mediwales.com/v3/members/ At the moment, if you search just using a keyword it shows the correct member. But if you just search using a category it just shows the full list. What code can I wrap around the member display to show the necessary member(s)? This is in functions.php               add_filter('pre_get_posts','my_filter_the_members',10,1);     function my_filter_the_members($query1){              //If the query is a search AND taxonomy terms are set, filter by those terms:         if(isset($_GET['mw-filter-terms'])){             //Get array of slugs of checked terms             $terms1 = (array) $_GET['mw-filter-terms'];                  //Tax_query array             $tax_query1 = array(array(                         'taxonomy' => 'members',                         'field' => 'slug',                         'terms' => $terms1,                         'operator' => 'AND',                     ));                   //Tell the query to filter by tax             $query1->set('tax_query1', $tax_query1  );         }         return $query1;     }      This is in the template:               <?php     /**      * @package WordPress      * @subpackage Default_Theme      */          get_header();     ?>                                    <div class="post" id="post-<?php the_ID(); ?>">

Search
                             <form id="custom-search" action="<?php bloginfo('url'); ?>/" method="get">                             <?php //Get all (non-empty) terms for taxonomy 'news-category'                             $args = array('orderby' => 'name','order' => 'ASC');                             $categories = get_terms( 'members', $args );                             ?>
Keyword
                             <input type="text" class="keyword" name="s" value="" />

Specialisms
                             <?php //Display checkbox for each term                             $counter = 1;                             foreach ($categories as $category) {                                 echo '<input type="checkbox" id="field-'.$counter.'" class="mycheckbox" name="mw-filter-terms[]" value="'.$category->slug.'">';                                 echo ''.esc_html($category->name).'';                             $counter++;                              } ?>                                                               <input type="hidden" name="post_type" value="members" />

                                                          <button class="blue medium awesome awesomeforward awesomesearch" type="submit">Search</button>                             </form>

Members Directory

                                 <?php the_field('content', 1886); ?>

                                 <a class="blue medium awesome awesomeforward" style="margin-left:193px;margin-bottom:10px;color: white !important; " href="<?php bloginfo('url'); ?>/member-signup/">Become A Member

Search Results

                             <?php $portfolioloop1 = new WP_Query( array( 'paged' => get_query_var('paged'), 'order' => 'ASC', 'orderby' => 'title', 'post_status' => 'publish', 'post_type' => 'members', 'posts_per_page' => 300 ) ); ?>                             <?php while ( $portfolioloop1->have_posts() ) : $portfolioloop1->the_post(); ?>                             <div <?php if (get_field('logo') != "") { ?>style="height:120px;"<?php } ?> class="news-item" onclick="location.href='<?php echo the_permalink(); ?>'">                                 <?php if (get_field('logo') != "") { ?>

                                                                                <img style="margin-right:15px;" src="<?php echo the_field('logo'); ?>" width="150" alt="<?php echo the_title(); ?>" />

                                 <?php } ?>                                 <div <?php if (get_field('logo') != "") { ?>style="float:left;width:379px;"<?php } ?>>
<a style="color:#AA3CA7!important;" href="<?php echo the_permalink(); ?>"><?php echo the_title(); ?>

                                         <?php $description = get_field('description');                                         echo substr($description,0,300) . "..." ?>

                             <?php endwhile; // end of the loop. ?>

              <?php get_footer(); ?>


Display latest comments on page with pagination

Im trying to display latest comments from all the post on a page named comments, now im able to use `<?php wp_list_comments('per_page=25', get_comments()) ?>` and it gets all the comments but when I try to use `<?php get_paginate_comments_links() ?>` nothing shows even the next and previous buttons dont show, what am i doing wrong? This is my current code, any help is appreciated               <?php wp_list_comments('per_page=5', get_comments()) ?>                              <div class="navigation">                   <?php get_paginate_comments_links(array() ?>     <?php previous_comments_link() ?>     <?php next_comments_link() ?>     </div>


front end logo upload like happytables

happytables has a cool feature where if you are logged in, on the home page && haven't uploaded a logo yet it will insert a drag + drop image box similar to image uploader on the backend. any ideas on how to pull this off? currently digging thru the source code, but if anyone has some pointers, i'd greatly appreciate it --


Highlight menu item when on a custom post type?

I'm currently using this code to display a menu of pages. I'm using CSS to target the class `current_page_item` which works fine until you're on a page with a custom post type. How can I target that class when the page the user is on is a custom post-type such as news or events?
     <?php $args = array(     'depth'        => 1,     'show_date'    => '',     'date_format'  => get_option('date_format'),     'child_of'     => 0,     'exclude'      => '1908, 6282, 6380',     'include'      => '',     'title_li'     => __(''),     'echo'         => 1,     'authors'      => '',     'sort_column'  => 'menu_order, post_title',     'link_before'  => '',     'link_after'   => '',     'walker' => '' ); ?>

<?php wp_list_pages( $args, 'sort_column=menu_order' ); ?>


Add Image Dimensions to Media Library Tab on Media Upoader

I would like to add the dimensions of each image to the media library tab in the media uploader. I have a multi-author website, where I require users to add a featured image with minimum dimensions. To make it even easier for them, I would like to include the dimensions of an image in the Media Library right there, so they don't need to click on an image to check if the dimensions are large enough to use as a featured image. Here is a screenshot of what I am trying to accomplish ![dimensions on media library tab](http://i.stack.imgur.com/rAVLa.png) I am no coder, so this is where I need help. Looking through the core code in `media.php`, it appears there may not be a way to actually add a new column, but that's fine. I was thinking the dimensions could be added in a span after the image title. The media dimensions are used in lines 1097-1130               $media_dims = '';     $meta = wp_get_attachment_metadata( $post->ID );     if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) )         $media_dims .= "ID'>{$meta['width']} × {$meta['height']} ";     $media_dims = apply_filters( 'media_meta', $media_dims, $post );          $image_edit_button = '';     if ( gd_edit_image_support( $post->post_mime_type ) ) {         $nonce = wp_create_nonce( "image_editor-$post->ID" );         $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> ";     }          $attachment_url = get_permalink( $attachment_id );          $item = "     $type_html     $toggle_links     $order     $display_title

ID'>
             ID'>

$image_edit_button

" . __('File name:') . " $filename

" . __('File type:') . " $post->post_mime_type

" . __('Upload date:') . " " . mysql2date( get_option('date_format'), $post->post_date ). '
';             if ( !empty( $media_dims ) )                 $item .= "
" . __('Dimensions:') . " $media_dims
\n";                  $item .= "
\n";      This part specifically on line 1127, displays the dimensions on the image when the user clicks "Show"                       if ( !empty( $media_dims ) )                 $item .= "
" . __('Dimensions:') . " $media_dims
\n";      ![media dimensions](http://i.stack.imgur.com/hpVVL.png) The title of the image when collapsed or "Hidden" is generated by line 1079-1080               $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case         $display_title = $show_title ? "
" . wp_html_excerpt( $display_title, 60 ) . "
" : '';      My hope is to take the code from line 1127 and insert it in the `<div class='filename new'>` on line 1079/1080 after the title, and give it a `<span class="img-dimensions" style="float:right;margin-right:100px">` so I can give it some space after the end of the title. Thanks in advance.


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

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


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

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


"Item not updated" when try to change category properties

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?


Looking to implement a scrolling gallery in my theme

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.!


Multiple Archive Pages for Custom Post Types AND Taxonomies

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.


How to use the HTTP API with a Proxy?

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._


Select post from dropdown and add query args not working

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>


Unassign uncategorized from post with 2 or more categories

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?


A refreshless WordPress website

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.


WP List Pages - Add Title Attributes to Anchors

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.


Does WordPress automatically do 301 redirect if I change permalink

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


Translating dynamic output with qtranslate

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


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

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?


Displaying cf post formats with oembed

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?


Login with Username (or Code) only

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.


Post archive for certain post format

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'");


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

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...?


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

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.


Google maps plugin

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).


display taxonomy slug from term ID

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!


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

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


A way to count logged in users and display count?

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


Failed media import

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...


page creator to leave comments ONLY

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.


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

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!


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

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.


Get posts from sites in Multisite?

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 ?>


Array in POST request -> is 404

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.


Convert Custom Table Data Based Plugin To Be Searchable

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.


Is it necessary to escape LIKE term in WP_User_Query?

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?


How to use relative path with my plugins folders?

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?**


Vanderlee jQuery color picker and WordPress Errors

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.


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

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.


How to order posts by slug using query_posts/ Wp_query

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?


Wordpress Backend Fine, All Themes Return a Blank Page?

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`


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

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!


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

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?**


Create anchor from Wysiwyg editor

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!


Custom Post Type uses Custom Tags in add_filter?

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


Rewriting WordPress URLs

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.


Create Unique ID for user

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?


Rewrite slug of custom post type to include post-id

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


My post views doesn't seem to be counted correctly

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


Defining a custom 404 for non-WordPress parts of site

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?


Wordpress post-type create url rewriting

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?


In big trouble - Allowed memory size of 268435456 bytes exhausted

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?


Get data from plugin People list in author template

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?


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

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


Change Default Custom Fields Metabox Name on cctm plugin

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?


Wordpress Multisite plugin delegation

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


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

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.


Own plugin corrups plugin-activation

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     }


Is there a drush equivalent for WordPress yet?

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?


Plugin Paths Issue

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.


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

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.


Translate widget titles using qTranslate plugin

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?


wp_editor doesn't work in front end area

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


Breadcrumbs with Custom Post Types?

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


Override database config for WordPress multiblog

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..


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

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! =)


User Without Email?

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?


Limit taxonomy results to a single cpt

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


Wordpress posts for multiple years

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.


Separator for custom nav menu

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.


Custom Menu in Themes not working even in Twenty Eleven theme

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?


query_posts call sets is_home() to true

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?


Custom Rewrite Rules Not Sticking

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.


Custom columns for taxonomy list table

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?


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

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


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

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?


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

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; ?>


Problem in logging in as admin

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


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

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!


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

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.


prevent users from changing their email address

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


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

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.


update_post_meta not working?

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?


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

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.


Widget with random posts from a blog for external sites

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?


wp-content/uploads returns a 404

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?


Show Multiple Size URL of one Featured Image/Thumbnail?

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 :)


How not to display ALL items of a database

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


How do i show wordpress attachments from current post?

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?


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

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.


Code for Recent Posts Widget

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!


can I run the test suite without a web server?

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.


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

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.


jQuery Image Annotation

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.


Metabox with multiple fields added by user and upload box

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? ).


Cannot enqueue jQuery correctly using Google CDN

# 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.