title: How do I secure a subdomain using UCC SSL?

text: I have a UCC SSL Certificate installed on my primary domain (example.com). I have 3 subdomains listed as Subject Alternative Names (SANs) (shop.example.com, distributors.example.com and careers.example.com). Currently, I'm working on the shop subdomain. I installed the Wordpress HTTPS (SSL) plugin, but when I try to go to say, (link 1) https://shop.example.com, it redirects to (link 2) https://example.com. I cannot for the life of me figure it out. I tried changing the WordPress Address (URL) and Site Address (URL) in General Settings to https instead of http and at least it didn't redirect me to login to the example.com, but directly typing in (link 1) still directed me to (link 2). Also, that created another problem.....none of my media would show. I have "Googled" for days and cannot find a solution.


title: Looking for a PayPal donation plugin similar to JoomDonation

text: http://joomdonation.com/index.php?option=com_content&view=article&id=23&Itemid=12 I'm creating a non-profit website for a very big charity, and I'm ~~looking~~ NEEDING a plugin to handle donations via PayPal. I've been searching for over 2 days, nearly 8 hours straight for a donation plugin that connects to Paypal to get a balance toward a goal, and has a customizable "Goal" image so they can use their own images. I'd like it to also be able to show the latest donators (Possibly all of them if needed) so they can give credit where it is due. (They sometimes run contests involving the donators, so it would need to keep track of all the donators) I've tried nearly everything, but the only thing that even comes remotely close is a Joomla extension. I don't care if I have to have 2-3 different plugins to get it working, but it needs to be automated, so no manual updating of the goals to make it work. I'm really out of ideas to find anything.... I'm open to Commercial plugins, as long as it has my needs.


title: wp_editor in thickbox

text: I am updating a shortcode generator that I made before and I want to add in addition to text areas inputs etc.. a tinymce editor, so I call wp_editor in the ajax content of the thickbox, the editor appears but without any buttons and when switching to visual tab I get this error               Uncaught TypeError: Cannot read property 'canvas' of undefined load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,jqu…:46      any ideas?


title: how to show perticular category posts in custome page

text: i know how to define custom post template vai plugins very easily but i want without plugins how can i define custom post template for particular category post. say like i have one category "members" under this category have ten post. so i want when show those member post that time show custom template. see bellow code from twentytwelve theme category.php file               <?php                 /* Start the Loop */                 while ( have_posts() ) : the_post();                          /* Include the post format-specific template for the content. If you want to                      * this in a child theme then include a file called called content-___.php                      * (where ___ is the post format) and that will be used instead.                      */                     get_template_part( 'content', get_post_format() );                      endwhile;                      twentytwelve_content_nav( 'nav-below' );                 ?>                  <?php else : ?>                 <?php get_template_part( 'content', 'none' ); ?>             <?php endif; ?>       see in above code say `get_template_part( 'content', get_post_format() );` and see `get_template_part( 'content', 'none' )` now i want when "members" category post will open it will one custom page.. like `content-members.php` file, so i think code will be like that `get_template_part( 'content', 'members' )` so how can define in category page members category post will open content- members.php file


title: local WAMP admin user has lost privileges

text: I have a Wordpress 3.4.1 installed on a local WAMP server. I am in the process of upgrading it to a network, but I now realise my admin account has no admin privileges:   1. No access to the Updates page (update-core.php) - I receive "You do not have sufficient permissions to access this page."   2. No ability to install plugins.   3. No ability to edit users.   4. No ability to go to Tools > Network Setup - same error as above.     * The **wp_capabilities** of my user account is **a:1:{s:13:"administrator";b:1;}**     * The **wp_user_level** is **10** What is wrong here? **Update** \- I added another admin account using PHPMyAdmin following this tutorial, but I receive the same symptoms for this 2nd admin account.


title: limit posts per page

text:
I am working with category.php. I have my posts returning how I want them, I am getting the child categories how I want them but now I am trying to add pagination and limit the amount of posts to 3. When I ran my test, the 4th post showed up on the page. I was expecting only 3 and the pagination at the bottom. I am not sure what is wrong. According to the codex, this should be working.                $allcats = get_categories('child_of='.get_query_var('cat'));      foreach ($allcats as $cat) :     $args = array(      'category__in' => array($cat->term_id)     );          $customInCatQuery = new WP_Query($args);           if ($customInCatQuery->have_posts()) :      echo '
';                  $terms = apply_filters( 'taxonomy-images-get-terms', '' );             if ( ! empty( $terms ) ) {             foreach( (array) $terms as $term ) {                     if($term->term_id == $cat->term_id) {                       echo wp_get_attachment_image( $term->image_id, 'menu' );                     }             }             }          echo '
'.$cat->name.'
';     echo '
';         while ($customInCatQuery->have_posts()) : $customInCatQuery->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
           <?php      endwhile;       echo '

';            ?>           <?php else :       echo 'No post published in:'.$cat->name;                      endif;       wp_reset_query();      endforeach;            ?>       <?php if ( $wp_query->max_num_pages > 1 ) : ?>
<?php next_posts_link( __( '← Older posts', 'paradiso' ) ); ?>

<?php previous_posts_link( __( 'Newer posts →', 'paradiso' ) ); ?>
         <?php endif; ?>


title: Missing thumbnails

text: For all the pics I upload to Wordpress I get such a link to the pic:               src='http://myblog.com/wp-content/themes/mytheme/thumb.php?src=wp-content/uploads/2012/06/mypic.jpg&w=100&h=100&zc=1&q=90'      Anf ofcourse Wordpress does not find it. But if I change to with the firebug:               src='http://myblog.com/wp-content/uploads/2012/06/mypic.jpg'      Wordpress displays the picture. Where I should look for the problem? Thanks.


title: wp.media upload PDF Thumbnails

text: I am using PDF Thumbnails to create jpgs from uploaded pdf. The newly created jpg is not showing in the media library until the media manager is closed and reopened. How can I get the new jpg to show as a selectable object in the media library after it is uploaded? This is how I call the wp.media.frame:               $('body').on('click', '.manage-media', function() {//Manage Media button                 if ( $(this).attr('data-gp-multiple') == 'false' ){             field.multiple = false;          } else {             field.multiple = true;         }         field.mediatype = $(this).attr('data-gp-mediatype');         field.name = $(this).attr('data-gp-name');         field.id = $(this).attr('data-gp-id');         input = $(this).parents(".gallery_meta_box_parent");         var media_id = $(input).val();         var frame = wp.media({                     title : "Pick your "+field.name+" for this Gallery",                     multiple : field.multiple,                     library : { type : field.mediatype},                     button : { text : "Insert" },                     stack: false             });                  frame.on("close",function() {                 console.log('close');             }                  frame.on("open",function() {                 selection = frame.state().get("selection");                  ids = $(input).val().split(",");                 ids.forEach(function(id) {                     attachment = wp.media.attachment(id);                     attachment.fetch();                     selection.add( attachment ? [ attachment ] : [] );                 });             });             frame.open();     });


title: Output yearly archive within a page

text:
I've almost got what I want working from cobbling bits but I need a bit of help finishing it up. What I'm trying to do is output the following (for a custom post type) within a page template (not a separate archive page):

2014

12 September 2014
             "Post title 1

11 August 2014
             "Post title 2

10 May 2014
             "Post title 3

2013

20 June 2013
             "Post title 4

19 April 2013
             "Post title 5

18 January 2013
             "Post title 6

      The code I've got so far looks like this:               <?php     $years = $wpdb->get_results( "SELECT YEAR(post_date) AS year FROM wp_posts WHERE post_type = 'press-releases' AND post_status = 'publish' GROUP BY year DESC" );          foreach ( $years as $year ) {         $posts_this_year = $wpdb->get_results( "SELECT post_title FROM wp_posts WHERE post_type = 'press-releases' AND post_status = 'publish' AND YEAR(post_date) = '" . $year->year . "'" );              echo '
';         echo '

' . $year->year . '
';         foreach ( $posts_this_year as $post ) {             echo '
' . $post->post_title . '
';         }         echo '
';         echo '
';     }     ?>      Which is the basics of what I want. However, I also need to wrap the post title in the permalink and output the the date the post was published. I'm sure it's a simple fix but I don't know how to do it. Any ideas or is there a better way to do what I'm trying to achieve? Any input appreciated, thanks!


title: Changing a link to be translatable in WPML String translation (example included)

text: I have an specific example. This Title "Filme" / $title in the Sidebar Widget should link to another site - yet be translatable. "Filme" shows up in the String Translation but does not translate. Therefore I want to make it translatable, changing the code. (see widget in right side bar: http://www.rasmus-sievers.de/WordPress_02/film/alles-was-wir-wollen/) ORIGINAL code:                   if ( !empty( $title ) )      {echo $before_title . $title . $after_title;};      MY CODE (entered the link, works but not translatable)               if ( !empty( $title ) )      {     echo $before_title;      echo 'Filme ';      echo $after_title;     };      MY TRIAL (which had the php file crash):               if ( !empty( $title ) ) {      echo $before_title;     echo '< ?php _e( 'Filme', 'mthemelocal'); ?>'     echo $after_title;     }


title: Get custom post type slug for an archive page

text: How do I discover the custom post type slug when I'm on an archive page? For instance if `/products/` fires the `archive-products.php` template, how (pragmatically) do I get the post type slug? Thanks


Would anyone happen to know why I keep getting the error: "The URL does not appear to reference a valid XML file. We encountered the following problem: Error on line 163: The entity "raquo" was referenced, but not declared." When I put CmChatLive.com into feedburner? http://feedburner.google.com/fb/a/addfeed I am unable to edit the output of that title entity.


title: Meta Box value not been pulled in

text:
Here is the code that creates my metabox on my CPT named clients it displays fine and seems to keep the value input upon clicking update. The problem is with displaying the value saved within the metabox on a page. I've tried outputting the data both within a loop and out the loop switching between `get_the_ID() and $post_id` I've tried debugging with `<?php var_dump($link); ?>` which displays this on the frontend `string(0) ""` To output the meta box value in the loop I'm doing               // Get Meta data     $link = get_post_meta(get_the_ID(), 'link_url', true); ?>
<a href="<?php echo $link; ?>"><?php the_post_thumbnail('clients'); ?>
      Meta box Code               /**          * Adds a box to the main column on the Post and Page edit screens.          */         function portfolio_link_add_meta_box() {              $screens = array( 'clients' );              foreach ( $screens as $screen ) {                  add_meta_box(                 'portfolio_logo_link',                 __( 'Logo Link', 'logo_link_textdomain' ),                 'logo_link_meta_box_callback',                 $screen             );         }     }          add_action( 'add_meta_boxes', 'portfolio_link_add_meta_box' );          function logo_link_meta_box_callback( $post ) {              // Add an nonce field so we can check for it later.         wp_nonce_field( 'logo_link_meta_box', 'logo_link_meta_box_nonce' );              /*          * Use get_post_meta() to retrieve an existing value          * from the database and use the value for the form.          */         $value = get_post_meta( $post->ID, 'link_url', true );              echo '';         _e( 'Add The Logo Link', 'link_logo_textdomain' );         echo ' ';         echo '<input type="text" id="link" name="link" value="' . $value . '" size="25" />';     }          /**      * When the post is saved, saves our custom data.      *      * @param int $post_id The ID of the post being saved.      */     function logo_link_save_meta_box_data( $post_id ) {              /*          * We need to verify this came from our screen and with proper authorization,          * because the save_post action can be triggered at other times.          */              // Check if our nonce is set.         if ( ! isset( $_POST['logo_link_meta_box_nonce'] ) ) {             return;         }              // Verify that the nonce is valid.         if ( ! wp_verify_nonce( $_POST['logo_link_meta_box_nonce'], 'logo_link_meta_box' ) ) {             return;         }              // If this is an autosave, our form has not been submitted, so we don't want to do anything.         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {             return;         }              // Check the user's permissions.         if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {                  if ( ! current_user_can( 'edit_page', $post_id ) ) {                 return;             }              } else {                  if ( ! current_user_can( 'edit_post', $post_id ) ) {                 return;             }         }              /* OK, it's safe for us to save the data now. */              // Make sure that it is set.         if ( ! isset( $_POST['link'] ) ) {             return;         }              // Sanitize user input.         $my_data = sanitize_text_field( $_POST['link'] );              // Update the meta field in the database.         update_post_meta( $post_id, 'link_url', $my_data );     }     add_action( 'save_post', 'logo_link_save_meta_box_data' );


title: How to run scripts when a new blog is created in Buddypress?

text: I'd like to insert some mysql data into every new blog that's created on my buddypress system. How can I hook up to the newly created blog data? ID, for example, would allow me to insert it right from the PHP. Is there a better way to do it? Thanks!


title: Include files in child themes, declare in functions.php

text: I'm using a child theme. I want to make a change to a file which currently resides in: > mybasetheme>includes>sf-content-display>sf-post-layouts.php So I copied the exact same file structure into my child theme and copied the file over: > mychildtheme>includes>sf-content-display>sf-post-layouts.php But it still defaults to the base theme version? Because it's in _includes_ I wondered if it was to do with the functions.php file calling it. So I created a new `functions.php` file in my child theme as follows:               <?php          // Functions specific to child-theme          require_once( get_stylesheet_directory() . '/includes/sf-content-display/sf-post-formats.php' );      But now I see that will never work as the base theme functions.php already calls it:               >include(SF_INCLUDES_PATH . '/sf-content-display/sf-post-formats.php');      So I get this error: > Cannot redeclare sf_get_post_media() (previously declared in > /Applications/MAMP/htdocs/syyco/wp-content/themes/flexform- > child/includes/sf-content-display/sf-post-formats.php:15) in > /Applications/MAMP/htdocs/syyco/wp-content/themes/flexform/includes/sf- > content-display/sf-post-formats.php on line 36 So what do I do? I can't make the child theme include my new file, without editing the base theme, which ruins the point of having a child theme at all


title: Using _e() on text inside video tags prints that text, instead of only showing when html5 <video> element is not supported

text: I'm creating a wordpress theme in which I'm creating a shortcode for a video. Part of the output of this shortcode is something like this:                  $result .= '<video class="fullWidth" width="auto" height="auto" loop muted preload>';         $result .= '<source src="'.$mp4.'" type="video/mp4" />';         $result .= '<source src="'.$webm.'" type="video/webm" />';         $result .= '<source src="'.$ogv.'" type="video/ogv" />';         $result .= _e('Video tag is not supported in your browser.', 'my-theme-framework');        $result .= '</video>';      Now the video is working but the text 'Vide tag is ...' is getting echoed out, but when I remove the text from the function, it gets hidden. So I believe it is because of the _e() function and I do not know what to do. I need that to make the text translation ready, should I remove it? I've searched around for this, but I'm getting no relevant results. Please tell me if you know what I should do here. Thank you.


title: Custom data retrieval through simple search

text: Ok, here is what I would like to do. I have three fields First name, Last name and date of birth I already created a table in wordpress db called nameSearch with those 3 fields I also imported all data through a csv import to mysql - to that table. I need a simple form that has simple search box for, say first name and a search button. When user clicks on Search button after putting in few characters or the entire full First Name, then matching result(s) should display in the page. It can either be displayed as table or inline text If some one can either explain the technique or share a simple piece of php code that would be awesome. Thank you so much you guys! PS: I understand programming, so feel free to be simple in answering. i just need to know how to do it in PHP/wordpress. Best wishes, Senthil


title: Using user_status in conditional with get_users to return existing users

text: I'm working on a plugin needing to return avatars a specific way. If the user exists in the wp_users table the code is run else a different set of code is run if the user is not in the wp_users table. I cannot use the username_exist and am tinkering now with the idea of using the user_status value of 0. From the Codex, code is possible to return information based on the user_status                       $blogusers = get_users('user_status=0');             foreach ($blogusers as $user) {                 echo '<li>' . $user->user_email . '</li>';             }      This returns the email address for the users in the wp_users table. But I want to use a conditional ... The following works on a local development server in which $id is 1. But not everyone using the plugin will have just this one user id ...                       if ( $id == '1' ) {                   // echo 'User ID is ' . $id;                  // Do something here              } else {                  // the user is not in WordPress do something cool                 }      How can I use the user_status in a conditional to check if the user_status is 0 then do something else run the code the user not being in the WP users table. In other words, how can I write a conditional to check user_status = 0?


title: Redirect loop when forwarding to mobile site

text: I have successfully redirected my page to _m.example.com_ from _example.com_ when i open in mobile environment with this code in _functions.php_               add_action('template_redirect', 'redirecting_to_mobile_site');     function redirecting_to_mobile_site(){     $requri = $_SERVER['REQUEST_URI'];           if( wp_is_mobile() )      {       $redcont = "http://m.example.com".$requri;       wp_redirect( $redcont, 301 ); exit;      }     }      I also created a sub-domain through WP sub-domain plugin. But when I click any link from index page it says " **This page has redirect loop** " Please advise how to enable sub-domain for internal pages. Thank you.


title: Custom Login iframe doesn't work

text: I have a custom login window that I am building. The client requires a modal window for the login, so I have to use HTTP (for performance) for the regular page, and HTTPS for the login window (in the iframe for security), because of this, I get the error: > Refused to display 'https://www.wordpress.com/wp-login.php' in a frame > because it set 'X-Frame-Options' to 'SAMEORIGIN'. I'm sure that this is a security feature so people can't iframe the wp- login.php page, but I want to remove it so this login will work properly. Is there anyway to remove the `'SAMEORIGIN' protection` for the wp-login.php page? Any help will be greatly appreciated.


title: Add custom class to a tags

text: I want to create a plugin that adds specific class to all a tags.


title: some posts being displayed as pages

text:
Some posts I make (in the same category) are acting as pages, they open as page templates. I have the following in my `single.php`
                <?php           while (have_posts()): the_post();           $more = 0;              // the_title();              the_content('READ MORE');           endwhile;           ?>
       and `page.php`
                 <?php                  while (have_posts()): the_post();           $more = 0;              // the_title();              the_content('READ MORE');           endwhile;                  ?>
       Any idea why?


title: MySql Query very slow

text: I have a problem with a query on my website. When I load the page it is incredibly slow and only after over 12 seconds the content starts showing. I have installed a debug plugin and found the query that takes so long. The output of the plugin is the following:      > Time: 12,315.2ms (12.315196037292s) Query:               SELECT SQL_CALC_FOUND_ROWS meruca_posts.ID      FROM meruca_posts      WHERE 1=1      AND (         meruca_posts.ID NOT IN (             SELECT object_id             FROM meruca_term_relationships             WHERE term_taxonomy_id IN (14)         )     )     AND meruca_posts.post_type = 'post'      AND (         meruca_posts.post_status = 'publish'          OR meruca_posts.post_status = 'private'     )     GROUP BY meruca_posts.ID ORDER BY meruca_posts.post_date DESC LIMIT 0, 10      Function: `WP_Query->get_posts()` (`meruca_` is my table prefix) I have only basic understanding of mysql and can't really see, what may cause this to take so long. If anybody has an idea what I could change it would be much appreciated. There are about 5k posts on the site right now which isn't too many and it is running on a dedicated server that should have much more than sufficient resourced for any query theoretically.


title: Need some help with tweaking a code for woocommerce

text:
I have this code to show custom text in the categories i choose.               <?php if (is_product_category('furnitures')) : ?>
This is the text to describe category A
     <?php elseif (is_product_category('kitchen')) : ?>
This is the text to describe category B
     <?php else : ?>
This is some generic text to describe all other category pages,      I could be left blank
     <?php endif; ?>      How can i make the text to also be shown in the subcategories of each parent. In the above code are "furnitures" and "kitchen" the parent and have some subcategories. Thanks!


title: Getting an alphabetic post list with two letters onclick on letter

text: I have a website in `Wordpress` and a page with a list with letters like this:               A B C D E F G H I ...      This shows me all posts with the letter A for instance. That's nice, but I want it to make it easier for my users, so I want to get `Ab` and all of the posts starting with Ab if I click on `A`, beneath this list. Another example: I want to get `Dc` and all of the posts starting with the letters Dc if I click on `D`. I know that this is possible by making 26 pages containing the letters and the functions, but there must be a simpler way to do this. Besides, I don't want 26 pages for such a simple thing. It would affect the `SEO`. Can someone help me out with this?


title: keep two blogs under the same domain

text: I am thinking about starting a self hosted wordpress blog. Currently, I own a blogger blog, written in portuguese. I'd like to have a blog about technology written in english at a domain, like http://example.com, and my old portuguese blog transfered to http://example.com/portugueseblog or something like this. From what I've gathered, it's possible to import blogger blogs to wordpress. But how do I import it to this specific url, while still being able to write in the main blog? Thanks in advance.


title: Find only those galleries with images

text: Is there a way in Wordpress to use WP_Query and retrieve posts/galleries that have more than 0 metavalues with the key _gallery_image_ids. Essentially I don't want to display galleries that have no images.


title: How to use this $tax_selection variable in this custom loop?

text:
I took this code from this question (which shows how to let users choose which posts to display by choosing categories and tags): Filter index page plugin **function.php**               add_action( 'pre_get_posts', 'do_user_post_selection' );          function do_user_post_selection( $query ) {              if( !is_home() || !is_user_logged_in() )             return;              if( isset( $query->query_vars['post_type'] ) && ( 'nav_menu_item' == $query->query_vars['post_type'] ) )             return;          if( 1 < did_action('wp') )             return;         global $current_user;              $tax_selection = get_user_option( 'taxonomy_selection', $current_user->ID );              if( empty( $tax_selection ) )             return;              if( isset( $tax_selection['categories'] ) && ( is_array( $tax_selection['categories'] ) ) && ( !empty( $tax_selection['categories'] ) ) )              $query->set( 'category__in', $tax_selection['categories'] );         if( isset( $tax_selection['post_tag'] ) && ( is_array( $tax_selection['post_tag'] ) ) && ( !empty( $tax_selection['post_tag'] ) ) )              $query->set( 'tag__in', $tax_selection['post_tag'] );              return;     }      I have the following in the template of my front page: **front-page.php**                     <?php // Create and run custom loop               $custom_posts = new WP_Query();               $custom_posts->query('post_type=topic&posts_per_page=5');               while ($custom_posts->have_posts()) : $custom_posts->the_post();           ?>  <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

             <?php endwhile; ?>
      How to use the value in `$tax_selection` in my custom loop?


title: How to Keep footer link remain intact?

text: I'm a Wordpress Theme Designer. I want to have functions to make my footer links remain intact. Like some themes that use this method to protect their footer link from the theme downloaders to remove it. If they alter, change, or deltete parts or all, they will get an error! Any step by step guide or source would really appreciated! Thanks so much! Regards, Thy


title: How to insert images into posts without using Add Media dialog

text: I want to simplify the process of inserting images when editing posts. In wordpress default, you have to click "Add Media" to show a popup dialog, upload images, choose from gallery.. it is too complicated. My desired process is:   1. Click "Add Image" to show a dialog   2. Click "Choose File" and pick an image from your computer   3. Click "Upload" and wait for the file to be uploaded. Then image is inserted into post automatically As an example, my desired process is just like the insert image button in the wordpress.stackoverflow.com rich text editor, you can click to see it (Sorry but I am not allowed to post images here) I know stackoverflow upload images to a third party provider, but I want to use my own wordpress installation. Also, I don't care the Media management section (wp-admin/upload.php), I probably will remove it from admin panel. My question is: How can I implement a simplified upload images process in Wordpress? Any plugin available?


title: Show uploaded images in full size

text:
I have a very simple template where I am showing images. The code looks like this:               <?php      /*     * Template Name: Portfolio     */      ?>           <?php get_header(); ?>

                  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                  <?php                   the_content();                  ?>                  <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
             <?php endif; ?>

            <?php get_footer(); ?>      The problem is that when I upload my images in the editor, they become much smaller than they actually are (on the page). I control their size by setting `max-width: 100%` in my css already, so I don't want WordPress to limit the size. How can I remove this?


title: What's the right way to share data between widgets?

text: I've got a few custom widgets in my site, which I'm targeting to specific tags. There may be a case where there may be an overlap in widget targeting, and the desirable behaviour may be to only show the first of the widgets that match to that section or tag. Therefore, when a match occurs and the widget is to be displayed, I need to set a variable to indicate to the other widgets that are in that 'set' not to display anything. The obvious, but hacky, way to do this would be with a global variable, but this feels wrong. So I am hoping the Gods of Wordpress have a proper WP way to do it. Am I right?


title: wp_logout_url($redirect) won't logout and redirect ()

text: Even that I got the code from the wp docs               <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Logout      This is the output when user clicks on it:               Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-login.php on line 368          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-login.php on line 380          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 697          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 698          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 699          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 700          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 701          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 702          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 705          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 706          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 707          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 708          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 711          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 712          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 713          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 714          Warning: Cannot modify header information - headers already sent by (output started at /usr/home/nakashitabcn.com/web/pedidos/wp-content/themes/nakashita/functions.php:226) in /usr/home/nakashitabcn.com/web/pedidos/wp-includes/pluggable.php on line 876      Being the URL something like:               http://website.com/pedidos/wp-login.php?action=logout&redirect_to=http%3A%2F%2Fwebsite.com%2Fpedidos%2F&_wpnonce=db999bfbcb      -EDIT-               function remove_admin_bar() {         global $wp_admin_bar;         if (is_user_logged_in()) {             if (!current_user_can('administrator') && !is_admin()) {               show_admin_bar(false);     /* LINE 226*/         echo '';             }              }     }


title: How to customize a title by passing query string?

text: I have a profile page, it is a template. Every time when I click one of a doctor, the profile page will show the specific doctor info by passing a query string. Something like profile?doctorName=abc. I have rewrote to profile/abc. Now the page title is "profile | blog name", But I would like to change the title to "abc(doctor's name) | hospital name".(Different doctor is in different hospital). This is my code below, and I tried to put it in the function.php and the profile template:                  <title><?php if (is_page( physician_single_pg()))                {                 echo something               ////How to get the doctor name                 echo " | ".(our_doctors()); //the hospital name, get from the plugin                                }               else                 {                 wp_title( '|', true, 'right' );                 }               ?>         </title>      I am thinking maybe I can push the query string to the plugin and pull it out in the header. But I don't know how to do that. I didn't get any luck. Please help, every suggestion is welcome. Thank you.


title: Page Templates - this code only works for one Custom Post Type

text: I have the code below in my functions.php file, it works great and allows me to use page templates in my custom post type 'services'. I have defined which 'type' to use on the first line with 'services'.               define('MY_CUSTOM_POST_TYPE', 'services');      The problem is I have multiple custom post types. I want to use the function allow me to choose page templates for ALL my custom post types. Being a complete novice I can't get it to work. Here is the code in full:               # Define your custom post type string     define('MY_CUSTOM_POST_TYPE', 'services');          /**      * Register the meta box      */     add_action('add_meta_boxes', 'page_templates_dropdown_metabox');     function page_templates_dropdown_metabox(){         add_meta_box(             MY_CUSTOM_POST_TYPE.'-page-template',             __('Template', 'my_template'),             'render_page_template_dropdown_metabox',             MY_CUSTOM_POST_TYPE,             'side', #I prefer placement under the post actions meta box             'low'         );     }          /**      * Render your metabox - This code is similar to what is rendered on the page post type      * @return void      */     function render_page_template_dropdown_metabox(){         global $post;         $template = get_post_meta($post->ID, '_wp_page_template', true);         echo "             <label class='screen-reader-text' for='page_template'>Page Template</label>                 <select name='_wp_page_template' id='page_template'>                 <option value='default'>Default Template</option>";                 page_template_dropdown($template);         echo "</select>";     }          /**      * Save the page template      * @return void      */     function save_page_template($post_id){              # Skip the auto saves         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )             return;         elseif ( defined( 'DOING_AJAX' ) && DOING_AJAX )             return;         elseif ( defined( 'DOING_CRON' ) && DOING_CRON )             return;              # Only update the page template meta if we are on our specific post type         elseif(MY_CUSTOM_POST_TYPE === $_POST['post_type'])             update_post_meta($post_id, '_wp_page_template', esc_attr($_POST['_wp_page_template']));     }     add_action('save_post', 'save_page_template');               /**      * Set the page template      * @param string $template The determined template from the WordPress brain      * @return string $template Full path to predefined or custom page template      */     function set_page_template($template){         global $post;         if(MY_CUSTOM_POST_TYPE === $post->post_type){             $custom_template = get_post_meta($post->ID, '_wp_page_template', true);             if($custom_template)                 #since our dropdown only gives the basename, use the locate_template() function to easily find the full path                 return locate_template($custom_template);         }         return $template;     }     add_filter('single_template', 'set_page_template');


title: Exposing custom fields to the user in custom type post

text: I have a custom post type - say Hotel Booking - all the data are filled in by the admin and users can browse through different Hotel Rooms. Now, I would like the user to be able to tick additional options before they book which will increase the final price. So for example the user can tick 'Additional Meal' and the price would update or 'Insurance' - the price will update. All of this in the frontend - not in custom-type edit page. I am not sure how to do this I know that that in Drupal the fields can be exposed to be selectable/changeable by the user. Is there a way to do this easily in Wordpress?


title: Retrieve only posts from a specific user in wp-admin/edit.php

text: I create a role and set capabilities for a group of user.               $userdata = array(         //something     );     $uid = wp_insert_user($userdata);     if(!empty($uid)){         $blogger = new WP_User($uid);         //add role         $capabilities =  array(             'read' => true,             'publish_posts' => true,             'edit_published_posts' => true,             'delete_published_posts' => true,             'edit_posts' => true,             'delete_posts' => true         );         add_role('blogger_simple', 'blogger_simple', $capabilities);         $blogger -> set_role('blogger_simple');     }      Now, the user create successfully. I logged in to the system, and create `one` post , just `one` post. Then I click the menu `Post --> All Posts` and found three columns there `Mine(number) All(number) Published(number)`. I click All(2), find I can see others posts?   I click Published(2), still 2 posts one is mine the other is by admin What's more, I search post, got the same results. That's not I want, I just want to get my posts not by admin and all other user's post. How do I get just my posts when I click `All/Published` link below `All posts` menu, and also the `search box`.


title: Embed Post in external page

text: I am wanting to create a page that can be embedded in other sites with an embed script like this:               <iframe src="http://www.mysite.com/the_hidden_page?setting=set1&setting2=set2"></iframe>      The page will need to be 'hidden' so it does not appear in the menu on my site and it will need to accept a query string. The URL in my example does not need to be exactly like this, something like '/the_hidden_page/set1/set2' would be fine as well.


title: How to transition cookies from .subdomain.domain.com to .domain.com with minimal impact on users?

text: I need to extend the cookies of a subdomain.domain.com to all of the domain.com's subdomains (.domain.com in cookie terms). I am trying to minimize the impact of this transition. It seems that flipping the switch with `define('COOKIE_DOMAIN', '.domain.com');` in wp-config leaves the user in a state of limbo -- their cookie is good enough to validate, so it won't move to the new domain scope. Any ideas on how I can transition cookies from .subdomain.domain.com to .domain.com with minimal impact on users? Here's the code I've been failing and flailing with. It attempts to validate the old cookies when a bad hash is detected (from changing `AUTH_KEY` in wp- config.php) and then tries to re-validate and send them back to where they came from:               function do_report_bad_hash( $cookie_elements ) {              if( isset( $_COOKIE['wordpress_logged_in_'] ) ) {             $user_id = wp_validate_auth_cookie( urldecode( $_COOKIE['wordpress_logged_in_']), 'logged_in' );                  setcookie( 'wordpress_logged_in_', '', 0, '/', '.subdomain.domain.com', false, true );              unset( $_COOKIE['wordpress_logged_in_'] );                  setcookie( 'wordpress_', '', 0, '/', '.subdomain.domain.com', false, true );              unset( $_COOKIE['wordpress_'] );                  if ( $user_id !== false ) {                      wp_set_auth_cookie($user_id);                      $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];                      header("Location: $redirect");                      }              }           }     add_action('auth_cookie_bad_hash', 'do_report_bad_hash', 11, 1 );


title: Featured posts and the loop

text: I'm trying to add a box in index.php where to show the latest 3 featured posts. According to this tutorial, I've added the following to **functions.php** :               add_theme_support( 'featured-content', array(         'filter'     => 'magdeleine_get_featured_posts',         'max_posts'  => 3,     ) );          function magdeleine_get_featured_posts() {         return apply_filters( 'magdeleine_get_featured_posts', array() );     }          function magdeleine_has_featured_posts( $minimum = 1 ) {         if ( is_paged() )             return false;              $minimum = absint( $minimum );         $featured_posts = apply_filters( 'magdeleine_get_featured_posts', array() );              if ( ! is_array( $featured_posts ) )             return false;              if ( $minimum > count( $featured_posts ) )             return false;              return true;     }      Then I've created a **featured.php** template like this:               <?php     // Get our Featured Content posts     $featured = magdeleine_get_featured_posts();          // If we have no posts, our work is done here     if ( empty( $featured ) )         return;          foreach ( $featured as $post ) : setup_postdata( $post );     ?>              [...post code...]          <?php endforeach; ?>     <?php wp_reset_postdata(); ?>      Last, I've called the template inside **index.php** this way:               <!-- Editor's picks -->     <?php if ( magdeleine_has_featured_posts( 1 ) ) : ?>         <?php get_template_part( 'featured' ); ?>     <?php endif; ?>                               <?php /* Start the Loop */ ?>     <?php while ( have_posts() ) : the_post(); ?>     ...      But... How to avoid repeating the same posts in the loop?


title: WP_Query to get all posts with specified category in priority

text: Now I have a query to get all posts in the specific category `featured`.               $today = date('Y-m-d');     $args = array(         'post_type'         => 'event',         'event-categories'  => 'featured',         'meta_key'          =>  '_event_end_date',           'meta_compare'      => '>',         'meta_value'        => $today,          'order'             =>  'DESC',         'posts_per_page'    => '10',     );          $query = new WP_Query( $args );      Instead of this I need a query to get all post for the event post type with featured category in priority(first list all events with featured category, then the remaining events) and then the other event with pagination.


title: WordPress it's cleaning a custom query_var to avoid sql injections?

text: I am using `get_query_var` function to get a custom `query_var`. This `query_var` will be used later in to query arguments to retrieve posts with:               $the_query = new WP_Query( $args ); .      My question is, is it safe if I use `get_query_var` such as is provided or do I need clean this variable to avoid sql injections? I've read this post, but it is not entirely clear and also it is old.


title: Wordpress tags as twitter sharer URL hastags

text: I want to share a wordpress post on twitter. I'm using this :               <a href="https://twitter.com/share?url=<?php the_permalink() ?>&text=<?php the_title() ?>&via=<?php the_author() ?>&hashtags=<?php the_tags('', '') ?>" >      My problem is that `the_tags()` prints the tags inside the `<a>` tag. How can I use `the_tags('', '')` ( which separates the tags with comma as the hashtag needs to be ) for twitter hashtags ? I would appreciate any solutions without the use of a plugin


title: Change header based on visitor choice

text: I need to show a different header file ("header-tourist.php" and "header- agent-php") based on a choice the visitor will make. For example, I have 2 main buttons: `View site as Tourist` or `View site as Agent`. Based on this, I would like to show a different header throughout the whole site. What is the best way to approach this (global variables, sessions etc.) ?


title: Why won't register_setting() create a setting?

text: I'm stumped. I've been researching this like crazy, but I can't seem to figure out why `register_setting()` isn't working for me. I'm new to WP plugin development (obviously), so it's probably just something silly that I'm missing. Check it out. I'm running this in the constructor function:               add_action( 'admin_init', array( $this, 'register_settings_and_fields') );      Then I have the following code which should execute what I need:               /**      * Register the settings and fields for the plugin settings page.      *      * @since    1.0.0      */     public function register_settings_and_fields() {              register_setting('my_plugin_settings', 'my_plugin_settings');              add_settings_section(             'my_plugin_main_section',                          // ID used to identify this section and with which to register options             'Main Settings',                                   // Title to be displayed on the administration page             array($this, 'my_plugin_main_settings_callback'),  // Callback used to render the description of the section             $this->plugin_slug                                 // Page on which to add this section of options         );              // Begin defining the fields         add_settings_field('my_plugin_data_1', 'Data 1', array( $this, 'my_plugin_data_1_setting' ), $this->plugin_slug, 'my_plugin_main_section');     }          // ... and of course other lines of code.      Of course, I have more code where I do things such as define the callback functions, etc. Everything seems to execute perfectly, and the settings section/field is displayed correctly. But when I go to `/wp- admin/options.php`, my_plugin_settings _has not been created_. I'm stumped. Any thoughts? Let me know if you'd like to see more code.


title: Read More link doesn't work with Custom Post Type

text: I came several times across the same solution to make `Read More` links work with CPTs: adding `global $more; $more = 0;` before `the_content('read more..')`. However it doesn't work in my case. To no avail I tried with `the_content()` without parameters and with `the_excerpt()`. In all cases, the whole CPT content is displayed as if my `Read More` link didn't exist. I'm running this from a template page displaying all my CPT posts. Just in case here's how I define my CPT:               function event_cpt() {         $labels = array(             'name'               => _x( 'Events', 'post type general name' ),             'singular_name'      => _x( 'Events', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'book' ),             'add_new_item'       => __( 'Add New Event' ),             'edit_item'          => __( 'Edit Event' ),             'new_item'           => __( 'New Event' ),             'all_items'          => __( 'All Events' ),             'view_item'          => __( 'View Event' ),             'search_items'       => __( 'Search Events' ),             'not_found'          => __( 'No events found' ),             'not_found_in_trash' => __( 'No events found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Events'         );         $args = array(             'labels'        => $labels,             'description'   => 'Holds our events and event specific data',             'public'        => true,             'menu_position' => 5,             'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),             'has_archive'   => true,         );         register_post_type( 'event', $args );        }     add_action( 'init', 'event_cpt' );          function event_updated_messages( $messages ) {         global $post, $post_ID;         $messages['event'] = array(             0 => '',              1 => sprintf( __('Event updated. View event'), esc_url( get_permalink($post_ID) ) ),             2 => __('Custom field updated.'),             3 => __('Custom field deleted.'),             4 => __('Event updated.'),             5 => isset($_GET['revision']) ? sprintf( __('Event restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,             6 => sprintf( __('Event published. View event'), esc_url( get_permalink($post_ID) ) ),             7 => __('Event saved.'),             8 => sprintf( __('Event submitted. Preview event'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),             9 => sprintf( __('Event scheduled for: %1$s. Preview event'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),             10 => sprintf( __('Event draft updated. Preview event'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),         );         return $messages;     }     add_filter( 'post_updated_messages', 'event_updated_messages' );


title: WordPress Customize panel - accessing the values

text: Here is the code I'm using to add the section to the Customize panel.               function apple_customize_register($wp_customize){     $wp_customize->add_section('apple_footer', array(         'title'    => 'Footer',         'priority' => 120,     ));     //------ display copyright in footer     $wp_customize->add_setting('theme_options[copyright]', array(         'capability' => 'edit_theme_options',         'type'       => 'option',     ));     $wp_customize->add_control('theme_options[copyright]', array(         'settings' => 'theme_options[copyright]',         'label'    => __('Display Copyright'),         'section'  => 'apple_footer',         'type'     => 'checkbox',         'value' => '1'     ));     }     add_action('customize_register', 'apple_customize_register');      How do I use the values in my theme. I have tryed `get_option('theme_options[copyright]')`, `get_theme_mod('theme_options[copyright]')` and many more, but all var_dump out `bool(false)`. Please tell me what I'm missing.


title: Blog as a part of a Wordpress site?

text: I'm not sure how to word my search terms for this problem. I've created a site in WP. So, let's assume the URL is `http://example.org` The 'Contact' page would be `http://example.org/contact`, for example. I want to also have a blog on this site. The blog would reside at `http://example.org/blog` I have created a page named 'Blog'. I've gone to `Settings > Reading` and selected 'Blog' for the 'Posts page' select list. Now, when I visit the site, I don't see posts. How do I make my posts appear on `http://example.org/blog` given what I've done so far? I'm not quite sure how to do that the right way. Any recommendations would be appreciated!


title: Ads Refreshing with the Adsense Extreme Plugin

text: I installed the Adsense Extreme Plug-in on my blog and ads are loading with the page as they should, but then after the page fully loads, all the ads refresh. What could be causing this? I disabled all other plugins to see if one of my other plugins could be causing this, but this did not fix the problem. I'm on WordPress 3.5.1 using Adsense Extreme 1.1.4.


title: How to use function schedule post to integrate with date type (magic fields)?

text: Lately I'm developing a cinema website. The users are having problem setting movie on `coming-soon`, `release`, and `now showing` types. They need to do it in manual way. So I just saw WordPress function schedule and I think I want to use it with Magic Field plugin to set auto update movie to the three types I mentioned above.


title: Moved my site to new host now getting 404

text: I just moved my wordpress multisite to a new host and all the pages expect the homepage keep getting the follower error Not Found The requested URL was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. I have tried resetting the permalinks inside the wp admin that doesn't seem to work. Could does have something to do that the site was an addon domain on cpanel at my old hsot while its the primary domain in my current cpanel? Please let me know what i can do to solve this?


title: pagination not working for category.php (custom post types in categories)

text:
it works everywhere on my site but it isnt working in category.php. When i click page to it goes to... domain.com/category/ _cat-slug_ /page/2 by the way this is showing custom post types within certain categories (no actual plain 'posts') But when the page loads its just the 404 page? When i go to /page/1 it works fine, just not for any other pages. In permalinks I have /%postname%/ although I have set category base to 'category' just to be safe. I also know this is kind of a convoluted way of doing it but i wasnt sure a better way.               <?php               get_header(); ?>

            <?php              $catID = get_query_var('cat');        $catName = strtolower(get_cat_name($catID));                   if ( get_query_var('paged') ) {         $paged = get_query_var('paged');       } elseif ( get_query_var('page') ) {         $paged = get_query_var('page');       } else {         $paged = 1;       }            $myquery = new WP_Query(array(             'post_type' => 'any',                 'paged' => $paged,                 'posts_per_page' => 1,           'category_name' => $catName)             );                  while ( $myquery->have_posts() ) : $myquery->the_post();                        $img_id = get_post_meta($post->ID,'main_image',true);             $img_url = wp_get_attachment_url($img_id);              ?>     blah blah code here for output              <?php            endwhile;        wp_pagenavi( array( 'query' => $myquery ) );        ?>


title: How to add a child item to a menu element (using wp_nav_menu_objects)

text: (1) I used the code given on answer to How to use logout function on custom menu link? to programmatically add a menu element to `wp_nav_menu_objects` (Say "Animals"). I give it an id, say 1000. (2) Similarly, I succesfully created elements that I wanted to be children of a preexisting element (fixing `menu_item_parent` to the id of the parent element) (like "Jonquil" to element "Flowers") (3) The problem comes when I try to add children elements (Say "Cats" and "Dogs") to my programmatically added element "Animals". Cats and Dogs appear on the same level as Animals, as if WP couldn't manage to find their parent... (Yes, I do 3 after 1...) An idea of what I can be missing ?


title: how to call new widgets in sidebar in custom theme?

text:
I am developing a theme in which I want to call available widgets _ex. Calendar_ and the installed plugin, I have put it in the sidebar from widget panel but can't see in frontend. Sidebar.php Code->

News & Announcements

                    <?php dynamic_sidebar('sidebar'); ?>     You can color this theme as you wish, by its powerful theme options panel. It has great      documentation.

          <?php if (is_page(array('home', 'about-us', 'academics', 'admission', 'activities',  'hall-of-fame', 'alumni', 'photo-gallery', 'news' ))) ?>     <?php $menu=wp_nav_menu('menu=sidebar_menu'); ?>     <?php if ( ! dynamic_sidebar( 'Sidebar' )) : ?>     <?php //If dynamic sidebar not found show the default widgets  ?>     <?php endif; ?>

      functions.php Code->               <?php          if(function_exists('register_sidebar'))     {     // Sidebar Widget     register_sidebar(array('name'=>'Left-Sidebar',     'before_widget'=>'
',     'after_widget'=>'
',     'before_title'=>'
',     'after_title'=>'
'     ));     }     ?>


title: Isotope Drop Down Categories Filter Function

text:
I have a code in my functions file that I am using to generate a list of categories so that I can use isotope to filter the current page. However I need to know how to - How to make it a drop down and how to make the isotope script work with it? How to populate the drop down with the terms/child terms of the current category being viewed? This is the code that I am referring to -                   function isotope_categories() {              $terms = get_terms('videoscategory');              $html = '
';         $html .= '
All items
';              foreach ($terms as $term) {                       $html .= "
slug}' class='current'>{$term->name}
";            }              $html .= '
';              echo $html;     }      Here is the script I need to make work with a drop down and isotope -                     **EDIT:** I was able to make the function into a drop down using this code -                function isotope_categories() {              $terms = get_terms('videoscategory');              $html = '<select class="option-set clearfix"  data-filter-group="leuchtenart">';         $html .= '<option value="*" data-filter-value="" class="selected">All items</option>';              foreach ($terms as $term) {                       $html .= "<option value='#filter-leuchtenart-{$term->slug}' data-filter-value='.{$term->slug}'>{$term->name}</option>";            }              $html .= '</select>';              echo $html;     }      And I changed the js using the following code, however it's not working and I am receiving a error on the last line "SyntaxError: Illegal Character"                     Any help is appreciated, thanks.


title: How to apply default post categories to link manager plugin

text: I have a project with several custom post types - all sharing the default WP post category taxonomy. I would like to add the link manager plugin (Formally built into WP pre 3.5) to manage links - also sharing the default WP post categories. By default, though, the plugin needs you to create separate (link specific) categories. Does anyone know of a simple way to get it to sync with the default wp categories. Something in the functions file. Ta. P.


title: changing host.. data loss

text: I changed my host from dreamhost to godaddy.. My menubar setup is not showing up.. all of the pages are visible when there is only supposed to be a couple visible .. the site is first in english but you have the option to change it to french and now all the french manu bars are displaying aswell as the english ones .. also i lost all of my sidebar data .. the custom sidebars/footers i created are showing up in the appearance: widgets section but the content is lost they are all empty ! please help ive been trying to fix all of this for 4days now with barely any seep in between and been on the phone with godaddy but they are clueless :( thank you


title: Sorting results from JSON-API on custom fields

text: Is there any way, out of the box, to sort results from the JSON-API plugin based on values in custom fields? The request is paged, so the results will need to be sorted server-side. I have an http request along the lines of:               http://www.example.com/wordpress/?json=get_author_posts&author_slug=user&post_type=custom     &include=title,custom_fields&custom_fields=date_value&count=10&page=1      I'd like to sort on the custom field `date_value`, ideally without having to create a new controller within the json plugin. Is this possible?


title: Addin plugin custom post type to members plugin

text: I am using the Wp-Leads plugin and Members plugin and I want to create a new user with the role leads-admin. When I go into the leads-admin role I added these capabilities:               edit_wp-leads     delete_published_wp-leads     delete_wp-leads     edit_published_wp-leads      But when I log in as a user with the role leads-admin and I try to view the leads I get this message: > You do not have sufficient permissions to access this page. Does anyone know how I can get this to work?


title: permalink changed, now getting 404 for every pages

text: i have my website with permalink, till now everything was fine, but few days before i changed my permalink, now everything is going wrong, now each and every page i am getting 404, even my about-us and contact us pages, they are giving me 404 page if i come to my site from google or any search engines, then also it gives me 404 i have 1000+ posts on my website, for each post & page from google i get 404 page, but within the website except pages i get no 404 page **my previous permalink:** `%postname%/%category%/` now i added custom taxonomy to my permalink,   **so now it is:**`%location%/%courses%/%postname%` I asked this question first also, but it was into wrong section i guess, thats why asking again and in detail. **Related Question:** custom taxonomies on permalink


title: Why does my functions.php cause white-screen and media-library issues?

text:
## **Overview:** I was authoring a child-theme, and realized that functions.php was causing problems with the media-library and caused a "white-screen" to appear after editing a post. I fixed the issue by removing all content from my functions.php, but I don't know what was causing this. * * * ## Info: **Production Server:** multi-site, Wordpress 3.8.1 **Local development server** (aka "localhost"): Wordpress 3.8.1 with AMPPS v2.2(php v5.3) in Windows 7 Pro SP1. * * * ## **The Media-Library problem:**   * Upon going to appearance-->Header-->'select image'-->'choose an image from your media library'   * **AND** Upon going to posts-->'all posts'-->'edit post'-->'set-featured image'   * The media library did not show any content, as if my library were empty. This is in spite of going to dashboard-->media-->library, and verifying that there is media-content.   * Also, when attempting to upload a media file (using the above ways), I would always receive an error "an error occurred in the upload. Please try again later" * * * ## The White-Screen problem:   * Upon going to posts-->all posts-->edit post--> update, a white-screen would ensue when clicking the button to update/create a post.   * Using `CNTRL+s` to save the post from within the wysiwyg did not cause a white-screen. * * * ## functions.php This is what functions.php looked like before I fixed the problem by removing all the content.(It turns out that I no longer needed the functions within it anyways). Also on http://pastebin.com/KS66yfqK                    <?php          function cals_fetch_feed2($feed_uri,$num_items, $echo = 1, $length =-1, $exclude=''){     //NOTE: to disable cache, go to feed.php and replace timestamp in      // $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200, $url));      $i = rand(1,5);     // Get RSS Feed(s)     include_once(ABSPATH . WPINC . '/feed.php');          // Get a SimplePie feed object from the specified feed source.     $rss = fetch_feed($feed_uri);          if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly               //enable order by date         $rss->enable_order_by_date(true);              // Figure out how many total items there are, but limit it to $num_items.          $maxitems = $rss->get_item_quantity($num_items);               // Build an array of all the items, starting with element 0 (first element).         $rss_items = $rss->get_items(0, $maxitems);      endif;          if($echo == 1){              if (count($rss_items) == 0) {             //echo '
No items.
';             echo 'no items';         } else {             foreach ( $rss_items as $item ) {                       //check for excluded posts                 if($exclude!='' && $exclude == $item->get_id()){                     continue;                 }                           $featuredImageSrc = $item->get_item_tags('', 'featuredimage');                            $featuredImage = $featuredImageSrc[0]['data'];                                ?>                      <?php                   /*if($featuredImage) {*/                          echo '
get_categories() as $category)                         {                             echo $category->get_label()." ";                                       /*$imageCat = $category->get_label();                              if($imageCat == "Agriculture" || $imageCat == "Food" || $imageCat == "Environment" || $imageCat == "Energy" || $imageCat == "Health" || $imageCat == "People" || $imageCat == "Communities" || $imageCat == "Events") {                                  break;                              } else {                                       echo "Announcements ";                             break;                         }*/                              }                          echo '">

';                          $notdisplayed = true;                      if($featuredImage1) {                     echo '';                 } else if($featuredImage) {                     echo '';                 } else {                     echo '

';                     /*foreach ($item->get_categories() as $category)                     {                         $imageCat = $category->get_label();                              if($imageCat == "Agriculture") {                                  echo '';                             break;                         } else if($imageCat == "Food") {                                  echo '';                             break;                         } else if($imageCat == "Environment") {                                  echo '';                             break;                         } else if($imageCat == "Energy") {                                  echo '';                             break;                         } else if($imageCat == "Health") {                                  echo '';                             break;                         } else if ($imageCat == "People" || $imageCat == "Communities") {                                  echo '';                             break;                         } else if ($imageCat == "Events") {                                  echo '';                             break;                         } else {                                       echo '';                             if($i < 5) {                                 $i = $i + 1;                             } else {                                 $i = 1;                             }                             break;                         }                                    }*/                           }                 echo '
';                          echo '

';                     $title = $item->get_title();                     if($length != -1){                         if(strlen($title)>$length){                              echo substr($title,0,$length).'...'; }                          else {                              echo $title;                          }                     } else {                          echo $title;                      }                 echo '

';                 $content = $item->get_description();                  echo $content;                 echo '

';                 echo $item->get_date('F j, Y');                 echo '

';                 echo "-".$item->get_date('Ymd');                 echo '

';                 $cattemp = $item->get_category();                 echo $cattemp->get_label();                 echo '
10
';                                      echo 'get_permalink();             echo '" class="highlight" title="';             echo 'Posted '.$item->get_date('j F Y | g:i a');             echo '">Read more about ';             echo $item->get_title();             echo '

';                       /*}  else {                      //What to display if no image is supplied by the article                      echo '
get_categories() as $category)                         {                             echo $category->get_label()." ";                         }                          echo '">

';                     $title = $item->get_title();                     if($length != -1){                         if(strlen($title)>$length){                              echo substr($title,0,$length).'...'; }                          else {                              echo $title;                          }                     } else {                          echo $title;                      }                 echo '

';                 $content = $item->get_description();                  echo $content;                 echo '

';                 echo $item->get_date('F j, Y');                 echo '

';                 echo "-".$item->get_date('Ymd');                 echo '

';                 $cattemp = $item->get_category();                 echo $cattemp->get_label();                 echo '
10

';                                                          echo '
get_permalink();             echo '" class="highlight" title="';             echo 'Posted '.$item->get_date('j F Y | g:i a');             echo '">Read more about ';             echo $item->get_title();             echo '

';                       }*/              ?>                                 <?php }         }          } else {              return $rss_items;          }     }          /*function soilsextension_enqueue_scripts(){      $handle = 'soilsextension_scripts';      $src = get_theme_root_uri() . '/soilsextension/js/min/master.min.js';          wp_register_script($handle, $src, false, false, true);          wp_enqueue_script('soilsextension_scripts');     }          add_action('wp_enqueue_scripts', 'soilsextension_enqueue_scripts'); */      * * * ## Active Plugins: These were the active plugins during the time I was testing. **Production:** Advanced Custom Fields Version 4.3.5 (http://www.advancedcustomfields.com/), Custom Post type UI Version 0.8.2 (http://webdevstudios.com/plugin/custom-post-type-ui/), Events Manager Version 5.5.2(http://wp-events-plugin.com/), WP Super Cache Version 1.4 (http://wordpress.org/plugins/wp-super-cache/) **Localhost Active plugins:** Advanced Custom Fields Version 4.3.4 (http://www.advancedcustomfields.com/), Custom Post type UI Version 0.8.2 (http://webdevstudios.com/plugin/custom-post-type-ui/) * * * **Attempted Solutions:** I attempted two cases and recorded the results, in effort to understand the cause. > > **Case 1.** >> >>> removing html comment on top of functions.php >>> >>>> **Localhost:** "white-screen problem" is absent. "media-library problem", absent. >>>> >>>> **Production:** "White-screen problem" and "media-library problem both present. >> >> **Case 2.** >> >>> keeping html comment on top of functions.php but removing function cals_feed_fetch2 >>> >>>> **Localhost:** "white-screen problem" is absent." media-file problem" present. >>>> >>>> **Production:** "white-screen problem" is present. media-file problem is present * * * ## Conclusion: * * * Though I appear to have fixed the problems by removing all the content in functions.php, I don't know what part(s) of my original functions.php caused these problems.


title: How to hide Newsletter plugin submenus from the Dashboard?

text: I would like to hide some submenus from the Dashboard for non admin users. I'm using the `remove_submenu_page` function but I'm not using it properly since it doesn't work and sub menus are still displayed. http://codex.wordpress.org/Function_Reference/remove_submenu_page I'm trying to hide sub menus from a plugin called Newsletter for non admins :   * wp-admin/admin.php?page=newsletter_main_index   * wp-admin/admin.php?page=newsletter_main_main   * wp-admin/admin.php?page=newsletter_main_diagnostic    * wp-admin/admin.php?page=newsletter_subscription_profile Here's the code I used in functions.php but I can't get it right:                   function ns_remove_admin_menus() {             global $menu;             global $current_user;             if ($current_user->ID != 1) {                 remove_submenu_page( 'admin.php?page=', 'newsletter_main_index' );                 remove_submenu_page( 'admin.php', 'newsletter_main_index' );             }         }         add_action('admin_init', 'ns_remove_admin_menus', 999 );      Any idea how I could make it work?


title: Calendar based on Codrops

text:
I've been banging my head over this problem for more than a week now and just cound't manage to make it happen. Event though I know that it is possible. I'm building a calendar based on this plugin and I've got it to work almost properly. The only problem I'm facing is that it is not recognizing the post_tyle I made as a source to mark the days with events. You can access the plugin files in the link above if you want to test it yourself and I'll put here the code of the calendar and it's functions. I should mention that I did not build the functions myself, so I don't fully get all the things... calendar in index.php

                         <?php query_posts(array("post_type" => "eventos", "posts_per_page" => -1)); if(have_posts()){ while(have_posts()){ the_post(); ?>                             <div id="evento-<?php the_ID(); ?>" class="infodia entry">
<?php the_title(); ?>
                                 <?php the_content(); ?>
                         <?php } } wp_reset_query(); ?>

      Events Functions               loadEventsCalendar();          var codropsEvents = {         <?php             query_posts(array('post_type' => 'eventos', 'meta_key' => 'vld_date', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => -1));             if(have_posts()){                 $eventsArray = array();                 while(have_posts()){                     the_post();                     $eventDate = get_post_meta($post->ID, 'vld_date', true);                     $eventEndDate = get_post_meta($post->ID, 'vld_dateEnd', true);                          if($eventsArray[$eventDate] == NULL) $eventsArray[$eventDate] = array();                     array_push($eventsArray[$eventDate], '

'.get_the_title().'
+ Saiba mais
');                          if(!empty($eventEndDate) && $eventDate != $eventEndDate){                         list($eventMonth, $eventDay, $eventYear) = split("-", $eventDate);                         $dateObj = mktime(0, 0, $eventYear, $eventMonth, $eventDay);                         list($eventEndMonth, $eventEndDay, $eventEndYear) = split("-", $eventEndDate);                         $dateEndObj = mktime(0, 0, $eventEndYear, $eventEndMonth, $eventEndDay - 1);                              $newDate = $dateObj;                              while($newDate <= $dateEndObj){                             $newDate                = strtotime(strftime("%d %B %Y", $newDate)." +1 day");                             $formattedDate  = strftime("%m-%d-%Y", $newDate);                             if($eventsArray[$formattedDate] == NULL) $eventsArray[$formattedDate] = array();                             array_push($eventsArray[$formattedDate], '

'.get_the_title().'
+ Saiba mais
');                         }                     }                 }                      foreach($eventsArray as $eventDate => $eventDay){                     echo "'".$eventDate."' : '";                     foreach($eventDay as $event){                         echo $event;                     }                        echo "',";                 }             }             wp_reset_query();         ?>     }     function determineEmptyDivs(){         jQuery("#calendar .fc-row > div").each(function(){             if(jQuery(this).html() == '') jQuery(this).addClass("empty");         });         jQuery("#calendar .fc-body > .fc-row").last().addClass("last-row");     }     function loadEventsCalendar(){         var cal = jQuery('#calendar').calendario({                 onDayClick : function($el, $contentEl, dateProperties){                     if($contentEl.length > 0) showEvents($contentEl, dateProperties);                 },                 caldata : codropsEvents,                 displayWeekAbbr : true,                 displayMonthAbbr : false,             }),             $month = jQuery('#custom-month').html(cal.getMonthName()),             $year = jQuery('#custom-year').html(cal.getYear());              jQuery('#custom-next').on('click', function(){             cal.gotoNextMonth(updateMonthYear);             determineEmptyDivs();         });         jQuery('#custom-prev').on('click', function(){             cal.gotoPreviousMonth(updateMonthYear);             determineEmptyDivs();         });         jQuery('#custom-current').on('click', function(){             cal.gotoNow(updateMonthYear);             determineEmptyDivs();         });              determineEmptyDivs();              function updateMonthYear(){                          $month.html(cal.getMonthName());             $year.html(cal.getYear());         }        }     function showEvents($contentEl, dateProperties){         hideEvents();         var $wrapper = jQuery('#custom-inner'),                 $events = jQuery('

Eventos do dia ' + dateProperties.day + ' de ' + dateProperties.monthname + ' de ' + dateProperties.year + '

'),                 $close = jQuery('
').on('click', hideEvents);         $events.append($contentEl.html(), $close).insertAfter($wrapper);         setTimeout(function(){             $events.css( 'top', '0%' );         }, 25);     }     function hideEvents(){         var $events = jQuery('#custom-content-reveal' );         if($events.length > 0){             $events.css( 'top', '100%' );             jQuery(this).remove();         }     }


title: Completely hide user info

text: I'm wondering if there's a way to make 100% sure a user's info is not available to the public. Our theme is not currently using a profile page, but I did notice that there is a 'Posts by author' page for each user. Aside from that, is there anywhere else a user's info may show up? I'm hoping to have no info be displayed anywhere on the site, including a user's email address, name, username, etc. The reason for this is that our WordPress user's will have very sensitive information, and that they will not want to be public in any way shape or form. > Question: Where in public/not logged in request can author info be exposed?


title: Remove 'Visual' tab from TinyMCE editor

text: I would like to disable the 'Visual' tab so that the 'Text' tab is always used. Is there a clean way to do this besides just doing something like .wp-switch- editor { display:none!important; } ![enter image description here](http://i.stack.imgur.com/wYuG0.jpg)


title: Unable to get posts with category on my page

text: I am using wordpress as my CMS. I am thinking, that the left panel has titles of my "posts" under its relevant category and the right side as the title of the post and its content. I have tried to put the following code in a page (after enabling a php plugin for wordpress). But since I dont know php, I tried the below, but it does not display pages with category "basics".               [php]     $myposts = get_posts('numberposts=5&category=basics');      foreach($myposts as $post) :         setup_postdata($post);     //add in standard WordPress post specific template tags here eg.   the_title(),     the_permalink, the_content, the_excerpt etc.     endforeach;     [/php]


title: Change the look and feel of admin pages

text: I want to change the look and feel of the post edit page without making changes to any of the wordpress core file, which is basically a theme. For example, for any user with role of 'author', i want to display everything in one column and re-arrange the meta boxes. So is it possible to create a theme for one of the admin pages and how could i get started?


title: In administration, how do I display comments of a certain user?

text: From the users section, I can see a link to their posts, but not their comments. When I go to comments, there doesn't seem to be a straightforward way to filter only comments by a specific user. How to do it? (I'm sure such basic feature must be somewhere, I just can't find it.)


title: Correct way of adding taxonomy to a custom post type

text: Just something I´ve been wondering for a while: The Codex shows us two ways of attaching a Taxonomy to a Custom Post Type:   1. Using the `taxonomies` argument in the `register_post_type` function   2. Using the `object_type` variable in the `register_taxonomy` function Should we use both methods, or is one enough? And do they give the same result?


title: Update URL Snippet to Canonical Permalink URL

text: My permalinks is in the format `domain.com/post-id/post-slug` I notice this is a great choice for permalinks as I can share articles with a short URL like `domain.com/123` But when I go to this short url, should it not redirect to show the full URL, becuase in the adress bar its only showing `domain.com/123` Any setting to do to update the URL to the actual, without putting any additional load or the server. **UPDATE** : My requirement is not to get a shortlink. Rather to convert an URL fragment to the full URL. For eg: If I type `domain.com/123/wrong-slug` it gets corrected to `domain.com/123/correct-slug` but if I type `domain.com/123` it doesn't get corrected to `domain.com/123/post-slug`


title: Add 32x32 icon to custom post type index page

text: I've setup an "album" custom post type and want to add an icon on the index page where the RED circle is (see image below; from wptheming.com). Here's my function to replace the icon. The CSS is what I found when I inspected the icon element with firebug:               add_action('admin_head', 'album_foo');     function album_foo() {             global $post_type;         ?>         <style>         <?php if ($post_type == 'album') : ?>               #icon-album.icon32.icon32-posts-album {           background:url('<?php get_template_directory_uri(); ?>/images/album32x32.png') no-repeat;         }          <?php endif; ?>             </style>             <?php     }      I also tried this CSS in the function:               #icon-edit.icon32-posts-album {             background:url('<?php get_template_directory_uri(); ?>/images/album32x32.png') no-repeat;     }      I can't figure out what my CSS is missing, but my icon isn't showing. ![enter image description here](http://i.stack.imgur.com/mrmPp.jpg)


title: wordpress search result page post_type order

text:
i want to customize the search. what i need is when user search for ex: if user search for **tools** in search result will return result in following manners. **Pages** page 1 page 2 **Posts** post 3 post 8 **Products** product 2 product 8 in above manners. while default search returns the mix result i want to filter the result. first return all the post_type **page** , then after **posts** and at last **products** how to filter search result in such manner. what i did is i check the result with **get_post_type()** but pagination issue occur. pagination will not appear. is there solution for it? here is my code:                    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                     <div class="post post_row clearfix" id="<?php echo $post->post_name; ?>">
              <a href="<?php echo get_permalink($post->ID); ?>" title="<?php the_title();?>">
<?php the_title();?>

 <?php the_time(__('F j, Y', 'example')); ?>

<?php the_category('
'); ?>

                  <?php if(has_post_thumbnail()):?>
<?php the_post_thumbnail("thumbnail");?>
<?php endif; ?>                 <?php the_excerpt();?>
<a href="<?php echo get_permalink($post->ID);?>">read more

                    <?php endwhile; ?>

             <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
               <?php wp_reset_query();?>                      <?php else : ?>
<?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentytwelve' ); ?>
                     <?php get_search_form(); ?>                   <?php endif;?>  <?php endif;?>      **Need Help to have Such a output .**


title: Wordpress - Creating multiple versions of the same single-customtype.php depending on selected taxonomy categories

text: I have registered a custom post type 'Clients' and a taxonomy for this post type for categorizing posts. There are currently 3 categories for a Client: 'Logo Project', 'Video Project' and 'Web Design' project. Some Clients may belong to multiple categories. On the Edit Page for a Clients post, I have a Flexible field layout builder that let's you generate 'blocks' of content for each category type (logo, web, video...). Each block will have unique fields relevant to each category (video upload tools for video, image galleries for logo etc..) My issue is, that while I can display relevant content on taxonomy category pages (only show web-design for all Clients that are in the web design category...), once the user clicks to view this Client, the single-clients.php page has no way of ONLY displaying Web Design content and filtering out other 'Content blocks' in cases where a Client has > 1 content block. Ideally I need multiple versions of the clients single template: something like:               1) single-clients-web.php     2) single-clients-logo.php     3) single-clients-video.php     4) single-clients.php (shows all project blocks as it does now)      OR somehow take a referral ID and write a conditional that if the user clicked on the client from the web design category page, the single page they are directed to only shows the web design fields.


title: Dynamic wp_enqueue_scripts?

text: Is it possible to call wp_enqueue_scripts dynamically? For example, I want to use in function.php my own function               addThemeJS( true, 'modernizr', THEME_JS_DIR . "/plugins/modernizr.custom.js", array(), false, false );     addThemeJS( true, 'somthing-else', THEME_JS_DIR . "/plugins/somthing-else.js", array(), false, false );      In my core function file:               function addThemeJS( $enqueueThemeJS, $handle, $src, $deps, $ver, $in_footer ) {              function addJS( $handle, $src, $deps, $ver, $in_footer ) {                  wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );              }               add_action('wp_enqueue_scripts', 'addJS');          }       ... but I can not pass variables ( $handle, $src ) here that I need Suggest me a solution to this problem, please I'm just trying to make something like a mini framework for creating basic things in WordPress. for example, to create the menu, I use this function               / / Create menu:     function addThemeMenu ($ showThemeMenu, $ location, $ description) {          if ($ showThemeMenu):          register_nav_menu ($ location, $ description);          endif;          }      and then call               addThemeMenu (true, 'main', __ ('Main Navigation', 'Theme'));      it's very fast and do not have to rewrite from project to project.


title: How to set up Wordpress Multisite on multiple domains without plugin?

text: How to set up Wordpress Multisite, sub-folder setup, on multiple domains without plugin? For expample if I have two domains www.domain-one.com and second www.domain- two.com, i would like to have sites like: www.domain-one.cz - site in root, www.domain-one.cz/anothersite/ - site in subfolder of first domain, then the same posibilities on the second domain, is it posible? Actually i could do it on multiple domains but with change of one condition in wp-includes/ms-settings.php on line 72:               if ( $blogname != '' && ! in_array( $blogname, $reserved_blognames ) && ! is_file( $blogname ) && $domain != 'www.domain-two.com' )      and to be able to log into those sites you have to also put some aditional code to settings.php (this seems not necessary for new wordpress):               if($_SERVER['HTTP_HOST'] == 'www.domain-two.com')         define('COOKIE_DOMAIN', 'www.domain-two.com');      With this, quiite simple solution, you can have multiple sites but no sites with subfolders within those aditional domains, you can have subfolder sites only for main domain (and then multiple aditional domains). Actually if there is no option to do this without plugin and without changing code of core, if there option to do ti with change of core? Or is there some plugin which can do exactly this? What about sunrise.php is it posible with this?


title: Install a Network under a mapped domain

text: I'm already running a WordPress installation just fine under a mapped domain. The current setup points `(www).sample.com` to `/sample/` within `domain.com`, and it works fine. In the Create A Network section of the WP Codex, it states _"Domain mapping, however, will not work"_ but I would like to know if it is possible to make this installation into a network by manually editing the .htaccess file or some configuration somewhere. I feel like this should be possible, I can't see a reason why it couldn't be done, it's just complicated. Any input would be greatly appreciated.


title: tax_input argument for wp_insert_post()

text: I'm trying to insert custom taxonomies using `wp_insert_post()` and the `tax_input` argument, but it doesn't work. I want to set a post to a custom taxonomy ('types') and a category ('cars')               $new_post = array(                  'post_title'    =>   $title,                  'post_content'  =>   $description,                  'tax_input' =>   array('types' => array('cars')),                    'post_status'   =>   'pending',                            'post_type' =>   'vehicles'                    );


title: form to post multiple inputs into post_content

text: I have a form, with multiple inputs that I am trying to get posted to the wordpress "post_content". I am able to get the title field and only one other field to post successfully, only when making a field name "description" instead of "description[]", but have no idea how I can get the rest to submit into the post_content. I would like the inputs posted like the image I have created below. ![enter image description here](http://i.stack.imgur.com/dRjCS.jpg) Here is the code I currently have that works for the title only.


title: Does auto_load to 'no' in wp_options improve performance

text: I am trying to improve the performance of a wordpress based blog. I am looking at wp_options table and am thinking to set the column auto_load to 'no'. Does it have any side-effect on the site itself ? Does it improve the performance of the site ?


title: Wordpress Admin Bar pushed Sticky Footer off the bottom of the page

text: I've implemented Ryan Fait's oh-so-common sticky footer in a custom Wordpress theme. I've noticed now if I implement the Wordpress Admin Bar into my pages, which is 28px high (in current Wordpress version at least...), it pushes the sticky footer down 28px as well. Here's the admin bar: ![enter image description here](http://i.stack.imgur.com/urpWt.jpg) Anyways, the way Wordpress works is that the Admin Bar does or does not show up at the top of the pages depending on how Admin users set their preferences. So I do not want to simply remove it fro the theme. I could obviously use jQuery after the ready event fires to see if the Admin Bar is there or not and alter the footer accordingly, but I'd rather try to avoid this if possible and just have the page generate properly to begin with... Any ideas? Also I want the theme to work with near-future versions of Wordpress. So if in a future version they decide to change the admin bar to something other than 28px high, then I don't want my code to have to be adjusted to compensate for the change.


title: Shortcode registered from a plugin not recognized

text: I'm coding a really simple plugin to add some slideshows to my theme. I also want to register a shortcode to invoke them from my pages. So far I have this:               class Slideshow {          public function __construct() {              // Register the project custom post type         add_action( 'init', array( $this, 'ss_register_slideshow_type' ), 0 );         add_action( 'init', array( $this, 'ss_register_shortcodes' ), 0 );     }          function ss_register_slideshow_type() {}          function ss_register_shortcodes() {         add_shortcode( 'embed-slideshow', 'ss_shortcode_embed_slideshow' );     }          function ss_shortcode_embed_slideshow( $atts ) {         return 'Foo';     }          }          // init     $slideshow_instance = new Slideshow();      I omit the custom post type registration for brevity. The custom post type gets registered, but when I try to call the shortcode in a page with               [embed-slideshow]      nothing happens. I mean, I get [embed-slideshow] written. I've registered another shortcode from my theme functions and it works well. Am I missing something really obvious? Any idea? Thanks!


title: Can't access login page after password reset

text: After completing the WordPress reset password procedure I try to login with the new password but I get an error saying:               'Authorization Required. This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.'      The password has been changed but I have to use a different browser in order to view the login page and be able to login. Once this happens I can't view the login page even after deleting all the cookies. If I repeat the same procedure on a different browser the same thing happens. Does anybody know what may be the cause of this ? Thank you


title: jQuery ajax call throws an HTTP 302

text: I'm trying to implement a jQuery Autocomplete where the Autocomplete gets its data from a ajax source. However, for some reason when I make the call it results in a 302 which in turn results in a 404. This is what I have: **In functions.php:**               function my_ajax_foo() {       die("OK");     }          add_action('wp_ajax_my_ajax_foo', 'my_ajax_foo' );     add_action('wp_ajax_nopriv_my_ajax_foo', 'my_ajax_foo' );      **My Javascript:**               function onGetData(term, callback) {       jQuery.post( "http://mydomain.com/wp-admin/admin-ajax.php", {         action: "my_ajax_foo",         cookie: encodeURIComponent(document.cookie),         term: term       },       function( response ) {         console.log( response );       } );     }          jQuery(document).ready(function() {       jQuery("#my_input_field").autocomplete( { source:onGetData } );     });      All the Javascript is loaded correctly. When I type in the Autocomplete input box the ajax call is made but I can see in Firebug that the call results in a HTTP 302. When I call the `http://mydomain.com/wp-admin/admin-ajax.php` simply from the browser URL I get a `-1` returned so I know that the URL exists. Any help much appreciated.