title: get_posts() and 'posts_per_page' arg

text: $args = array(     'posts_per_page'=>  -1,     'post_type'     =>  'listing',     'meta_query'    =>  array(             array(                     'key'       =>  'ListingRid',                     'value'     =>  $listing_ids,                     'compare'   =>  'IN'             )     )     );     $query = get_posts( $args );      I'm pulling home listings from a remote server and inserting them as custom posts into Wordpress. Only active listings are made available, to update the posts and clear the expired ones I grab an array of all active `'ListingRid'` from the server and put them in an array (have also tried a comma separated string) in `$listing_ids` and compare that array with what I currently have in my Wordpress db, then do a `posts__not_in` check and delete those posts that it returns. This snippet works fine on localhost running wamp server. When I run it on my vps (ubuntu) as soon as my script hits this block nothing after it is executed. If I remove the `'posts_per_page' => -1`, line it works, but as expected only returns 5 posts when I need it to return ~1,600.


title: Lost in creating multiple meta boxes

text:
I've been working for days to get this working without luck. Hope someone can help me. I created multiple metaboxes but my backend shows the boxes empty, I am lost and don't know where to go with this. Note that I am not closed to use multiple metaboxes as long as I can divide in blocks the info but I'm a noob... so any help is accepted. Please be patient because I need a detailed explanation. My code is:               $prefix = 'ikos_';     $metaboxWrapper = array();          $metaboxWrapper[] =     $meta_box = array(     'id' => 'features',     'title' => 'Property Features',     'page' => 'post',     'context' => 'normal',     'priority' => 'high',     'fields' => array(         array(             'name' => 'Price (in USD)',             'desc' => '',             'id' => $prefix . 'text',             'type' => 'text',             'std' => ' '         ),                array(             'name' => 'Price (in Mexican Peso)',             'desc' => '',             'id' => $prefix . 'text',             'type' => 'text',             'std' => ' '         ),              array(             'name' => 'Address',             'desc' => '',             'id' => $prefix . 'textarea',             'type' => 'textarea',             'std' => ''         ),              array(             'name' => 'Property for',             'id' => $prefix . 'select',             'type' => 'select',             'options' => array('Sale', 'Rent', 'Vacational Rental')         ),              array(             'name' => 'Area (m2)',             'desc' => '',             'id' => $prefix . 'text',             'type' => 'text',             'std' => ' '         ),              array(             'name' => 'Area of terrain (m2)',             'desc' => '',             'id' => $prefix . 'text',             'type' => 'text',             'std' => ' '         ),             array(             'name' => 'Number of rooms',             'desc' => '',             'id' => $prefix . 'text',             'type' => 'text',             'std' => ' '         ),              array(             'name' => 'Number of bathrooms. Include half bathrooms (ex. 2 1/2)',             'desc' => '',             'id' => $prefix . 'text',             'type' => 'text',             'std' => ' '         ),              array(             'name' => 'Service Bathroom',             'id' => $prefix . 'checkbox',             'type' => 'checkbox'         ),              array(             'name' => 'Furnished',             'id' => $prefix . 'checkbox',             'type' => 'checkbox'         )     ));      Then I have more metaboxes with checkbox groups like this:               $metaboxWrapper[] =     $meta_box = array(       'id' => 'installed',     'title' => 'Installed',     'page' => 'post',     'context' => 'normal',     'priority' => 'high',     'label' => 'Installed',       'desc'  => '',       'type'  => 'checkbox_group',              'fields' => array(       'options' => array(           'one' => array(               'label' => 'Air conditioner',               'value' => 'one'           ),           'two' => array(               'label' => 'Stationary gas',               'value' => 'two'           ),           'three' => array(               'label' => 'Water heater',               'value' => 'three'           ),               'four' => array(               'label' => 'Hurricain shutters or hurricain protection',               'value' => 'four'           ),              'five' => array(               'label' => 'Telephone line',               'value' => 'five'           )     )       ));      And to show them I have this but doesn't work. I can't even go to the part of saving and showing data in front end...so I don't know if it works. Still I pase it here so you can point me if I am doing it wrong.               add_action('admin_menu', 'mytheme_add_box');          // Add meta box     function mytheme_add_box() {     global $metaboxWrapper;          foreach($metaboxWrapper as $meta_box)     {     add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'],  $meta_box['context'], $meta_box['priority']);     }     }               // Callback function to show fields in meta box     function mytheme_show_box() {     global $meta_box , $post;     // Use nonce for verification     echo '<input type="hidden" name="mytheme_meta_box_nonce" value="',    wp_create_nonce(basename(__FILE__)), '" />';     echo '
';     foreach ($meta_box['fields'] as $field) {         // get current post meta data         $meta = get_post_meta($post->ID, $field['id'], true);         echo '
',                 '', $field['name'], '	',                 '';         switch ($field['type']) {             case 'text':                 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', '
', $field['desc'];                 break;             case 'textarea':                 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', '
', $field['desc'];                 break;             case 'select':                 echo '<select name="', $field['id'], '" id="', $field['id'], '">';                 foreach ($field['options'] as $option) {                     echo '<option ', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';                 }                 echo '</select>';                 break;             case 'radio':                 foreach ($field['options'] as $option) {                     echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' />', $option['name'];                 }                 break;             case 'checkbox':                 echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';                 break;               // checkbox_group       case 'checkbox_group':       foreach ($field['options'] as $option) {           echo '<input type="checkbox" value="'.$option['value'].'" name="'.$field['id'].'[]" id="'.$option['value'].'"',$meta && in_array($option['value'], $meta) ? ' checked="checked"' : '',' />                   '.$option['label'].'
';       }       echo ''.$field['desc'].'';       break;                  }         echo     '	',             '
';     }     echo '
';     }          do_action('save_post', 'mytheme_save_data');     // Save data from meta box     function mytheme_save_data($post_id) {     global $metaboxWrapper;     // verify nonce     if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {         return $post_id;     }     // check autosave     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {         return $post_id;     }     // check permissions     if ('page' == $_POST['post_type']) {         if (!current_user_can('edit_page', $post_id)) {             return $post_id;         }     } elseif (!current_user_can('edit_post', $post_id)) {         return $post_id;     }     foreach ($meta_box['fields'] as $field) {         $old = get_post_meta($post_id, $field['id'], true);         $new = $_POST[$field['id']];         if ($new && $new != $old) {             update_post_meta($post_id, $field['id'], $new);         } elseif ('' == $new && $old) {             delete_post_meta($post_id, $field['id'], $old);         }     }     }          // check autosave     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {     return $post_id;     }


title: Insert After Second Paragraph Without <P> Tag?

text: I use a code like the one shown below to insert ads after the first paragraph. The problem is that this code requires the content to be displayed within paragraph tags and I would like to use this code to insert a DIV.   When I simply replace the tags with div tags the code no longer works. How do I remove the paragraph tags from the code while allowing the code to remain functional?               <?php     $paragraphAfter= 1; //display after the first paragraph     $content = apply_filters('the_content', get_the_content());     $content = explode("<p>", $content);     for ($i = 0; $i <count($content); $i++ ) {     if ($i == $paragraphAfter) { ?>          CONTENT GOES HERE          <?php }     echo $content[$i] . "</p>";     } ?>


title: How do you make RSS feeds work under IIS 7?

text: Running IIS 7 and WP 3.0. I've got a web.config that has the necessary rewrite rules to make permalinks work, and they're working. However, if I point to n-nexus.realtimepublishers.com/content/?feed=rss2, the server first generates an HTTP 404. Weirdly, it then delivers the RSS feed. The problem is that the initial 404 makes things like FeedBurner and Safari barf; Firefox displays the feed properly (you can see the 404 error in Live HTTP Headers, though). What the heck am I not configuring properly? UPDATE: Disabled all plugins. No change. Boo.


title: How do I let users upload files to a chosen location?

text: I found some plugins which let me make my own forms but none worked for different reasons. I simply want to make a form so that users can upload files to a folder located in www.chusmix.com/images I'm trying this code, but it sends me to a "page not found":               <form enctype="multipart/form-data" method="post" action="http://chusmix.com/Imagenes/grupos">          Please specify a file:<br>     <input type="file" name="datafile" size="40">     </p>     <div>     <input type="submit" value="Send">     </div>     </form>      Thanks


title: How do I make search only search in post content?

text: I want to have two search bars, one which works normally and one that searchs only in the post content but I can't even find the code of the search funtion to create the second. Can I use a plugin to make my search function only search in post content? Thanks in advance


title: Hide all posts by an author

text: We have a category called "Tech", and want to hide posts from a specific author on this page. For example, John Smith's posts do not show in Tech category, or any category for that matter, even search. How could I do this? I don't want to hide the author name, I want to completely hide all posts by author X from the search, category, taxonomy pages etc. Thank you


title: WP NAV MENU - Dropdown always showing

text: I'm having some trouble getting the wp_nav_menu to work properly. This is the first time I have worked with this and for the most part it has all come together. My only issue that I am having is with the functionality of the dropdown menus. All of the pages are appearing correctly in the appropriate spot (the primary navigation), but the "fly outs" or drop down submenus are always appearing. I have of course registered the menu and have placed the wp_nav_menu portion in the navigation. My guess is I have no added support for the dropdown menus to BE drop down menus? I might also mention that this is a custom theme. I've built it from the bottom up. It's also in a development environment which will be hard to show you guys a live example. For this reason I have attached a screenshot.               wp_nav_menu( array(          'menu' => 'Primary Navigation',          'container_class' => 'primaryNav',          'depth'           => 2,          'fallback_cb' => 'none',          'theme_location' => 'Primary Navigation',     ));          register_nav_menu( 'Primary Navigation', 'Primary Navigation' );          add_theme_support( 'menus' );      I've come across two possibilities. I've seen mention of "walker," to which I have little to no understanding of. OR maybe it's as simple as adding some jquery to make them work? I am just under the impression that the functionality should already be there? Thanks in advance for any help. Will


title: Can I disable the autocomplete?

text: I've recently upgraded to WordPress 3.0, and am having a lot of problems with the autocomplete function when editing posts via 'quick edit' (e.g. /wp- admin/edit.php) - for example, editing tags. The autocomplete box often obscures the textbox I'm trying to enter text into, and sometimes gets 'left behind' once the 'update' button has been clicked. Is there a way to disable the autocomplete? **UPDATE** To clarify, this is a _Wordpress_ autocomplete feature, not a _browser-based_ one. **UPDATE 2** It looks as if I need to remove the 'suggest' argument to "load-scripts.php", referenced at the bottom of each admin page like so:               <script type='text/javascript'       src='http://www.example.com/path/to/wordpress/wp-admin/load-scripts.php?c=1&load=hoverIntent,common,jquery-color,suggest,inline-edit-post'>     </script>      That seems to be generated by:               do_action('admin_print_footer_scripts');      but I lose the code trail at that point - anyone?


title: How can I version the main CSS file?

text: How can I instruct wordpress to use a filename other than 'styles.css' for my main stylesheet - for example, styles-1.css? I'd like to do this for versioning and caching purposes.


title: Need to return a string as permalink insted of str_replace

text:
I'm using this code to get a alphabetic list of CPT's at my site. It's great and works perfect. One problem, the snippet returns urls as a string, tha just converts the_title to a slug, and that does NOT work when the title contains special characters. I simple need a solution of how to return the_permalink instead of this title- to-slug hack :)               <?php $list = '';      $tags = get_terms( 'inspirations-emne' );      $groups = array();     if( $tags && is_array( $tags ) ) {     foreach( $tags as $tag ) {     $first_letter = mb_strtoupper( mb_substr($tag->name,0,1) );     $groups[ $first_letter ][] = $tag;}     if( !empty( $groups ) ) {     foreach( $groups as $letter => $tags ) {     $list .= "\n\t" . '

' . apply_filters( 'the_title', $letter ) .'

';     $list .= "\n\t" . '
';     foreach( $tags as $tag ) {     $lower = mb_strtolower($tag->name);     $name = str_replace(' ', ' ', $tag->name);     $naam = str_replace(' ', '-', $lower);     $list .= "\n\t\t" . '
'.$name.'
';     }}}}else $list .= "\n\t" . '
Beklager, men ingen emner blev fundet
';print $list;     echo "
";     ?>      Any help to modify this snippet is much appreciated! Thanks.


title: How to use google custom seach for a particular post category and it's terms

text: I'm using Google custom search for my site. I need that Google only show search result for posts under a particular WordPress category. Though I need Google should index all. Is it possible to do with Google search, without compromising the site indexing ?


title: Echo custom taxonomy slug

text: I feel like I'm _this close_ but can't figure out if it's a synax or variable thing. I'm tring to echo the slug to auto-populate the corresponding image.               <?php              $terms = get_the_terms( $post->id, 'series', array( 'parent' => 0 ) );          $terms_slugs = array();         foreach( $terms as $term ) {             $terms_slugs[] = $term->slug;          }              if( !empty($terms_slugs) ) :           echo "/assets/products/" . $terms_slugs. "/logos/" .$terms_slugs . "-logo.png" ;         endif;     ?>


title: How do I change TinyMCE button "i" to create a i tag rather than em?

text: I want to give the "italic" button back the "styling" behaviour, rather than the spammy `<em>`. I want that button to print a `<i>` tag, rather than `<em>`. `<em>` tags became popular to spam search engines, but now I want it to be what it is: a styling feature to e.g. change the voice of the narration. I've got a script to create my own styles, so I'll include the `<em`> tag there, to use it as what it **REALLY** is: **EMPHASIS**. I'll then style it accordingly (big, bold). So now my problem is, I'm sure I can find the setting / string / parameter to hack in JavaScript, but... Do you know a way to hook it from / for WordPress?


title: Wordpress page edit does not save selected template

text: The feature did work in the past however pages now seem to default to 'Default Template'. I can see my available page templates in the drop-down on the Page edit page, however after saving the admin simply shows 'Default Template' again. I have tried disabling all plugins as well as remaking some of the templates, however the behaviour continues. Any ideas? Note: I'm using latest self-hosted WordPress. Update: After some digging it would appear that I am getting 'Table xxx/wp_postmeta' is marked as crashed and should be repaired". However running repair through phpmyadmin does not fix the issue. Update: Rebuilt the table entirely, still have issue. (Originally posted this question here: http://webapps.stackexchange.com/questions/33627/wordpress-page-edit-does-not- save-selected-template)


title: How to edit bbPress template files - WordPress + BuddyPress + bbPress?

text: I am using BuddyPress 1.6.1, bbPress 2.1.2 and WordPress 3.4.2 I follow the guide here. In the end, I did the trick pointed out by Sarah Gooding because mywebsite.com/forums was blank right after the above installation   * Created a page called "Forums" with permalink mywebsite.com/forums   * Insert bbPress shortcode [bbp-forum-index] into "Forums" page My questions are 1) How do I customise page templates for the forum e.g. Forum page, topic page etc. My current theme is a child theme of twentyeleven and it has the following structure > themes/bp-twentyeleven/ >   >   >     /activity/ >   >     /blogs/ >   >     /forums/ >   >         index.php >   >         forums-loop.php >   >     /groups/ >   >     /members/ >   >     /registration/ >   >     header.php >   >     sidebar.php >   >     style.css >   _Notes_   * Apparently, bp-twentyevelen/forums/index.php is being ignored.   * The reason for this set up is that I need the site to looks like TwentyEleven and has BuddyPress' functionality at the same time 2) How do I make sure that bbPress functions will work for my site e.g. do I copy and past all the functions in functions.php of bbPress' default theme over my theme's functions.php? 3) How do I ensure that whatever I will get from 1) and 2) (probably from bbPress experts somewhere) will not conflict with BuddyPress' functionality or my theme? BuddyPress setting screenshots are here and here. bbPress settings screenshot is here.


title: WordPress Post Editor Toolbar Missing

text: I've just migrated from one host to another (VPS). Now the post editor toolbar has gone away. And also parts of the website shows on the admin side when using the post editor. The only thing I did was move the site from one hosting provider to another. Any idea what could be going on here? I'm using WordPress v3.4.2. I tried to attache images, but as I new user, the system refused. Don't have enough reputation. Also, could not add comments. In any case, the toolbar is completely missing, and checking/unchecking the visual editor makes no difference. Also part of the website displays on the rightside of the post being edited. Doesn't look very good!


title: Does Wordpress support a shortcode calling itself from within a shortcode call?

text:
I've built a super-crazy Wordpress framework that has a million and one shortcodes, one of those is a columns shortcode which supports a count parameter that allows you to define a column and the appropriate class will be added. **My shortcode is as follows:**               add_shortcode('column', 'column_shortcode');     function column_shortcode($atts, $content = '')     {         extract(shortcode_atts(array(            'count' => 12         ), $atts));              if (stripos($count, '_') === FALSE)         {             if ((int) $count > 12)             {                 $count = 12;             }         }              $html = '
';         $html .= do_shortcode($content);         $html .= '
';              return $html;     }      There appears to be an issue however when the column shortcode is used within a column, is this a known issue or does Wordpress not support shortcodes of the same name being nested within one another? What essentially happens is the column inside is prematurely closed off in the outputted HTML and I see [/column] wrapped in paragraph tags being shown on the front-end. However if I create another shortcode and call it child, using the exact same code as above only the child shrotcode is just [child] instead of [column] everything works as expected. Here is the code from the WYSIWYG editor in my Wordpress installation. Exhibit A is the ideal scenario, I don't want to have to use two different shortcodes that do the same thing. Exhibit B is what works by simply duplicating the shortcode. **Exhibit A - does not work**               [column count="9"]          [column count="8_9"]          Welcome to the site.          Who's brave enough to fly into something we all keep calling a death sphere? Well, then good news! It's a suppository. A true inspiration for the children. Ah, computer dating. It's like pimping, but you rarely have to use the phrase "upside your head."          [/column]          [/column]      **Exhibit B - works**               [column count="9"]          [child count="8_9"]          Welcome to the site.          Who's brave enough to fly into something we all keep calling a death sphere? Well, then good news! It's a suppository. A true inspiration for the children. Ah, computer dating. It's like pimping, but you rarely have to use the phrase "upside your head."          [/child]          [/column]


title: Limit posts/pages in admin to user roles

text: I'd like to limit the posts and pages listed in the admin area to certain roles. There are plugins out there that can do some of what I need but they aren't granular enough for my needs. For example I have a 'Advice editor' role and I want to limit them to seeing and editing the 'Advice' pages (and by extension any categories I might wish to add). I have this cobbled together from various posts. It works but I can't get the list to include the parent and all children (it is either the parent or the children but not both). This maybe more of a WP_Query question or there maybe a different way to do it:               // http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/     function appthemes_check_user_role( $role, $user_id = null ) {          if ( is_numeric( $user_id ) )     $user = get_userdata( $user_id );     else         $user = wp_get_current_user();          if ( empty( $user ) )     return false;          return in_array( $role, (array) $user->roles );     }          // http://www.johnparris.com/how-to-hide-pages-in-the-wordpress-admin/     function jp_exclude_pages_from_admin($query) {          if (!is_admin()) {         return $query;     }          global $pagenow, $post_type;          if (appthemes_check_user_role("Advice Editors")) {           if ($pagenow == 'edit.php' && $post_type == 'page') {              //$query->query_vars['post_parent'] = 7;         //$query->query_vars['post__in'] = array( '7' ); // Enter your page IDs here         //$query->set('post__in', array('7'));         $query->set('post_parent__in', array('7'));          }          }          }     add_filter( 'parse_query', 'jp_exclude_pages_from_admin' );      I have come across the Press Permit plugin which can do this but it is a paid- for plugin and I'd like to understand this myself anyway. EDIT: I appreciate I can just put array the post_ids to include but I want to limit this by parent page and its children programmatically, in case future children pages are added (IDs are too vague in this case). Thanks in advance


title: How to translate "Permanent link to" text

text:
My theme contains the following to create permalinks:
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
      However I want to translate the "Permanent link to" text. How do I do that? Thank you.


title: How to control the width of the container in theme customizer wordpress?

text: How can i control the width of `#container` in theme customizer through functions.php in wordpress. I want to make a control so i can set the width from 100% to 60% or 30% of my `#container` How can i add this to my functions.php. Please help


title: calling admin-ajax.php from admin-ajax.php

text: I'm writing a plugin that calls the output of another plugin's ajax, which is set-up at `wp_ajax_` I would have called the functions directly, but limitations in the plugin make that a non-option. To make it clear, this is what's happening:   * User selects an action, then hits apply   * My plugin function is called in admin-ajax.php (via the `wp_ajax_` hook)   * The plugin function creates a nonced url like this: `$url = wp_nonce_url( admin_url( 'admin-ajax.php?action=plugin_action&post_id=' . $post_id), 'plugin_action' );`   * then I call that url with `wp_remote_get` output is `0`. Now the strange thing: instead of calling the url with `wp_remote_get` I echoed it, then copy pasted it in my browser and it gave me the correct output. ( **so it's not a matter of a missing** `die()`!) I've also tried putting my own function in edit.php (using the `load-` hook) instead of admin-ajax.php too, but the result was the same (0). Now the codex shows that the `load-` hook is executed before `wp_ajax`, so that's expected behaviour (the action is not added yet) but even in wp_ajax with a priority of 99 I get `0`. Any ideas on what's going on? Could it be that the action is not added yet when I call it directly from admin-ajax.php? If so, is there a better place to put my own action? (one that fires after wp_ajax)


title: Google Map iframe in a tab issue

text: I have embedded a map on the third tab on a page. Page here > 'Itinerary' tab If you go straight to the tab while the page is still loading - it loads the map perfectly. However, if you wait until the page has fully loaded and then click on the tab 'Itinerary', the map loads totally zoomed out and not where it should be. I have tried entering all the details like               <iframe src="http://ridewithgps.com/routes/1342529/embed" height="500px" width="100%" frameborder="0" http://maps.google.com/maps?ll=43.790716,4.166708&z=8&t=m&hl=en-GB&gl=US&mapclient=apiv3&skstate=action:mps_dialog$apiref:1&output=classic></iframe>      but it still won't work for me. I am very little knowledge of Javascript but I'm guessing that it needs to be reloaded no the tab or something to get it to zoom in.


title: walker class for custom menu structure

text:
i design a html template for hospital website and my menu structure is like this:

                 About
 Mass General

Hospital Overview

                                 Why Mass General

Awards & Recognitions

History

Leadership

Mass General in Focus

Quality & Safety

In the Local & Global Community

Massachusetts General Physicians Organization

                                 Multimedia

Videos

Slideshows

Audio

View All Multimedia

                                 News & Events

Events Calendar

Mass General News

                                 Support Mass General

Make a Gift

Volunteer

Blood Donor Center

Organ & Tissue Donations

      How can I create a custom walker class for this structure?


title: Custom Taxonomy List links being re-written

text:
I am trying to show a list of terms from my Job Category. I tried the following:               function job_listing_taxonomy_list( $taxonomy,$hide ) {         $args = array('order'=>'ASC','hide_empty'=>$hide);         $terms = get_terms( $taxonomy, $args );         if ( $terms ) {             printf( '
', esc_attr( $taxonomy ) );             foreach ( $terms as $term ) {                 printf( '
%s
', esc_attr( $term->slug ), esc_html( $term->name ) );             }             print( '
' );         }     }      However, when I click the link of one of the terms that are generated, for example:               http://example.com/?s=&job_listing_category=finance      it is changed to:               http://example.com/?s?job_listing_category=finance      Why is the =& changing to a '?' ? I've spent a good half an hour combing Google and this site for answers, but I'm not entirely sure what to even look for! On a side note, I did have a Custom Post Type Permalink Rewrite plugin installed earlier which caused a Strict Standards error, but after disabling it (turns out I wasn't using it anyway), I now get this error.... Any suggestions? Edit: I've tried replacing the & with &, but it didn't make a difference


title: Wordpress Multisite - Create Default Post and New Category On New Site Install

text: I've looked around quite a bit, but couldn't find help with creating a new, initial blog post and new category (or renaming the default category) once a new sub-domain has been installed. I've added a script in the mu-plugins folder and have tried to find code for, and figure this out but to no avail. Any help is appreciated. Can this be done? I've found and successfully used the code to create new pages, but that's as far as I can go.


title: Print the whole page?

text:
I am trying to make a loop to loop all pages beneath each order. I want this because I want to make a one-pager with a page as an element of the one-pager. So that you can go into WP to edit a page and choose a template, and it will be printed through a loop. It was going well until I thought of something. I have a loop, but it displays the title and the content, so not the whole page. I want several pages with different page templates. So you can go in the dashboard, select the template and it will be printed differently (and also different custom fields are added each template). My loop is this:               $args = array( 'post_type' => 'page', 'order' => 'ASC' );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();     ?>     <div class="section" id="<?php echo $post->post_name; ?>" style="background-image: url('<?php the_field('backgroundimg_home'); ?>'); background-color: <?php the_field('achtergrondkleur'); ?>">
<?php the_title(); ?>
         <?php the_content(); ?>
     <?php endwhile; ?>      So i want to print each page beneath each other, I have no idea how.. Isn't there just something like get_the_page..? I studied the WordPress codex but couldn't find anything.


title: Calling a function on admin_init when WP core files are in a subdirectory

text: I have an install set up along the lines of this tutorial, whereby my core files (wp-admin, wp-includes) are separate from the content folder:               /wp/wp-includes/     /wp/wp-admin/     /wp/wp-load.php etc     /custom-content/plugins/     /custom-content/themes/     /custom-content/uploads/      So far everything is working great; the core and plugins are loaded via svn:externals and working fine. The only issue I've stumbled on is trying to run a simple function to streamline the admin area for the client. Currently I'm trying the following, which has worked on regular installs (with the wp- content folder in the same directory as the other folders):               add_action( 'admin_init', 'remove_menu_pages' );          function remove_menu_pages() {          global $current_user;         $current_user = wp_get_current_user();         $current_user_id = $current_user->ID; // get the user ID              if ($current_user_id != '1') { // End client will have user id of 2              // Remove the "Tools" menu             remove_menu_page('tools.php');              }     }      This has worked fine in the past, but doesn't seem to work in the new setup. As far as I can tell, I'm having trouble hooking into `admin'_init`; I've also tried enqueuing a stylesheet for the admin area without any luck. Am I missing something obvious?


title: email wordpress users using BCC

text: I am currently using the below code to email users when a new post is published, but I need it to BCC all users and not TO all users. Any ideas?               function email_members($post_ID)  {     global $wpdb;     $usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;");     $users = implode(",", $usersarray);     mail($users, "New WordPress recipe online!", 'A new recipe have been published on http://www.wprecipes.com');     return $post_ID;     }          add_action('publish_post', 'email_members');


title: Remove border on custom meta box

text: How can i remove the border/box on a custom meta box? I need to remove the class "postbox" from a custom meta box, so that it looks just plain. How can i do that?


title: Getting rid of files not used by latest upgrade

text: After doing a Wordpress upgrade I notice that there are some files that have an old creation date. Am I safe to delete these on the assumption that they were part of the previous release and so aren't needed for the latest release? I've used windiff to compare two different downloaded releases (i.e. not my live site) and I can spot files that were in the old, but not in the new, but it would be easier to get rid of the old ones if the answer to my question above was "yes". For example, comparing 3.2.1 with 3.3.1 there are 80 files in 3.2.1 not present in 3.3.1. Here are a few:   * wp-admin\css\login-rtl.css   * wp-admin\css\login.css   * wp-admin\css\ms.css   * wp-admin\css\nav-menu-rtl.css


title: How to make WP_Query 'post__in' accept an array?

text: I have a function that returns a comma separated list of post ids that a particular user can access. I want to use this list in a WP_Query loop. The custom function:               $array = user_albums();     foreach( $array as $post ) {         if( !in_array( $post->ID, $array ) )             $ids[] = $post->ID;     }     $access_ids = implode( ', ', $ids );      So here is the situation:   1. On my test site the id list is `158, 162, 145, 269`.   2. Inserting the list of ids returns only the first post. `'post__in'=> array( $access_ids ),`   3. Inserting the list of ids not in an array returns an error. `'post__in'=> $access_ids ,`   4. Inserting the post ids manually returns correct posts `'post__in'=> array( 158, 162, 145, 269 ),` **What could I be doing wrong?**   I appreciate any help.


title: WooCommerce - Is is possible to replace downloadable file and allow existing customer to get it?

text: I have a WooWommerce 2.0 shop where I sell downloadables and, from time to time, I have to replace existing files with newer versions. When I replace the file URLs for the downloadable files, Customers who already purchased them earlier cannot get the latest version by following the link they received with their order, receiving a "No File Defined" error instead. Is there a way to ensure that the link received with an order always grants access to all the files defined for the Downloadable Product, no matter what they are? Alternatively, would there be a way to send updated links to existing Customers? Thanks in advance for the answers.


title: How to include error message on login

text: I am a novice with php, so I need help with this one. Please bear with me. I want to include an error message on the wp_login.php page when visitors are redirected from a "user only/logged in" page. Below is the code I have for the page template which I use for "users only." It checks if the user is logged in or not. if he is not, he is redirected to the login page. This is where I get stuck. I tried to but together some code I found on google but no luck. Is there a way to pass an error message from here to the login page?               if (!is_user_logged_in()) { auth_redirect(); }     add_action('login_head','ref_access');          function ref_access() {          global $error;          if( !empty($_GET['ref']) && 'access' == $_GET['ref'] )         $error  = 'Restricted area, please login to continue.';}      Any code suggestions would be appreciated.


title: How to remove ( 0, 0 ) from forum page in bbpress

text: I would like to remove trailing (0, 0) from the /forums page (forums being the 'forums base') in bbpress. The site is also using buddypress and bbpress got installed as a part of 'group forums'. Here's how the /forums page looks like at the moment: General Forums               General (0, 0),     Methodology (0, 0),     Implementation (0, 0),     Tools (0, 0),     Training (0, 0),     New to Lean and Six Sigma (0, 0),     The Water Cooler (0, 0)


title: Include Drafts or Future posts with count_user_posts?

text: I'm use the code below to get the number of posts by a user and it works fine but it only includes published posts. How can I modify this code or use different code to have it include "future" post_status's or "drafts", for example.               <?php     $post_count = count_user_posts($curauth->ID);     echo '<p>User post count is ' . $post_count;     ?>


title: Where does WordPress store a list of Super Admins?

text: I had to switch around my Super Admins. I did it through the MySQL tables directly. I now have 1 official Super Admin for my network (which is what I want & need) but WordPress shows that I have 2 Super Admins:               All (71) | Super Admins (2)      Where does WP store the SA count or the list of SA's?


title: wordpress upload permission on nginx & ubuntu

text: I have a problem with wordpress upload folder permission on nginx/ubuntu VPS. keep getting the error: > “asr.jpg” has failed to upload due to an error Unable to create directory > uploads/2014/02. Is its parent directory writable by the server? here are my uploads folder settings: `drwxrwxr-x 8 www-data www-data 4096 Feb 6 14:41 uploads` I also check that wordpress/php is running as the www-data user.


title: 404 Error on Custom Post Type / Custom Taxonomy

text: I have a registered post type with 'rewrite' set as slug=>cpt_name, with_front=>true.               register_post_type( 'objection_handling',                        array(                                            'rewrite' => array(                                                 'slug' => 'objection_handling',                                                 'with_front' => true                                                 )      I then have a wp_list_pages function with an argument as post_type=>cpt_name. This function successfully displays an unordered list of my custom post type. I then have custom taxonomies with rewrite=>false.               register_taxonomy(                       'objection_topics',                       'objection_handling',                       array(                             'hierarchical' => true,                             'public' => true,                             'query_var' => true,                             'rewrite' => false,                             'labels' => array(                                               'name' => __( 'Objection Handling Topics' ),                                               'singular_name' => __( 'Objection Handling Topic' ),                                               'hierarchical' => true                                               ),                             )                       );      Now I'm thinking this will output a URL like : /objection_handling/[title-of- page] but I'm getting 404 errors.


title: Adding Gravatar to rss feed

text: So I have a mailchimp email that goes out and shows the latest posts that have been made on the site. The users on the site all have gravatars and I want to include that in the rss feed so that I can point the mailchimp image reader to them. I have tried using snippets like:               <?php echo get_avatar( get_current_user_id(), 48 ); ?>      or               <?php echo get_avatar( get_author_email(), 48 ); ?>      and adding that to the rss template in /wp_includes (I would love to do it in functions.php but honestly I just want it to work for this one site so I don't care how I get it done). It's curious because when I do searches I can only find people trying to figure out how to remove it instead of insert it... I am at a loss.


title: Query_vars not working for me

text: I'm trying to add an all pages link to posts when I have `?all=1` at the end of the URL it's returning "not set", I'm not sure what I'm doing wrong. I've looked here and my code is the same as here: http://codex.wordpress.org/Custom_Queries#Custom_Archives functions.php               add_filter('query_vars', 'all_pages' );     function all_pages( $qvars ) {     $qvars[] = 'all';     return $qvars;     }      single.php               global $wp_query;     if (isset($wp_query->query_vars['all'])) {         $remove_pagination = $wp_query->query_vars['all'];          echo "all set";          } else { echo "not set"; };


title: How to save the same post in multiple blogs?

text: I would like to write my post in one of the my 3 blogs and the same post will be published in the other two blogs. How can I do that?


title: Where can i get wpcom-carousel?

text: I am looking for a good carousel, I loved the one at http://icanhascheezburger.com/ and http://tylertalent.com/photos/ I looked at the code and it seems its called wpcom-carousel, but I dont know which plugin on my wordpress installation would give me the same carousel.


title: How can I list random authors from current post category?

text:
The following lists authors of the current category.   But I want this to be a list of 6 random authors from current post category.               foreach((get_the_category()) as $category) {       $postcat= $category->cat_ID;      }          $current_category_ID = $postcat;     $current_cat_id = $current_category_ID;     $author_array = array();     $args = array(     'numberposts' => -1,     'cat' => $current_cat_id,     'orderby' => 'author',     'order' => 'asc',          );     $cat_posts = get_posts($args);     foreach ($cat_posts as $cat_post) :     if (!in_array($cat_post->post_author,$author_array)) {     $author_array[] = $cat_post->post_author;     }     endforeach;     foreach ($author_array as $author) :     $auth = get_userdata($author)->display_name;     $auth_link = get_userdata($author)->user_login;     $autid= get_userdata($author)->ID;     $link = get_author_posts_url($autid);     echo ''. get_avatar( $autid, '46' ).'';     echo "";     echo '
'.$auth.'
';     echo "";     echo "

";     echo "
";     endforeach;


title: Retrieve query var within functions.php

text: I have query var set using the following filter:               add_filter('init', 'add_query_vars');     function add_query_vars() {         global $wp;         $wp->add_query_var('user_login');     }      I am able to retrieve the query var using `get_query_var('user_login');` in page templates without any hiccup. However, on using `get_query_var('user_login');` within a function inside of functions.php, no value is returned. What is the correct way to retrieve the query var within a function inside of functions.php?


title: How to Link to WP Pages Internally and Extenally

text: Converting my HTML template to WP Theme I am confused how to linkto the pages in WP? For Example I have an Item div which I would like to link to my store page when user click on that but I dont know how to get the correct URL for my store page?! This is also happening when I would like to link from another site to my page for example how I can link to my page from here?   http//www.ghazalphoto.portfolio.html Or   http//www.ghazalphoto.portfolio.php Or   http//www.ghazalphoto.portfolio


title: Custom Theme Fields in Settings Menu - apply filters to one of those fields?

text:
I found an interesting concepts of adding an additional option to the "General Options" in Wordpress.               /**      * Custom Theme Settings      * see http://digwp.com/2009/09/global-custom-fields-take-two/      */          add_action('admin_menu', 'add_gcf_interface');          function add_gcf_interface() {         add_options_page('Other', 'Other', '8', 'functions', 'otherGlobalOptions');     }          function otherGlobalOptions() {         ?>

Sonstiges
         <form method="post" action="options.php">             <?php wp_nonce_field('update-options') ?>
Welcome Message
             <textarea name="welcomemessage" cols="100%" rows="7"><?php echo get_option('welcomemessage'); ?></textarea>

<input type="submit" name="Submit" value="Save" />
             <input type="hidden" name="action" value="update" />             <input type="hidden" name="page_options" value="welcomemessage" />         </form>
         <?php     }      **This works just fine.** I'm just wondering now if there is a chance to apply a filter to that input? Like I can do `add_filter('the_content', 'wr_replace_text', 100);` I want to do               add_filter('welcomemessage', 'wr_replace_text', 100);      Is that somehow possible, because this doesn't work for me at the moment. Kind regards, Matt


title: How to add a body class to all interior pages except the homepage

text: I want to add a class to the body tag to all pages EXCEPT the homepage. Right now I have. `<?php body_class('interior'); ?>` But it adds 'interior' to ALL pages including the home page. What is the best standard way of adding a class to the body tag?


title: render html no formatting

text: How can I get WordPress to render a page without it adding any addtional html? I'm trying to build a dialog that will work on mobile devices and I only want to show that dialog and not have any of the standard wordpress content around it.


title: Paginate WordPress Category Pages

text: I am using the following `query` on my `category.php` template:               <?php         $paged = (get_query_var("paged")) ? get_query_var("paged") : 1;         query_posts("posts_per_page=2&paged=".$paged);     ?>      The one thing that I've noticed is that this breaks my pagination...with this code the pagination returns "paged" in the url: http://example.com/?cat=12&paged=2, fortunately or unfortunately it's a simple issue with the url...instead of returning "paged" in the url, it should return "page" or http://example.com/?cat=12&page=2. I have tried altering my code (as explained: http://codex.wordpress.org/Function_Reference/get_query_var for pages):               <?php         $page = (get_query_var("page")) ? get_query_var("page") : 1;         query_posts("posts_per_page=2&page=".$page);     ?>      But that doesn't work either...any ideas? Thanks,   Josh


title: wp-admin won't load after setting wp-login custom url

text: I changed the wp-login.php url to /login/ so all links in registration and forgot password emails have /login/ rather than wp-login.php. The problem now is that when I visit /wp-admin/ or click on the dashboard once logged in, it starts by going to wp-login.php?redirect_to... and then goes to /login/. ## How can I fix it to keep the custom login url but also access wp-admin? Functions.php               add_filter('site_url',  'wplogin_filter', 10, 3);     function wplogin_filter( $url, $path, $orig_scheme )     {      $old  = array( "/(wp-login\.php)/");      $new  = array( "login");      return preg_replace( $old, $new, $url, 1);     }               add_filter( 'lostpassword_url', 'custom_lostpass_url' );     function custom_lostpass_url( $lostpassword_url ) {         return get_option('siteurl'). '/forgot-password/';     }


title: Run query_posts if SESSION is empty?

text: I am having trouble running query_posts when my page loads for the first time, i.e Session is empty. When the page loads for the first time and the SESSION is empty, the following code runs:                   <?php         $id = 106;       if ((empty($_SESSION['r1']))){                             echo "This Line Prints";                 query_posts("cat=-.'$id'&".$query_string);                 wp_reset_query();                     echo "This Line also Prints";             }         ?>      The two statements mentioned in the above code are printing but the query_posts is not running here. However when I am running it outside the session it is working fine :S How can I run this query_posts if the Session is empty? Why doesn't this code work?


title: hiding permalink in admin if the user is subscriber

text: I don't want to show the permalink if the user is subscriber. Can anyone help me to achieve that? PS: I'm talking about the permalink which appears `below title` while creating new post. PPS: I modified the rules for subscriber. They can able to submit the post for review


title: WP Post Meta Box Field Not Showing Updated Field

text:
Problem with the nonce field. Trying to figure out why the meta box won't display the saved field after page refresh, i.e. enter code in code field. Hit save. The code just entered does not reappear in the code field. Thank you. Here is the code I'm using:               $meta_box_code = array(         'id'       => 'id-meta-box-code',         'title'    => __( 'code', 'framework' ),         'page'     => 'post',         'context'  => 'normal',         'priority' => 'high',         'fields'   => array(             array(                 'name' => __( 'The Code', 'framework' ),                 'desc' => __( 'Place Your Code Here:', 'framework' ),                 'id'   => 'id_code',                 'type' => 'textarea',             ),         ),     );          add_action( 'admin_menu', 'add_the_meta_box' );          function add_the_meta_box() {         global $meta_box_code;              add_meta_box(             $meta_box_code['id'],             $meta_box_code['title'],             'show_the_meta_box',             $meta_box_code['page'],             $meta_box_code['context'],             $meta_box_code['priority']         );     }          function show_the_meta_box() {         global $meta_box_code, $post;              echo '<input type="hidden" name="id_meta_box_nonce" value="', wp_create_nonce( basename( __file__ ) ), '" />';         echo '
';              foreach ( $meta_box_code['fields'] as $field ) {             $meta = get_post_meta( $post->ID, $field['id'], true );             switch ( $field['type'] ) {                 case 'textarea':                     echo '
', '', $field['name'], '' . $field['desc'] . '	', '';                     echo '<textarea name="', $field['id'], '" id="', $field['id'], '" value="', '" rows="8" cols="5" style="width:100%; margin-right: 20px; float:left;">', '</textarea>';                     break;             }              }              echo '
';     }               function id_save_data( $post_id ) {         global $meta_box_code;              if ( ! isset( $_POST['id_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['id_meta_box_nonce'], basename( __file__ ) ) ) {             return $post_id;         }              if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {             return $post_id;         }              if ( 'page' == $_POST['post_type'] ) {             if ( ! current_user_can( 'edit_page', $post_id ) ) {                 return $post_id;             }         } elseif ( ! current_user_can( 'edit_post', $post_id ) ) {             return $post_id;         }              foreach ( $meta_box_code['fields'] as $field ) {             $old = get_post_meta( $post_id, $field['id'], true );             $new = $_POST[$field['id']];                  if ( isset( $new ) && ! empty( $new ) && ( $new != $old ) ) {                 update_post_meta( $post_id, $field['id'], $new );             } elseif ( '' == $new && $old ) {                 delete_post_meta( $post_id, $field['id'], $old );             }         }          }          add_action( 'save_post', 'id_save_data' );


title: BuddyPress on Multisite

text: Does having BuddyPress installed on a Multisite setup mean that users in each of the different sites can interact or view the actions or content of users on other sites in the network?


title: Make user as Default contributor for all Blog Posts

text: I need to get a different requirement, where a particular user need to set as default contributor. I'm not sure whether wordpress actually makes a user default. But for now i need to make a user as default contributor to all the posts, posted on the Blog. Question is : How to set a user as default Contributor?


title: How can I prevent or workaround Wordpress GUID mangling?

text: I am importing posts from an RSS feed into a custom post type. I have a filter on post_type_link so that whenever one of these posts is displayed in RSS or other parts of the site, it links back to the original post location. When I create the post I set the GUID for the new post to be the same as the one from the RSS feed, because the GUID should never change. Despite this, Wordpress changes the GUIDs, by prepending "http://" to all of them. This has two effects:   1. The next time I scrape the RSS feed the GUIDs do not match, and I get duplicate posts.   2. If a user subscribes to both the original RSS and my feed, they see all posts twice. Both these two problems are the exact reason why the GUID exists and must never change. So my question is why does Wordpress insist on changing the GUID, and how can I prevent or workaround this problem? I tried adding a filter to get_the_guid to fix the mangled GUIDs, but Wordpress puts the 'http://' back on after calling get_the_guid but before printing the RSS.


title: How is custom menu hierarchy output handled?

text: I'm looking to pass custom nav_menus through an RSS feed so I can grab them on other sites to create the same custom menu on multiple sites. What I can't figure out by looking through the database is how WP is storing the data it needs to know which items are parent>child related for hierarchy. How does it know to output the "child" pages as a separate ul even if they aren't "officially" set as parent>child (from edit post screen), only visually in the Menus area? I can look at just the post type of nav_menu_item in the database and the menu_order column lists the items in top to bottom order but nothing seems to reference the menu>submenu relationship. Thanks for anything you can tell me.


title: Wp_User_Query not sorting by meta key

text:
I'm trying to list users sorted by a meta value. I store a score for each user in their user meta which is just a number but the loop isn't sorting. I include the score in the loop so that I can see that it's not being sorted correctly. What am I doing wrong?                $args = array(         'meta_key' => 'score',         'meta_value' => 0,         'meta_compare' => '>',         'orderby' => 'meta_value_num',         'number' => 20      );      $suggested_user_query = new WP_User_Query( $args );      $users = $suggested_user_query->get_results();      echo '
';          echo '
';          foreach ($users as $user) {              // get all the user's data              $user_info = get_userdata($user->ID);              echo '
';          echo '
'.bp_core_get_user_displayname( $user->ID ).'
';          $score = get_user_meta( $user->ID, 'score', true );              echo $score;              echo '
';          }          echo '
';           echo '
';


title: Can I move to wordpress.org and continue to be included as a wordpress.com favorite blog?

text: I'm listed as a wordpress.com favorite blog. If I move over to wordpress.org, will I continue to be listed as a favorite with wordpress.com?


title: sql for querying post and their category

text: I'm trying to query the wordpress database for the post and what category they belong in. Is there a sql query that I can use for this? Thanks,


How to disable categories/most used in 'add new post'? I tried function: remove_meta_box(), but it doesn't work for me, i tried it in functions.php for my theme, it's mistake?


title: how to reduce the number of spam comments

text: I've got the Akismet plugin on my WordPress site but I've been getting more and more spammy comments (that get caught). I'm amazed at the number as the site isn't that popular and doesn't have much traffic. Are there any methods for reducing spam?


title: remove and then add wpautop

text: I'll start by saying yes, I searched, and _yes_ , I found an answer to this question. It's basically the solution I came up with but I want to make sure this isn't a bad solution. Here's the real question. I want make the post title a part of the first paragraph on certain types of posts. My solution is straightforward. I call this instead of `the_content` for a certain category.               function yb_link_post() {       $link_post_title = '' . get_the_title() . '';       $link_post_content = $link_post_title . ' — ' . get_the_content();            remove_filter('the_content', 'wpautop');       echo wpautop($link_post_content);       add_filter('the_content', 'wpautop');     }      So is this a bad way to do this? I have a hunch that removing and then adding `wpautop` could have repercussions that I'm not considering. Can anyone tell me if this is a good solution, or if there's a smarter way to do this?


title: Wordpress MU - get requested subdomain

text: I've installed WordPress MU and I am using sub-domains. Now if subdomain doesn't exist it will redirect visitor to a page defined in wp-config.php like this:               define( 'NOBLOGREDIRECT', 'http://www.mydomain.com/404-error' );      Now on that page I have some script and I need to extract "originally requested URL". E.g. if user wanted to visit: blogs.mydomain.com and that blog doesn't exist - user will see http://www.mydomain.com/404-error and on that page - how can I detect which domain user requested ? I've tried `$_SERVER['HTTP_REFERER']` but it's always empty.


title: How can you use custom types/taxonomies?

text: The custom types/taxonomies feature of WP 3.0 is a neat one. I can think of a few ways to use the duo: to display projects, a portfolio, or a gallery. What else can custom types and taxonomies be leveraged for?


title: Custom post type in submenu with custom meta box as a title with custom html

text:
I am trying to create a menu in wordpress using a custom post type as the main menu item at the top level and all of its childs are going to be included from the posts i create inside it. The html i would like to try and create is:

Home

Products

Seating

Custom post link

Custom post link

Custom post link

Desking

Custom post link

Custom post link

Custom post link

Accessories

Custom post link

Custom post link

Custom post link

column4

Custom post link

Custom post link

Custom post link

      I have created a custom post type like so:               register_post_type( 'products',             array(                 'labels' => array(                     'name' => __( 'Products' ),                     'singular_name' => __( 'Product' )                 ),                 'show_ui' => true,                      'capability_type' =>  'post',                 'has_archive' => true,                 'show_in_nav_menus' => true,                 'rewrite' => array('slug' => 'products'),                 'supports' => array(                     'title',                     'editor',                     'custom-fields',                     'revisions',                     'thumbnail',                     'page-attributes'                 )             )         );      I also have on that custom post a custom meta box to select what category the product is in like so:               function products_category_meta_box_cb($post) {         global $post;         wp_nonce_field('products_category_nonce', 'products_category_meta_box_nonce');         $values = get_post_custom($post->ID);              $menu_value = isset($values['products_category']) ? esc_attr($values['products_category'][0]): '';              $services_array = array('Seating' => 'seating', 'Desking' => 'desking', 'Accessories' => 'accessories');              echo '
Select the product category.
';              echo '<select name="products-category">';         foreach ($services_array as $key => $value) {             echo '<option value ="' . $value . '"' . selected($menu_value, $value, false) . '>' . $key . '</option>';         }         echo '</select>';     }      what i would like to do is for all of the seating products go inside one li with a class column so i can float them next to each other and the content of that li will be a title which it gets from that dropdown inside the post and then the custom post type links under that. I hope that makes sense, I know this is quite a complicated question so please ask me if you need some more explanation. Thanks for reading and would really appreciate your help Alex


title: How to pass multiple values in shortcode?

text: All I am using formidable plugin and on one page i need to use 5 shortcodes.               [frm-entry-delete-link id=9 page_id=25 field_key=hsn108]     [frm-entry-delete-link id=12 page_id=25 field_key=cp7pi]     [frm-entry-delete-link id=13 page_id=25 field_key=ksa9qv]     [frm-entry-delete-link id=14 page_id=25 field_key=9zuf6o]     [frm-entry-delete-link id=15 page_id=25 field_key=w8w7op]      Is that possible to pass this all in single short code ?


title: different way to achive stylesheet_url

text: I'd like to understand the difference between:               <?php bloginfo( 'stylesheet_url' ); ?>      and               <?php bloginfo('template_url'); ?>/style.css      because I think the second one is more flexible (is i decide to move the file in a subdirectory, for example. or if I have more stylesheet to add.. the second one seems smarter). Am I wrong? In particular, where is `'stylesheet_url'` stored? and how to change it?


title: How-to: Translate plural forms for themes/plugins with PoEdit

text: As the title says: How would you translate...   * `_n()`   * `_n_noop()`   * `_nc()`   * `_nx()`   * `_nx_noop()` ...in your .mo files?


title: Front Page Settings

text: I'm setting up a WordPress site that has Flash puzzles embedded in the pages. (My site will have pages instead of posts). Each week I'll add a new puzzle to the site's Home page. When the site loads you'll see the newest puzzle. Older puzzles would be accessed through a dropdown menu. My question is how should I design the permalink structure? Under Reading Settings, I plan to set the Front Page to static. And select the latest puzzle as the front page. The problem is that if someone bookmarks the Home page, they'll get the latest puzzle. Let's say this week's puzzle (on the Home page) is called "Astronomy". The path to the Home page would be, for example, www.mysite.com. Imagine that someone is a Carl Sagan nerd and wants to link to the Astronomy puzzle. After the week is over, a new puzzle would be on the front page. The "Astronomy" puzzle's path would now be www.mysite.com/astronomy and would be accessed through the dropdown menu. Is there a way to avoid this problem? (Other than a blurb on the Home page with a link to the puzzle)? Sorry, if this is an idiotic question. But, maybe someone has a good solution. Thank you! -Laxmidi


title: Method Not Implemented GET to wp-admin/post.php not supported

text: When I save a draft post I get this error. It hasn't happened before, and it only happens with one post. We are using commercial hosting.


title: wp_enqueue_script calling jQuery at different times for different browsers?

text: This makes no sense, but in looking at my view source across browsers, `wp_localize_script()` is inserting tags as expected for all browsers other than IE7,8,9. The script tag is simply not there in those browsers. I have it bound to "jquery", since I want to make sure it's included no matter what (rather than binding it to any specific user-defined script). It's being called in my theme's functions.php file. The documentation for wp_localize_script seems to suggest that the script must be registered before calling this function. Given that the function is always being called at the same place, it seems that perhaps jQuery is being enqueued or registered at different times depending on browser? That seems very odd indeed, as WordPress doesn't natively do a lot of browser detection out of the box. I can get wp_localize_script working if I bind it to one of my custom enqueued scripts and make sure the function call is immediately after that script is enqueued. This is why I suspect it has something to do with the queueing order of jQuery. Can anyone suggest what might be going on here?


title: Forcing reload of editor-style.css

text: Is there a method to force the refresh of `editor-style.css`, when I change manually the stylesheet for the TinyMCE editor? Modification doesn't show immediately but they will be cached in the admin side of administration backend. For example like this:               editor-style.css?ver=3393201


title: Add custom field to image editor

text: How do I add **custom field** to the **image editor** , such as under the image ' **Description** ' field? To be much clearer, it's where the settings for the images are after you upload an image in the attachment pop-up window.


title: How to move all theme templates into a subfolder WP

text: I'm looking for a wordpress function to move theme's templates into a subfolder (mytheme/templates). Anyone know? The solution can be paid (plugin) or free.


title: Is there a good plugin for social bookmarking on site for WordPress

text: I want to add a onsite social bookmarking system to a WordPress installation. is there any thing like this available?


title: How to create an automatic MultiColoumn MegaMenu with Categories WordPress

text:
I'm looking for an easy to use step by step guide on how to create a MultiColoumn menu for categories on wordpress. Actually in my blog I have 10/12 "main" categories and a couple of them have something like 50 Sub-categories and I will add more so I need something Automatic to show them in my menu. Actually I have one but it is full of bugs. So I need something new please. This is my CSS (you can also write it from scratch, maybe it's better :P)               .videoCssMenucontainer {margin: 2px 0 0;}     UL.ws_css_cb_menu {background-color : #7F9DB9;width : 96%;margin:0 1.75% 10px 1.75%;font : bold 13px Arial, Helvetica, sans-serif;display : block;float : left;height : 33px;border-top-right-radius : 0;border-bottom-right-radius : 10px;border-bottom-left-radius : 10px;border-top-left-radius : 0;position:relative;z-index:10000;}     UL.ws_css_cb_menu LI {display : block;margin : 2px 0 0 2px;float : left;}     UL.ws_css_cb_menu A:hover UL, UL.ws_css_cb_menu A:hover A:hover UL, UL.ws_css_cb_menu A:hover A:hover A:hover UL {display : block;}     UL.ws_css_cb_menu A {display : block;vertical-align : middle;border-width : 0;border-color : #6655ff;border-style : solid;padding : 2px;color : #444444;text-decoration : none;text-align : left;}     UL.ws_css_cb_menu SPAN {overflow : hidden;}     UL.ws_css_cb_menu LI A:hover, UL.ws_css_cb_menu LI A {padding : 9px;color : #763319;}     UL.ws_css_cb_menum LI A:hover, UL.ws_css_cb_menum LI A {padding : 4px;font-weight : normal;color : #000;}     UL.ws_css_cb_menu UL {position : absolute;left : -1px;top : 98%;width : 160.65px;background-color : #ffffff;}     UL.ws_css_cb_menu UL UL {position : absolute;left : 98%;top : -2px;}     UL.ws_css_cb_menu, UL.ws_css_cb_menu UL {margin : 0;list-style : none;padding : 0 2px 2px 0;}     UL.ws_css_cb_menu A:active, UL.ws_css_cb_menu A:focus {outline-style : none;}     UL.ws_css_cb_menu UL LI {float : left;width : 150px;}     UL.ws_css_cb_menu UL A {white-space : nowrap;text-align : left;}     UL.ws_css_cb_menu LI:hover {position : relative;}     UL.ws_css_cb_menu LI:hover > A {background-color : #fff;color : #000;border-color : #665500;border-style : solid;text-decoration : none;}     UL.ws_css_cb_menu LI A:hover {position : relative;background-color : #fff;color : #000;text-decoration : none;border-color : #665500;border-style : solid;}     UL.ws_css_cb_menum LI A:hover {background-color : #ffc000;}     UL.ws_css_cb_menu IMG {border : none;float : left;margin-right : 4px;width : 16px;height : 16px;}     UL.ws_css_cb_menu UL IMG {width : 16px;height : 16px;}     UL.ws_css_cb_menu UL, UL.ws_css_cb_menu A:hover UL UL {display : none;z-index : 99999;}     UL.ws_css_cb_menu LI:hover > UL {display : block;}     UL.ws_css_cb_menu SPAN {display : block;padding-right : 11px;background-position : right center;background-repeat : no-repeat;}     UL.ws_css_cb_menu LI A TABLE, UL.ws_css_cb_menu LI A:hover TABLE {border-collapse : collapse;margin : -4px 0 0 -9px;border : 0 solid #000000;padding : 0;}     UL.ws_css_cb_menu LI A TABLE TR TD, UL.ws_css_cb_menu LI A:hover TABLE TR TD {padding : 0;border : 0 solid #000000;}     UL.ws_css_cb_menu LI A TABLE UL, UL.ws_css_cb_menu LI A:hover TABLE UL {border-collapse : collapse;padding : 0;margin : -4px 0 0 -9px;}     UL.videoCssMenu {font-size : 13px;width : 96%;margin:0 1.75% 10px 1.75%;background : #7F9DB9;color:#FFF;text-shadow: rgba(0, 0, 0, 0.398438) 1px 1px 1px;border : 0 solid #000000;}     UL.videoCssMenu .videoMenuTitleImage {margin : -2px 0 0 -2px;width : 79px;height : 30px;}     UL.videoCssMenu UL {left : 0;background-color : #857DA2;width : 430px;}     UL.videoCssMenu LI A {color:#FFF;text-shadow: rgba(0, 0, 0, 0.398438) 1px 1px 1px;padding: 5px !important;text-transform:uppercase;}     UL.videoCssMenu UL LI A {overflow: hidden; float:left;}     UL.videoCssMenu UL LI {width : auto;float : left;height : 27px;}     UL.videoCssMenu LI:hover > A, UL.videoCssMenu LI A:hover {background-color : #ffffff;border-radius : 5px;border-color : #fff;padding : 5px !important ;color : #000;}     UL.videoCssMenu LI UL LI:hover > A, UL.videoCssMenu LI UL LI A:hover {background-color : #ecb899;border-color : #fff;padding : 5px;color : #000;}     ul.ws_css_cb_menu ul ul ul{background:#ccc;color:#142E51;text-shadow:1px 1px 1px #000;}     ul.ws_css_cb_menu ul ul ul a{color:#142E51;text-shadow:1px 1px 1px #000;}     .ws_css_cb_menum LI {width:auto;height:20px;}      And this is my HTML/PHP:

Home

             Categorie
                 <?php wp_list_categories('sort_column=name&sort_order=name&style=list&children=true&hierarchical=true&title_li=0&dept=5&show_count=1&feed_image=/images/RSS.png'); ?>

             Pagine
                 <?php wp_list_pages('title_li='); ?>

             Hack

Proxy

Url Hider

HTML 2 bbCode Converter

             Seo

Pagerank

FREE Seo Services

Url Submitter

             Servizi CSS

CSS Button Generator

Favicon Generator

             Generatori Link Premium FREE

Supera il limite di Megavideo

Premium link generator

         <?php include('supsearch.php');?>
      I don't care about IE6 anymore, IE7 support will be enough, thank you to all for your help!


title: How to close wpdb connection?

text: Is there any method to close connection similar to mysql_close() for wpdb in wordpress? Is it not necessary to close connection for global wpdb?


title: Remove image in post when it's removed in media library

text: As the title says, I want to automatically remove a specific image in all posts where it's used when I remove the image from the media library. Because at the moment, if I remove an image from the media library the "empty image" stays in the post(so all the html code) but nothing is being displayed of course. Is there any way/plugin? Thanks in advance.


title: Redirect users on logout

text: Have multisite set up and would like to redirect users on logout to the root site home page. I know there has to be an answer for this. But I can't find it! driving me batty;-) Any help greatly appreciated.


title: Is the bulk_action hook stable for use in 3.2.X?

text: Working on a plugin for wp-ecommerce publish / unpublish all items in a category seems the cleanest place to implement this is in the categories page as a bulk action - though numerous google searches have turned up very little documentation and a series of posts on bug tracker so: Is it now safe to add a bulk_action-ID hook or should I make a custom sub- page in the admin? Thank you in advance


title: How to make user inactive by default while registering?

text: When user registers to my site I want to make them inactive by default so I can manually update their status and send them their login info. I am using wordpress 3.1.2. Is it possible? Are there any plugins for this? BTW, I am using Cimy User Extra Field plugin to add more fields to the registration page.


title: How do I add a menu item to a Pods admin menu?

text: I'm writing a plugin that will send a notification message to an external queue whenever a menu item is clicked. This function is related to some customized data structures I made using the Pods framework. I'd like to add the menu item under the sub-menu for a certain Pod. The Pod is named "spotlight." Currently the only items in there are "All Spotlights" and "Add New"... I'd like to add a third item below these two. In the code for my plugin, how do I add an additional menu item under this Pod's submenu?


title: jquery UI in wordpress admin

text: Does anyone have experience with using the jQuery UI plugins in the Wordpress admin area? I´ve been trying to use the datepicker functionality in jQuery UI, but its conflicting with the built- in jQuery in wordpress admin. http://docs.jquery.com/UI/Datepicker This is the error message I get in console:               Uncaught TypeError: Cannot read property 'apply' of undefined     a.widget.a.extend._trigger     b.Widget._createWidget     b.widget.b     b.widget.bridge.b.fn     c.extend.each     c.fn.c.each     b.widget.bridge.b.fn     postboxes.init     postboxes.add_postbox_toggles     (anonymous function)     c.extend.ready     L      What could I possibly do to avoid this conflict? Adding the code used to include the jquery:               wp_register_script( 'jquery-tooltip', 'http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js');     wp_register_script( 'jquery-ui-datepicker', get_bloginfo('template_directory') . '/js/jquery-ui-1.8.8.custom.min.js' );     wp_register_script( 'jquery-admin-internal', get_bloginfo('template_directory') . '/js/jquery.admin.internal.js' );     wp_register_script( 'jquery-internal', get_bloginfo('template_directory') . '/js/jquery.internal.js' );          function enqueue_admin_jquery() {     wp_enqueue_script('jquery-ui-datepicker');     wp_enqueue_script('jquery-admin-internal');     }     add_action('admin_init', 'enqueue_admin_jquery');


title: How to use Head JS with all enqueued scripts?

text: I want to load head js first and then all enqueued scripts into it's function. Like so...               <script src=">/js/head.load.min.js" type="text/javascript" charset="UTF-8"></script>          <script type="text/javascript">     head.js("/path/to/jquery.js", "/google/analytics.js", "/js/site.js", function() {             // all done          });     </script>      How would I do this? For those that don't know HeadJS is the 2.30KB script that speeds up, simplifies and modernizes your site... http://headjs.com/


title: how to use custom post types collectively integrated with each other

text: i will star with some back ground and my goal before i gt to the point i am trying to make a anime viewing website using wordpress like www.watchanimeon.com and www.animedreaming.tv i tried a couple of techniques like tiring to use custom fields to store data but of no avail as they all got way too complected for a little guy like me . _i use categories for the anime series and post for the episodes them selves but for the part where i wanted my sits users or members to be able to add mirror videos i got stuck i came up with the half solution of my problem with wordpress oembbed feature or though to useautoembed in my template but the area where i wanted the ablity of mirror videos i tried to use tdo mini forms but did not succeeded because of knowing no means of saving this data in the post it self_ then i came assross these wordpress custom post types and after the release of bbpress 2 it accord to me that if i could separate post types for series, episodes and mirrors (or videos) like in bbpress forums, topics and posts and have a series act like category then i will also be able to tag anime generas and the series will list the episodes associated with and every episode list the videos associated with it most of my work will be done but i cant find any way to do this as i told earlier that i am a little guy in the field don't know much about programming and learns by google so please help me plz plz and in any case any one of you still dont understand what i am trying to accomplish check this (http://www.watchanimeon.com/sket-dance-episode-30/) link thats what i want to be able to do and also look at the bbpress2 to see what i am trying to accomplish.


title: What is the best workaround for supporting all existing DATEs?

text: I want to make a weblog that has with every date 1 or more weblog posts, e.g.: **Januari 24 Year 41 : Roman Emperor Caligula was murdered by Cassius Chaerea and the disgruntled Praetorian Guards. Caligula's uncle Claudius was proclaimed emperor in his place.** or **Januari 1 Year 153 BC : Roman consuls begin their year in office.** or **Februari 1 Year 2038 : Humans survived** What would be the best way to do this in WordPress if I want to support URL hacking? p.s. custom fields + custom posts + custom taxonomy was the first thing I thought of but maybe there are better alternatives relying on the current date system. related: http://en.wikipedia.org/wiki/Unix_time#Representing_the_number


title: How can I access 'key' and 'value' from an array in a for loop?

text:
How can I change the for loop below so that I can assign the array's "key" value as the "value" for each input instead of the array's "option" value as I'm now doing (I still want to echo the array's "option" value as the label)?               $myradiooptions = array("grid1" => "Grid View (default)", "list1" => "List View (1 column)", "list2" => "List View (2 column)" );          $options = array (     array( "name" => "My Theme Options","type" => "title"), array( "type" => "open"),          array(  "name" => "Category Layout",          "desc" => "description goes here",          "id" => "my_category_layout",          "type" => "radio",         "options" => $myradiooptions ),              ...etc}          //switch, case "radio":     ?>
         <label class="left" for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>         <?php $count=1;foreach ($value['options'] as $option) { ?>         <input type="radio" name="<?php echo $value['id']; ?>" id="<?php echo $count; ?>" value="<?php echo $option; ?>" <?php checked($option, get_settings($value['id'])); ?>/><label style="color:#666; margin:0 20px 0 5px;" for="<?php echo $count; ?>"><?php echo $option; ?>       <?php $count++;} ?>         <?php echo $value['desc']; ?>
     <?php     break;


title: Replace wordpress login logo with custom text

text: I wanted to replace the wordpress logo which is displayed on login screen with some custom text. Here is the code what I tried so far:               function my_custom_logo() {     echo '<style type="text/css">     #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/wp-logo.png) !important; }';     }     add_action('admin_head', 'my_custom_logo');      It can replace the logo but what should I need to replace it with some text? Any suggestions to make it work?


title: "There doesn't seem to be a wp-config.php file." despite wp-config.php in root

text: I've encountered an odd problem and I'm not at all sure how to go about fixing it.. I have a site that was working fine until I changed a page title from "PRESS" to "BLOG." Now, when you visit the blog page, this error comes up: > There doesn't seem to be a wp-config.php file. I need this before we can get > started. Need more help? We got it. You can create a wp-config.php file > through a web interface, but this doesn't work for all server setups. The > safest way is to manually create the file. What's especially odd about this is, both wp-config.php and wp-config- sample.php are in the site root. Any ideas what's going on and how to remedy? Thank you.


title: Pagination not working Page2 Not Found

text:
I'm newbie at php and wp. I'm using query_posts and custom post type. But doesn't work pagination link and says page 2 "Not Found". Searched from Google too many hours but not found any resolution. Hope you help me. Thanks. My Loop:               <?php             $args = array(                 'posts_per_page' => 3,                 'post_type' => 'movie'             );             query_posts($args);             if ( have_posts() ) : while ( have_posts() ) : the_post();         ?>
                 <a href="<?php the_permalink() ?>">                          <?php the_post_thumbnail( array() ); ?>                              <?php the_title(); ?>
                         <?php if( get_field('movie_translation') ): ?>                             <?php the_field('movie_translation'); ?>                         <?php endif; ?>

                         <?php $terms = wp_get_post_terms($post->ID,'movie_category');                             $count = count($terms);                             if ( $count > 0 ){                             echo "";                             foreach ( $terms as $term ) {                             echo $term->name . "<comma class='genres-term'>, </comma>";                             }                             echo "";}                          ?>

              <?php endwhile; else: ?>
<?php _e('Sorry, Not found.'); ?>
         <?php endif; ?>
         <?php wp_pagination(); ?>      Function:                   /* WP custom numeric pagination */     function wp_pagination() {         global $wp_query;         $big = 12345678;         $page_format = paginate_links( array(                 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),                 'format' => '?paged=%#%',                 'current' => max( 1, get_query_var('paged') ),                 'total' => $wp_query->max_num_pages,                 'type'  => 'array'         ) );         if( is_array($page_format) ) {             $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged');             echo '

';             foreach ( $page_format as $page ) {                 echo "
$page
";             }                 echo '

';             }         }


title: GET user's metadata, list it in descending order and GET user's list number

text: I have a custom user metadata with meta_key _reputation_. The value is numeric. It is like a points system. The higher value the user has, the higher _reputation_ they have. How do I GET where each user ranks. I want to GET the number of which the user ranks to others. Browsing the database, all I need to do is to list the value in a descending order and I can see who is ranked at 1 (has most points) and so on... Is there any way I can show the rank number to the user?


title: Can't add custom Taxonomy to Custom Post Type

text: I am unable to add taxonomy to custom post types. But for same code if I add 'post' or 'page' it shows up fine. I can't pinpoint the problem. Here is the code. To register custom post type - working fine _register_taxonomy($key, 'SH_job_listings', $value);_ if i replace 'SH_job_listings' with post or page it works fine but not for custom post type i created.               class SH_job_post_class{              public function  __construct(){             $this->register_job_Listings();             $this->add_taxonomies();              }              public function register_job_Listings(){             $args = array(                 'labels' => array(                     'name' => 'Job Listings',                     'singular_name' => 'job Listing',                     'add_new' => 'Add New Job',                     'add_new_item' => 'Add New Job',                     'edit_item' => 'Edit Jobs',                     'new_item' => 'New Item',                     'view_item' => 'View Item',                     'search_item' => 'Search Jobs',                     'not_found' => 'No Job Found',                     'not_found_in_trash' => 'No Job Found In Trash'                 ),                 'query_var' => 'job',                 'rewrite' => array(                     'slug' => 'jobs/'                 ),                 'public' => true,                 'menu_position' => 5,                 //'menu_icon' => admin_url().                 'supports' => array(                     'title',                     'thumbnail',                     'editor',                     'custom_fields'                 )             );                  // This function is actually registering post type             register_post_type('SH_job_listings', $args);         }              public function add_taxonomies(){             $taxonomies = array();                  $taxonomies['job'] = array(                 'hierarchical' => true,                 'show_ui'  => true,                 'show_admin_column'=> true,                 'query_var' => 'job_type',                 'rewrite' => array(                     'slug' => 'job/job_type'                 ),                 'labels' => array(                     'name' => 'job type',                     'singular_name' => 'Job Type',                     'edit_item' => 'Edit Job Type',                     'update_item' => 'Update Job Type',                     'add_new_item' => 'Add  Job Type',                     'new_item_name' => 'New Job Type',                     'all_items' => 'All Job',                     'popular_items' => 'Popular Job Types',                     'search_items' => 'Search Job Types',                     'separate_items_with_commas' => 'Separate Job Types with commas ',                     'add_or_remove_items' => 'Add or Remove Job Type',                     'choose_from_most_used' => 'Choose from most used Job Type'                      )             );             $this->register_all_taxonomy($taxonomies);              }         public function register_all_taxonomy($all_taxonomy){                  foreach($all_taxonomy as $key => $value){                 register_taxonomy($key, 'SH_job_listings', $value);             }              }          }          add_action('init', function(){         new SH_job_post_class();     });


title: changing the default picture size link url

text: when i'm inserting a single picture thumbnail from the gallery with a link to the original picture, it gives me this:                     but i want it to check if there is a smaller version of the large picture (like a 1024x1024 witch is an image_size of mine) and if there is echo this (pat attention to the file name at the end of the href attribute:                     if there isn't a file in that size, echo the usual. anybody knows how do to this? the reason i'm looking for it, is because i don't want my clients to start resizing images from his digital camera. up until now if i'm not resizing the picture the file will be maximum size, witch in most cases is 4600x3400 or something like this (ths is whats coming out from the digital cameras by default). anyone? thanks.


title: Fix encoding â€™

text: I moved my hosting provider and now the encoding is messed up. See here for example. In the past commenting out the follwoing lines fixed the issue for me, but not this time: > //define('DB_CHARSET', 'utf8'); > > //define('DB_COLLATE','utf8_unicode_ci'); The hosting provider is saying I need to set it to the correct encoding rather than just comment it out, but I'm unsure what encoding that would be. Example Text: > Youâ€™ll be in good company. Join our network of leading RC sponsors that > have help support the growth of HeliReviews.


title: new to javascript - using in <head> instead of functions.php, not loading correctly

text: Live site. I've decided to incorporate javascript in my new theme; this is my first time doing so and have pieced together what I've down with help of blog posts and forums. I have the javascript within the tag instead of in functions.php. I've noticed the site ceases to load after the navigation which is controlled by javascript which leads me to believe that is where the problem is, I just don't know exactly how to pinpoint exactly what's causing the trouble. Any help sorting this out is greatly appreciate.               <!DOCTYPE html>     <html>     <head>             <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />             <meta name="generator" content="Wordpress <?php bloginfo('version'); ?>" />             <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />             <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>             <link rel="pingback" href="<?php bloginfo('pingback url'); ?>" />             <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />             <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" />             <link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?>/favicon.ico" />             <?php wp_head(); ?>             <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>             <script>                 $(window).load(function(event) {                     $('#Nav a').click(function() {                         $('#Nav li').removeClass();                         $(this).parent().addClass("current");                                                           });             </script>             <script type="text/javascript">                     var _gaq = _gaq || [];                     _gaq.push(['_setAccount', 'UA-32783537-1']);                     _gaq.push(['_trackPageview']);                          (function() {                     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;                     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';                     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);                     })();             </script>             <script>                     $(document).ready(function() {                       function filterPath(string) {                       return string                         .replace(/^\//,'')                         .replace(/(index|default).[a-zA-Z]{3,4}$/,'')                         .replace(/\/$/,'');                       }                       var locationPath = filterPath(location.pathname);                       var scrollElem = scrollableElement('html', 'body');                            $('a[href*=#]').each(function() {                         var thisPath = filterPath(this.pathname) || locationPath;                         if (  locationPath == thisPath                         && (location.hostname == this.hostname || !this.hostname)                         && this.hash.replace(/#/,'') ) {                           var $target = $(this.hash), target = this.hash;                           if (target) {                             var targetOffset = $target.offset().top;                             $(this).click(function(event) {                               event.preventDefault();                               $(scrollElem).animate({scrollTop: targetOffset}, 400, function() {                                 location.hash = target;                               });                             });                           }                         }                       });                            // use the first element that is "scrollable"                       function scrollableElement(els) {                         for (var i = 0, argLength = arguments.length; i <argLength; i++) {                           var el = arguments[i],                               $scrollElement = $(el);                           if ($scrollElement.scrollTop()> 0) {                             return el;                           } else {                             $scrollElement.scrollTop(1);                             var isScrollable = $scrollElement.scrollTop()> 0;                             $scrollElement.scrollTop(0);                             if (isScrollable) {                               return el;                             }                           }                         }                         return [];                       }                          });             </script>             <script>                     $(function() {                         $.fn.scrollBottom = function() {                             return $(document).height() - this.scrollTop() - this.height();                         };                              var $el = $('#nav>div');                         var $window = $(window);                         var top = $el.parent().position().top;                              $window.bind("scroll resize", function() {                             var gap = $window.height() - $el.height() - 10;                             var visibleFoot = 340 - $window.scrollBottom();                             var scrollTop = $window.scrollTop()                                  if (scrollTop < top + 10) {                                 $el.css({                                     top: (top - scrollTop) + "px",                                     bottom: "auto"                                 });                             } else if (visibleFoot > gap) {                                 $el.css({                                     top: "auto",                                     bottom: visibleFoot + "px"                                 });                             } else {                                 $el.css({                                     top: 0,                                     bottom: "auto"                                 });                             }                         }).scroll();                     });             </script>     </head>


title: Help me edit a variable with php

text: I'm using the plugin Multiple Content Blocks, which creates separate windows for content so that you can have, say, a 2-column template for a page; one column is editable in the standard TinyMCE window and below it is a second TinyMCE window where you can add/edit the content for the second column. What's nice is that you can work on the page in one place instead, for example, making the second column a "sidebar" and then going to the widgets page and using a Text Widget. I primarily design templates for business sites as opposed to blogs and most of the time content in additional columns aren't widgets. To create the second window you place this in the template:               <?php the_block('blockname'); ?>      You name the block something, of course. It's nice and simple and there's only 2-3 pages of code with the plugin so it's light. The only drawback is that you have to create a separate template for each page that uses a content block. But, the developer has in his readme.txt the following: "Use the function get_the_block instead of the_block, like this:                <?php $content_to_edit = get_the_block('blockname'); ?> and you can now edit this variable with PHP."      What I would like to be able to do is use one template; specify something to the effect of : if this page, use this block - but I don't know how to write it or even if it is possible. I don't know if I'd have to add something to the functions page as well. Can anyone advise? BTW I wrote the plugin developer who replied that he doesn't provide support for the plugin and good luck.


title: User registration problem in WordPress

text:
I am trying to make a user registration form in my site's side bar. Users are able to register but instead of getting a success message, WordPress usually redirect them to 404 page. Below is my form:               <form id="joinmaillist"   method='post'>

                 Name	                 <input type="text" placeholder="Your name here.." name="name" title="Please enter your name" required/>

                 Email	                 <input type="email" name="email" placeholder="Your email here.." required/>

                 	                 <input class="submitmail" type="submit" value="Join!" name="joinm"/>

     </form>      and below is my PHP code:               <?php     if (isset($_POST['joinm'])){         $user_name=$_POST['name'];         $email =$_POST['email'];               $user_id=  username_exists($user_name);              if (!$user_id){             $random_pass = wp_generate_password(12, false);             $user_id=wp_create_user($user_name, $password, $email);             header('Location:' . $_SERVER['REQUEST_URI']);         }else{              }     }