title: What triggers these wordpress queries on my homepage?

text: I am trying to clean up my wordpress theme and I want to know what triggers the following questions on my blog homepage. First - do I need this on my homepage?:               SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (1)          require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/baracuda/index.php'), setup_postdata, get_userdata, get_user_by, WP_User->init, WP_User->for_blog, WP_User->_init_caps, get_user_meta, get_metadata, update_meta_cache      Second:               SELECT * FROM wp_users WHERE ID = '1'


title: WP Multisite: load content from site X on site Y

text: I'm running a WP multisite-network on my professional website (http://mydomain.com). I'd like to play around with jQuery Mobile and deliver a different website and web experience to mobile users, so I created another site in this network on http://m.mydomain.com. On the main (desktop) WP site, I created a "project" content type to sort my professional projects. On the mobile site I'll create, I'd like to be able to load these projects (from the desktop-WP db) instead of having to recreate all the projects to the mobile-WP site. I already worked on something similar: I had to access WP content through a subdomain of the main WP site, using the 'require wp-load.php' technique, but I'm wondering if there is a built-in function in WP to do this in a cleaner way, as both sites are on the same network.


title: PHP Notices appear when browsing any page in admin, but only for child theme, using code from WP Codex

text: My php_error.log in my console (locally on OSX) is reporting 3 PHP Notices. The PHP Notices only appear when browsing each admin page in the back-end for a site (running multisite) that uses a child theme. The child theme uses the parent theme's sidebar.php which the code below is placed in. The PHP notices do not show for the site that uses the actual parent theme. Also, if I make another sidebar.php in the child theme, then the notices are still present. Interestingly, these notices do not appear when browsing the site locally, and everything works as expected. They only appear when browsing around the admin. The code in my sidebar is the exact code from this page on the WP Codex. The exact code is:               <?php      if($post->post_parent) {      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");      $titlenamer = get_the_title($post->post_parent);     }          else {      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");      $titlenamer = get_the_title($post->ID);     }          if ($children) { ?>          <h2> <?php echo $titlenamer; ?> </h2>     <ul>       <?php echo $children; ?>     </ul>          <?php } ?>      Any the PHP notices are:               PHP Notice:  Trying to get property of non-object in sidebar.php on line 10     PHP Notice:  Trying to get property of non-object in sidebar.php on line 16     PHP Notice:  Trying to get property of non-object in sidebar.php on line 17      The lines in question from the above code are:               if($post->post_parent) { // line 10     $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); // line 16     $titlenamer = get_the_title($post->ID); // line 17      Any ideas why these notices would be appearing in the admin pages and only for the child theme? Should I just ignore them?


title: Customize Buddypress adminbar

text: I want to customize the buddypress admin bar, so I created this file and put it in the plugins folder: bp-custom.php Here is a copy of the code: http://pastebin.com/PcQRMXyJ How can I make the first link the main link and the others dropdowns?


title: how do i remove posts from a WP_Query so the pagination is right?

text: I'm using a custom post type and showing 20 of them per page on the homepage. I'm using QP_Query. One custom field for the custom post type (called mixtapes) is a checkbox called "unreleased" (set to true/false), and its basically a post that i dont want to include in the loop. So far I put a conditional if inside the while loop to display only if 'unreleased' isnt set to 'true', but the problem is its (obviously) not applying to the loop itself, so as a result... the pagination 'sees' 40 posts (2 pages) when really theres only 1 unreleased album (which should be 1 page, but 2 pages show up). on the 2nd page, is no results. Likewise when i want to show the 'top 10' albums which ARE released, it actually shows only 9 because the one unreleased one hasnt been removed from the actual loop, only conditionally 'hidden' after the fact. How might i work this out so the loop keeps track of the posts that have been removed given a certain custom_field condition? Thnkas


title: Hide long product description by default on page load (woocommerce)

text: I can't figure out how to have the woocommerce long product description hidden by default when a product page is loaded. It looks much better, when the visitor has to click on "D


title: Customize the menu by adding items

text:
I need to display a simple menu like this:                                      My Company          Home          One page     Two page     Three page     About
         Login
      For this I proceed in this way: /theme/function.php               <?php     // Adding Log in/out links to a Specific WordPress Menu     add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );     function add_loginout_link( $items, $args ) {         if (is_user_logged_in() && $args->theme_location == 'primary') {             $items .= '
Logout
';         }         elseif (!is_user_logged_in() && $args->theme_location == 'primary') {             $items .= '
Login
';         }         return $items;     }      /theme/header.php               <?php     $menuParameters = array(       'theme_location' => 'primary',       'fallback_cb'     => 'starkers_menu',       'container'       => false,       'echo'            => false,       'items_wrap'      => '%3$s',       'depth'           => 0,     );     echo strip_tags(wp_nav_menu( $menuParameters ), '
' );     ?>      I can not manage the class pages for current and the tags (span) for the first url (home). Thank you in advance for your help. cordially


title: How to Display Image Meta underneath EVERY image in EVERY post

text:
First off, I want to say thank you for taking the time to even read this, I really do appreciate the help this site and it's community has given me thus far. * * * i have looked forever to be able to find a way to append (display inside an added div) some image meta data just below EVERY image in EVERY single post. I have found some stuff for NextGen Gallery and some other things, but that is way too much bloat, I just want to attach a div and a couple spans, with a little php thrown in there! I am building a fairly huge magazine style website, and a lot of the images will need to be accredited to photographers who don't directly work for the site. I have been searching for a way to do this via php, not js. I like the plugin Media Custom Fields it lets me add a couple extra lines of meta to every media file, which is perfect. I don't need any help with pulling that meta out and displaying it once I know how to append something to every image. Meaning that, after someone can help me find out how to add stuff to all the images, i should be able to take it from there! I know that this code does not work or make sense, but maybe some of you can figure out exactly what I need from this example, I hope! :                   add_filter('image', 'add_stuff',);         function add_stuff($image_meta)              {                 $image_meta = '';                      $author_name = get_post_meta($post->ID, "tamcf_author_name", TRUE );                 $author_website = get_post_meta($post->ID, "tamcf_author_website", TRUE);                          if (is_single() && (is_image())                         {                         foreach( $images as $image )                              {                             $image_meta .= '
' . $author_name . '' . $author_website . '
';                             }                         }                  $image .= $image_meta                 return $image             }      That is pretty much what I need to happen, if you all can understand that!


title: Update custom category fields front-end

text: **Been using this answer -->> (link)** to create some custom fields in my categories   and it works great ! my only problem is that i have a frontend form that allows   creating new categories with an unrelated form and i would like to insert   values for my custom fields as well as each category pre-defined fields i am currently adding the built in fields aka category name, slug & description   using wp_insert_term using this small check & insert script               if($_SERVER['REQUEST_METHOD'] == "POST")  {         $clientName = $_POST["clientName"];         $term_id = $_POST["clientName"];         $clientKeywords = $_POST["clientKeywords"];         $clientSlug = $_POST["clientSlug"];         $parent = '';              $errorType = 'Category "'. $clientName .'" Added!';                  wp_insert_term($clientName, 'category', array(             'description'=>$clientKeywords,             'slug'=>sanitize_title($clientSlug),             'parent'=>$parent         ));      }      .   **Again.. inserting the custom fields values from the backend using the code i have found in the answer i have linked from at the beginning of my question works very well but i have tried a lot of ways to make it work from the front- end / integrate it with wp_insert_term and have not succeeded so far.** Any help would be most appreciated


title: Access last visit time to a post

text: Is there any function or a way to access the time of last visit to a post by a visitor?


title: Get 1 more post in loop

text: In a simple loop, for example:               $loop = new wp_query(array('posts_per_page' => 3));          while($loop->have_posts()) : $loop->the_post();         if(get_post_meta($post->ID, 'skip_me', true) == true){             // do something to ask for one more post,              // as we really want 3 total!             continue;         } else {             the_content();         }     endwhile;      If a certain condition is met, we might pass over a post, but what if we still _really_ want to get exactly 3 posts? Rather than arbitrarily asking for extra posts and then stopping after 3 successes - is there any other way to ask of the loop, to get one more post? I suppose with this exact example the easiest thing would be to do a `meta_query` within the arguments. But what if it weren't that easy?


title: How to change the post title to h1

text: Here's a quick question: how do you change the post title to be h1 instead of h3 as it is by default? Can it be done from the CMS or from the actual code? Is there a plugin for this? Thanks and let me know if I need to edit my question before downrating!


title: Displaying Overlay images over thumbnail of category type?

text: How would I place an overlay image over a thumbnail of a certain category. For example. I have the category "Videos" how would i place a playbutton image over the thumbnail, while making it all link to the post. But i have different thumbnail sizes as well.


title: How to register_sidebar() without messing up the order?

text: How do you register a sidebar in a plugin without screwing up the pre-existing registered sidebars? (The ordering of the sidebar registrations, rather than the assigned ID, determines the sidebar data.)


title: CSS styling not working in a custom metabox

text: I have some difficulies styling Meta Box content of a custom post. No CSS styling is applied. I made a really simple testbased on what I have read on the other post here. metabox creation:               add_meta_box('wpptabs_company_details', __('The Meta box name', 'wpptabs'), array(&$this, 'render_meta_content'), 'wpptabs', 'normal', 'high');      Meteabox content:               <label> THIS IS TEST </label>      This is waht I have tried with css               .postbox label{color : red!important;  }     #meta_wpptabs_company_details .postbox label{color : red!important;  }     #meta_wpptabs_company_details label{color : red!important;  }     #wpptabs_company_details .postbox label {color : red!important;  }     #wpptabs_company_details label {color : red!important;  }     #meta_wpptabs_company_details {color : red!important;  }     label {color : red!important;  }      This is how it looks like in Chrome with "inspect element" -> link When I wite directly to element.style{} it works, but when I add a new style rule with '+' button a label{} field appears and when I write the style in it it does not work. Here is some evidence the css is loaded: -> link and this is how it looks in page source in header               <link rel='stylesheet' id='wpptabs-config-table-css-css'  href='http://namio.pl/wp-content/plugins/wp-pricing-tables/css/admin.css?ver=null' type='text/css' media='false' />      And this is how I load the css:               class MyClass {          function __construct() {         add_action('admin_enqueue_scripts', array(&$this,'wpptabs_table_modifier'));         add_action('admin_print_styles', array(&$this,'wpptabs_enqueue_styles'));       }          function wpptabs_enqueue_styles() {             global $typenow; if ($typenow=="wpptabs") {             wp_register_style('wpptabs-config-table-css', WPPTABS_URLPATH . '/css/admin.css', 'null', 'null', 'false');             wp_enqueue_style('wpptabs-config-table-css');             }         }         I have no idea what else it could be. If some more details are needed please let me know.


title: esc_url not working within add_settings_field callback

text:
I'm trying to display a saved option of a url inside a text input on my themes' options page, but it's just simply not displaying. I've checked the database and my url is saved using the specified option name, I've tried simply echoing the option without escaping and I've also tried using the same esc_url() function outside of the add_settings_field() function and it does work there. The settings and sections are already registered as well. This leads me to believe I'm missing something stupidly obvious, or this may be a bug in the Settings API. Any help is appreciated, thanks.               function outputFavIcon(){ ?>         <input class='uploadUrl' id='upload_fav' type='text' size='50' name='fp_smart_options[general_settings][fav_icon]' value="<?php esc_url($settings['general_settings']['fav_icon'],array('http','https')); ?>" />         <input class='uploadButton' id="upload_fav_button" type="button" value="Upload Fav Icon" />
         <?php _e('Enter a URL or upload an image for your fav icon. This should be 16 x 16 pixels'); ?>.         <?php if(isset($settings['generel_settings']['fav_icon'])){             echo "
";         }     }     add_settings_field('fpFavIcon', 'Fav Icon', 'outputFavIcon', 'flexipress', 'fpUploadables');


title: WordPress.com Stats plugin is requiring login, and redirecting to WordPress.com on login

text: I have my own private installation of Wordpress I've installed the wordpress.com stats plugin, so I get a stats feature like you get on the free wordpress blogs, its nice and simple, and works well Now on my blog, all I can see on the plugin (on my dashboard) is a login screen, and when I try to login it redirects me to my free blog (which I had to setup to get an API key) **Why has my plugin suddenly started requesting a login? It has been working fine for 2 weeks now** The login it expects is the login of my free blog, and when I do provide those credentials it redirects me to my free one. Screenshot of what I see on my dashboard :![alt text](http://i.stack.imgur.com/wbuwX.jpg) Tried to de-activate and re-activate plugin, no luck


title: Is it ever okay to include inline CSS in plugins?

text: Normally in a plugin I would add styles using wp_enqueue_style. However, I am currently creating a plugin that only needs a few lines of CSS and I am wondering if it might be better to serve the styles inline to save a request. Obviously there are many advantages to using wp_enqueue_style, but are they worth the extra request for such a small piece of CSS? Is there any accepted 'best practice' in this area?


title: Commenting on a post from the admin panel?

text: I'd like to create a Q&A-type forum for my wordpress site, where anyone can submit a question, and then the forum admin would answer the question and then post the question/answer combination. How I'm thinking this works would be along the lines of the question object being a Post, and then the answer being a reply to the post. However, to make it easier for the admin, I'd like to have everything set up as a nice workflow in the admin panel -- just read the post, comment on it, and then publish the lot. Is what I'm thinking doable? I don't really have a lot of fiscal resources for plugins (like this question) suggests, but I have enough programming gumption and know-how to put some elbow grease into the solution. Is there a similar solution that would solve my problem without the posts/reply structure that I've missed in my Googling? Thanks in advance.


title: Using index.php as page template

text: When you put a name at the top of your index.php like:               <?php     /* Template Name: Blog Template */      ?>      it will work for front-page and it will also create a new page template. I'm wondering if this is allowed and done on purpose? Are there any pitfalls of using index.php as page template?


title: Validate Login Register Form in Fancybox

text:
Hi i am using this form to show my Login, Register and Forgot form in Fancybox. I have installed Easy Fancybox Plugin to show this form in Fancybox. Here is the Code:-

Sign in to yourwebsitename
         <?php $args = array(                'echo'           => true,               'redirect'       => site_url($_SERVER['REQUEST_URI']),               'form_id'        => 'loginform',               'label_username' => __( 'Username or Email address' ),               'label_password' => __( 'Password' ),               'label_remember' => __( 'Remember Me' ),               'label_log_in'   => __( 'Sign In' ),               'id_username'    => 'user_login',               'id_password'    => 'user_pass',               'id_remember'    => 'rememberme',               'id_submit'      => 'wp-submit',               'remember'       => true,               'value_username' => NULL,               'value_remember' => true );              wp_login_form( $args );?>
Forgot your password?

Don't have an account? Sign up!

Sign up for yourwebsitename
           <form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" class="user_new" id="user_new" method="post">                  <input id="user_login" name="user_login" size="30" type="text" placeholder="Select a username">                       <input id="user_email" name="user_email" size="30" type="text" placeholder="Email address">                       <?php do_action('register_form'); ?>                      <input id="register" type="submit" value="Sign up">           </form>
A password will be emailed to you

Already a user? Sign in!

Get new password on your registered email-id
            <form name="lostpasswordform" id="lostpasswordform" action="http://insanespirits.com/wp-login.php?action=lostpassword" method="post">               <input type="text" name="user_login" id="user_login" class="input" value="" size="20" placeholder="username or email-id">                    <input type="hidden" name="redirect_to" value="<?php echo home_url().'/profile.php';?>">                    <input type="submit" name="wp-submit" id="wp-submit" value="Get New Password">           </form>
Would like to try again ? Sign in!

                  Sign in             Sign up!      How can i validate each field when the user types ? For Eg. In Login Form If Username Exists then show user name Vaild In Sign Up Form Validate . This User Already Exists or This Username is Available. EMail - This Email is already used. Something like that. Can Anybody Help?


title: Redirect authors from upload.php url to Home page in Multisite

text: I would like to redirect authors when they visit the URL `mynetwork.com/OWNBLOG/wp-admin/upload.php` to another page. How can I do that? I tried this code but i received this error : > "Warning: Cannot modify header information - headers already sent by (output > started at /home/content/59/104129/html/wp-admin/includes/template.php:1642) > in /home/content/59/10412659/html/wp-includes/pluggable.php on line 876" :               add_action( 'admin_head-upload.php', 'redirect_media_library_wpse_93626' );          function redirect_media_library_wpse_93626()     {         // Stop if not Multisite         if( !is_multisite() )             return;              // Stop if is main site         if( is_main_blog() )             return;              // Stop if is administrator         if( current_user_can( 'add_users' ) )             return;              // Finally, redirect         // wp_redirect( site_url( 'personal-page' ) ); // http://subsite.example.com/personal-page         // wp_redirect( 'http://example.com' );         wp_redirect( admin_url() ); // http://subsite.example.com/wp-admin         exit();     }


title: Wordpress: paginating array using a foreach

text:
I currently grab an array of user data from a query. I then use a foreach to loop through them and apply styles and divs to output them to the page. This all works great but i would like to paginate the array into the wordpress paged option. So if the user has set the max posts per page to be 10 and the array contains 20 results i want to stop at 10 and have a link to view the next page which would show 11-20. I have done something similar in the past with the standard wordpress loop with a if have posts thing with:               <? $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;?>          <?php if ( have_posts() ) : ?>     $limit = get_option('posts_per_page');          $args = array(         'paged' => $paged,     'post_per_page' => $limit     );     query_posts($args);?>     <?php while (have_posts()) : the_post(); $counter++; ?>      Then i would have the prev / next links:               <?php if ($counter == $limit) { ?>
<?php next_posts_link('Next »') ?>
     <?php } ?>     <?php if ($paged > 1) { ?>
<?php previous_posts_link('« Prev') ?>
     <?php } ?>      I want to do this same logic for my foreach:               <? foreach ($all_members as $member) {?>          //Do Loop Stuff        <?php } ?>      Any ideas on how to do this?


title: Filter the URL of next_posts_link & previous_posts_link

text: I am working with the qTranslate plugin to create a multi-lingual website. The plugin does a great job of translation except for on the `next_posts_link` & `previous_posts_link` template tags. When a user has selected a different language the URL should change from: http://mysite.com/test/page/2 (for default language) to http://mysite.com/fr/test/page/2 (for french language) The plugin provides functions for modification/translation of URLs using the `qtrans_convertURL($url)` function. The problem I am having is finding a suitable hook or filter that will allow me to modify the URL output by the next_posts_link & previous_posts_link template tags. The closest two WordPress filters I have found are:               add_filter('next_posts_link_attributes', 'my_next_attr');     add_filter('previous_posts_link_attributes', 'my_prev_attr');      Any tips would be most welcome.


title: How to remove "Super Admin" from All Users for those that are not a "Super Admin"?

text: I would like to remove the filter at the top that says "Super Admin" for users that are not a "Super Admin". How do I go about doing this? This screenshot shows what I am talking about: ![enter image description here](http://i.stack.imgur.com/ldX5i.png)


title: Why use foreach to get attachment_id if numberposts is equal to 1?

text: I needed to pass an image to a Pinterest plugin in posts without a Featured Image so I wrote a little function to get the id of the first picture in a post. This code is in the `loop-single.php` where the sharing buttons are located.               if ( has_post_thumbnail()) {         $thumb_for_pinterest = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );     } else {         $attachments = get_children( array(             'post_parent'    => get_the_ID(),             'post_type'      => 'attachment',             'numberposts'    => 1, // show all -1             'post_status'    => 'inherit',             'post_mime_type' => 'image',             'order'          => 'ASC',             'orderby'        => 'menu_order ASC'         ) );              foreach ( $attachments as $attachment_id => $attachment ) {             $thumb_for_pinterest = wp_get_attachment_image_src($attachment_id, 'full' );         }     }      My question is this: why do I need to use a `foreach` to get the `attachment_id`?   Specifically, what is this line doing?               foreach ( $attachments as $attachment_id => $attachment ) {...      I believe an associative array is being returned with only 1 object in it. However, when I tried to just pop the object out of the array and use it I got lots of errors. Only by putting it in the `foreach` could I get the image id out. Is there an easier way to get the `attachment_id` of the first image in a post? I have read a lot of questions and googled this quite extensively, but couldn't understand it completely.


title: excerpt box not visible

text: i'd like to use excerpts but for some reason the excerpt editor is not visible when editing posts. i'm using wordpress v3.1 - already searched up the options but couldn't find anything .. :( do i need a plugin for using excerpts? shouldn't it be included by default in wordpress? thanks


title: wp_enqueue_script jquery and jquery ui not working

text: I am using the following script to call my Jquery and Jquery UI as well as a custom-script.js. Currently it works to the point of being able to see the resource in the inspector and the tag's are outputted. However the code I use on the page like .datepicker just doesn't work. However If I use a hacked script tag and include my own jquery files my code works and .datepickers works. You can view the site at http://fiftyfity.com/place-an-order/ this is the version with the wp_enqueue_script running. I am stuck I want to use enqueue but it breaks my site. **wp_enqueue_script**               function wptuts_scripts_basic()      {         // Register the script like this for a plugin:         //wp_register_script( 'custom-script', plugins_url( '/js/custom-script.js', __FILE__ ) );         // or         // Register the script like this for a theme:         wp_register_script( 'custom-script', get_template_directory_uri() . '/js/custom-script.js', array('jquery','jquery-ui-core') );              // For either a plugin or a theme, you can then enqueue the script:         wp_enqueue_script( 'custom-script' );     }     add_action( 'wp_enqueue_scripts', 'wptuts_scripts_basic' );      **Ouputted Html**               <script type='text/javascript' src='http://fiftyfity.com/wp-includes/js/jquery/jquery.js?ver=1.7.1'></script>     <script type='text/javascript' src='http://fiftyfity.com/wp-includes/js/jquery/ui/jquery.ui.core.min.js?ver=1.8.16'></script>      **My hacked script tag** *this works If I comment out the wp_enqueue_script               $url = content_url();     <script src="<?php echo $url; ?>/themes/fiftyfityNew/js/jquery-1.7.1.min.js"></script>     <script src="<?php echo $url; ?>/themes/fiftyfityNew/js/jquery-ui-1.8.17.custom.min.js"></script>


title: Permalink not working for page without title

text: I am testing a Wordpress theme using the Wordpress Theme Unit Test test data. One of the test posts has no title. Wordpress generates a permalink of the form:               <my-site>/posts/14/      (my permalink structure is "/posts/%postname%/"). The Wordpress recommendation is "Post permalink should be displayed. Making the post date a permalink is a great solution." That's exactly what I did. Unfortunately, when I click on the link:   * I do not get the post in question. The page I do get appears to be the similar to the paged index of all posts, except that all non-paged posts are displayed in full, instead of as excerpts.   * The page navigation is incorrect. The link for older posts is "/posts/14/page/2/", which causes the same page to be redisplayed.  If I change the post slug to "post14", it works just fine, so the problem is evidently due to the numeric slug. Obviously I could change the slug, but that's not a real solution. Once the theme gets out in the real world, I can't guarantee that users will always use post titles or that they'll know enough to change the slug. Any suggestions?


title: Restored my site using a backup. Seems to be OK but the posts are empty?

text: Hope you all can help me. I made a stupid mistake and tried to clean up some of my unused categories and found out later on that it broke my site. How can deleting a category break your site? Unfortunately, I wasn't able to do a backup and asked my webhost FatCow to do a site restore. They gave me a backup which I used to restore the site. The site currently looks ok from the outside, but if you click the posts, most of it is either empty or incomplete! Only the first part is showing. Some posts are complete but most aren't. Is there anything else I can do? Hope you guys can help me. My website is http://www.swimbikerun.ph


title: Using theme options to change link colours

text: I'm developing a WordPress theme with some theme options (using the ThemeShaper sample theme options page), and one of the options I want is to allow users to set their own link colours. At the moment I can get the hex value they set (say #134679 or something) and spit it out somewhere, but I don't know how to include it in the theme. Presumably it needs to be dynamically added to a stylesheet (or a new stylesheet dynamically generated?) or something like that, in order to then be linked to from the theme's pages and all start to work. If so, how is this done? And what's the 'best' way to do it? Thanks. Edit: I'm not a PHP person, at all, so... layman's language, please. :)


title: How to style first post differently with 'get_template_part'?

text: I need help in styling the first post differently than the rest. What makes this differently is that I'm using this get_template_part in order for infinite scroll to work on my site. This is what I use on index.php               <?php while (have_posts()) : the_post();     get_template_part( 'content', get_post_format() );     endwhile; ?>      which will load the loop from content.php. This was my old loop:               <?php if (have_posts()) : ?>     <?php $post = $posts[0]; $c=0;?>     <?php while (have_posts()) : the_post(); ?>     <?php $c++; if( !$paged && $c == 1) :?>          <-! first post -->          <?php else :?>          <-! the rest -->          <?php endif;?>     <?php endwhile; ?>     <?php endif; ?>      Thanks for the help.


title: Link categories to last post

text:
I am using wp_list_categories() to show all my categories. But I would like that the child categories link to the last post of that category. For example:

CATEGORY 1

CATEGORY 1.1

      How can I do it?


title: How Do I Use jQuery UI In My Plugin

text:
It's a sad day in the world when I Google something and it returns nothing. I am trying to use the default datepicker (or ANY datepicker at this point) and am unable to because of my lack of knowledge with Wordpress/PHP. In my plugin, I am attempting to register jquery and the ui and apparently am breaking other parts of WordPress in the process. Can someone please tell me what I'm doing wrong and if they can provide a working solution, I will scrap all of my code:               add_action('init', 'add_styles');          function add_styles(){         wp_deregister_style('simpleschoolstyles');         wp_register_style('simpleschoolstyles', SSM_STYLEFILE);              wp_deregister_script( 'jquery' );         wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js');              wp_deregister_script( 'jquery-ui' );         wp_register_script('jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js');              wp_deregister_style( 'jquery-ui' );         wp_register_style( 'jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/pepper-grinder/jquery-ui.min.css' );              wp_deregister_script('maskedinput');         wp_register_script('maskedinput', SSM_PLUGIN_URL . '/includes/js/jquery.maskedinput.min.js');              wp_deregister_script('simpleschool');         wp_register_script('simpleschool', SSM_PLUGIN_URL . '/includes/js/simpleschool.js');     }          add_action('wp_enqueue_scripts', 'load_scripts');     add_action('admin_enqueue_scripts', 'load_scripts');          function load_scripts()     {         wp_enqueue_style('jquery-ui');             wp_enqueue_style('simpleschoolstyles');         wp_enqueue_script('jquery');                wp_enqueue_script('jquery-ui');         wp_enqueue_script('maskedinput');         wp_enqueue_script('simpleschool');     }      I need jQuery to be available in the admin area as well as the front-end for user data-entry. Please someone help. I am near pulling my toenails off as I have ripped all of my hair out already...I am assuming that I must be enqueueing at the wrong point in time, but again, due to my limited knowledge of WordPress, I have dug myself a grave quickly. **UPDATE:** I modified my script and now only loading jQuery UI and have tested that jQuery and the UI are both loaded and have success for those two, but not an existing object in the DOM:               add_action('init', 'init_scripts');          function init_scripts(){         wp_deregister_style('simpleschoolstyles');         wp_register_style('simpleschoolstyles', SSM_STYLEFILE);              //wp_deregister_script( 'jquery-ui' );         wp_register_script('jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js');              //wp_deregister_style( 'jquery-ui' );         wp_register_style( 'jquery-ui-pepper-grinder', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/pepper-grinder/jquery-ui.min.css' );              //wp_deregister_script('maskedinput');         wp_register_script('maskedinput', SSM_PLUGIN_URL . '/includes/js/jquery.maskedinput.min.js');              //wp_deregister_script('simpleschool');         wp_register_script('simpleschool', SSM_PLUGIN_URL . '/includes/js/simpleschool.js');              wp_enqueue_style('jquery-ui-pepper-grinder');         wp_enqueue_style('simpleschoolstles');         wp_enqueue_script( 'jquery' );         wp_enqueue_script( 'jquery-ui' );         wp_enqueue_script('simpleschool');     }      My Test:               jQuery(document).ready(function(){         //jQuery('.datepick').mask("99/99/9999");         //jQuery('.phone').mask("(999) 999-9999");         jQuery( '.datepick' ).datepicker( 'option', 'dateFormat', 'yyyy-mm-dd' ); // <-- this fails ????             alert('jQuery BETTER BE LOADED!!!'); // <---this worked         jQuery('
crazy wordpress and their php
').dialog(); // <--- this worked too     });


title: Hook to change Custom Tag Taxonomy Links?

text: I have a **Custom Post Type** named **News** that has a URL structure like this... `domain.com/news/news-post-name` I have also added a Custom Tag Taxonomy for my News Post Type. Here is my Re-write settings for it...               $news_posts_tag_args = array(             'rewrite' => array(                     'slug'                       => 'news-tag',                     'with_front'                 => false,                     'hierarchical'               => true,             )     );      This makes mt **News Tag** have a URL like this... `domain.com/news-tag/news-TAG-name` However I would like my it to appear that I have `tag` under my **News Post Type** So that it will instead be like this... `domain.com/news/tag/news-TAG-name` I am able to achieve this by using the Re-write code below...               function custom_taxonomies_rewrite(){         add_rewrite_rule('^news/tag/([^/]*)/?','index.php?news_tag=$matches[1]','top');     }     add_action('init','custom_taxonomies_rewrite');      So far everything works great but I then have to make sure to edit anything that links to the **News Tag Taxonomy** to make sure it uses my new custom URL structure for that Taxonomy. So I am hoping someone can help me with the next step of my process by helping to to hook into Tag links so maybe I can change the links more easily?


title: Categories in custom post types

text: I'm having some custom post type but I want to add categories for it. Not for the URL(-structure) but for an archive page, which shows every category after each other. So the items are organized. Anyway to do this or isn't this possible?


title: How to create a master without relying on posts table

text: Just I want to create the Project master, there I'll maintain the fields like 'Project type', 'Project Category' and 'Project name'. I've created the table in DB. I thought it is easy to achieve in Custom post type. So I followed the following steps   1. Created the custom post type as 'Project'   2. Created the Meta box and fields to get the user input for 'Project type', 'Project Category' and 'Project name'   3. On save, via hook 'save_post', I got the user input through $_POST and saved the data in custom table( eg: wp_projects )   4. The real problem occurred while listing the entries, I've used the 'custom_column' function, but it requires the post ID. But I haven't used post table to save the Projects.   5. In 'custom_column' function I don't know how to iterate the Project table entries without using Post ID One of my colleague suggest me to use 'wp_list_tables' class to list the entries in the custom table. I did the same, but here I'm not sure what will be the link to edit the custom table entries. I'm struggling to create the master without using the Posts table. I don't want to insert the entries unnecessarily in post table, because that table is not suites to the Project table fields. Thanks in advance.


title: wp-config.php file permissions

text: I have installed Wordpress on my local Ubuntu machine, with standard LAMP configuration and phpMyAdmin. The installation directory is `localhost:///var/www/blog`. At the second step of the installation, after I've entered the MySQL configuration, the following message appeared:               Sorry, but I can’t write the wp-config.php file.      Current permissions are:               -rw-r--r-- 1 adam adam 2.0K Oct 23  2010 wp-links-opml.php     -rw-r--r-- 1 adam adam 3.2K Nov  1  2010 wp-config-sample.php     -rw-r--r-- 1 adam adam 3.7K Jan  8  2012 wp-trackback.php     -rw-r--r-- 1 adam adam  271 Jan  8  2012 wp-blog-header.php     -rw-r--r-- 1 adam adam  395 Jan  8  2012 index.php     -rw-r--r-- 1 adam adam 3.5K Apr 10  2012 wp-comments-post.php     -rw-r--r-- 1 adam adam  20K May  6  2012 license.txt     -rw-r--r-- 1 adam adam  18K Sep 11  2012 wp-signup.php     -rw-r--r-- 1 adam adam 2.7K Sep 11  2012 xmlrpc.php     -rw-r--r-- 1 adam adam 2.7K Sep 23  2012 wp-cron.php     -rw-r--r-- 1 adam adam 7.6K Sep 25  2012 wp-mail.php     -rw-r--r-- 1 adam adam 2.4K Oct 26 21:40 wp-load.php     -rw-r--r-- 1 adam adam 4.6K Nov 17 17:11 wp-activate.php     -rw-r--r-- 1 adam adam 9.7K Nov 22 11:52 wp-settings.php     -rw-r--r-- 1 adam adam  29K Nov 30 15:40 wp-login.php     -rw-r--r-- 1 adam adam 9.0K Jan 24 22:50 readme.html     drwxr-xr-x 9 adam adam 4.0K Jan 24 22:53 wp-includes     drwxr-xr-x 4 adam adam 4.0K Jan 24 22:53 wp-content     drwxr-xr-x 9 adam adam 4.0K Jan 24 22:53 wp-admin     drwxr-xr-x 4 root root 4.0K Apr  1 14:52 ..     drwxr-xr-x 5 adam adam 4.0K Apr  1 14:55 .      I've added `a+w` permissions to the blog folder:               chmod a+w       And now everything works, but I don't know if it's safe to grant global write permissions to that folder. **Which file and directory permissions should I set on a new Wordpress/LAMP installation?**


title: How to set thumbnail image for a (child) theme

text: I've created a basic child image for twentytwelve, and it works as expected. The only issue is that it does not have a thumbnail image in the themes page: ![enter image description here](http://i.stack.imgur.com/5AJkU.png) How do I set a thumbnail image for my child theme?


title: Meta query with timestamp using WP_query

text:
I'm having a problem with an events system that I'm developing for a local roller derby leaugue. I have made a custom post type (' _event_ ') where a user can add a few different types of events (taxonomy: ' _event-type_ ', terms: ' _bout_ ', '*fresh_meat_day*' and '*public_event*'). A user can also enter a title, description, location and date for which I use a custom field (not the normal post date). I display the events on a designated events page (events.php) and I want to show the first upcoming event for each category on my landing page. I have no problems with the events page. It shows a nice table displaying each upcoming event ordered by date (ASC). My problem is in the ordering of the events on the landing page. I'm using this code to display the events on my landing page:               <?php      $post_type = 'event';        $tax = 'event-type';     $todaysDate = date('d.M.y');     $todaysString = strtotime($todaysDate);          $tax_terms = get_terms($tax, array('orderby' => 'id', 'order' => 'ASC'));         if ($tax_terms) {             foreach ($tax_terms as $tax_term) {                      $args = array(                     'post_type' => $post_type,                     "$tax" => $tax_term->slug,                     'post_status' => 'publish',                     'posts_per_page' => 1,                     'meta_key' => 'event_date',                     'meta_compare' => '=',                     'meta_value' => $todaysString,                     'orderby' => 'meta_value',                     'order' => 'ASC',                     'caller_get_posts' => 1                 ); // END $args                      $my_query = null;                 $my_query = new WP_Query($args);                 if ($my_query->have_posts()) { ;?>
                     <?php while ($my_query->have_posts()) : $my_query->the_post();                     ?>

                                 <img src="<?php bloginfo("template_directory"); ?>/images/events_freshmeat.png" />

                                         <?php echo '
Next '.$tax_term->name.'
';?>
<?php the_title(); ?>

                 <?php                     endwhile;                 } // END if have_posts loop?>
                 <?php wp_reset_query();             } // END foreach $tax_terms         } // END if $tax_terms     ?>      I get totally no output from this code except when I remove the line where it says               'meta_vale' => $todaysString;      If I remove that line, I get to see 3 upcoming events like it should and it shows the event name, but not in the right order (the event showing isn't necessarily the first upcoming event, but in stead the first event that I added). I'm totally stuck on this one and I really need to get the events ordered in the right way. Any help would be greatly appreciated. Cheers!


title: How to get_term_children output in alphabetical order?

text:
How do i get output of this in alphabetical order               <?php         $termID = 5;         $taxonomyName = 'area';         $termchildren = get_term_children( $termID, $taxonomyName );              echo '
';         foreach ($termchildren as $child) {             $term = get_term_by( 'id', $child, $taxonomyName );             echo '
name, $taxonomyName ) . '">' . $term->name . '
';         }         echo '
';     ?>


title: get_transient(), PHP switch(), and comparison operators

text: Im using a WordPress transient, which expires after an hour, to store a value which is an integer. Im trying to use `switch()` and multiple `case()` statements to evaluate if the transient exists or not (i.e true or false). Here are my questions:   1. Which comparison operator (`=`, `==`, `===`), in example 2, is ideal for this context?   2. Which of the following examples is appropriate?   3. Would the following examples yield the same result? Example 1:               $transient = get_transient( 'foobar' );          switch( $transient ) :              case( true ) :             // do stuff         break;              case( false ) :             // do stuff         break;          endswitch;      versus Example 2:               $transient = get_transient( foobar );          switch( $transient ) :              case( $transient = true ) :             // do stuff         break;              case( $transient = false ) :             // do stuff         break;          endswitch;      Thanks in advance.


title: Display a registered user profile page

text: I have a website where users can register, login and their edit profile, they can comment but not post. What I am looking for is a way to display a user profile page (where I display the gravatar and the info about the user) clicking on the username. The url must be something like "www.mywebsite.com/user/username". I know about author.php, but I don't know how to link even if the user has no posts and is not an author. **UPDATE:** I managed to solve it. Instead of linking using `<?php the_author_posts_link(); ?>` I did an href linking to `www.mysite.com/user/<?php echo $user_info->display_name; ?>` To rename the slug I installed the Edit author slug plugin, it makes the author slug editable under Settings > permalinks. To customize the user profile, just edit authors.php as you like.


title: passing '&' in return function of add_filter

text: I have below line in my return function of `add_filter` in wordpress.               add_filter('the_content', 'my_drama_func');      function my_drama_func () {         return "function getthrough() {             jQuery.ajax({                 url: 'ajax/ajax.php',                 type: 'POST',                 data: 'url='+url+'&un=0&pretty=1&mega=0&click=true',                 beforeSend: function(b) {..snip..},                 error: function(e) {},                 success: function(s) {}             });         }";     }      but in content page of view source, it is available as :-               jQuery.ajax({         ....ajax rest code...         //Below line is giving trouble. :(         data: 'url='+url+'&un=0&pretty=1&mega=0&click=true',         ...ajax rest code..     });      But my requirement is to pass it as it is with '&' and not any special character of html. How can this be achived. Thanks


title: Stop loading "collaborators" users on add new post or page?

text: So our website has about 20k "collaborators" type of users and we'd like to stop loading all of them on the select box on the "add new post" or "add new page" PAGE. Maybe load only authors and above type of users using functions.php Could anybody help? =)


title: Too many redirects when using wp super cache

text: For a couple of days i use the wp super cache plugin and it works quite well. I also updated to the latest version of wordpress which is currently Wordpress 3.4.1. Whenever i update something in the posts. I can browse the front page of my blog but on the single page i get a too many redirects error. When i go to settings > permalinks and update the permalinks without any changes the blog is doing fine. Is there some magic setting that avoid this behavior?


title: I would like to alert message while another user is editing or update data in wordpress admin panel, what should i do?

text: My question is that when one user is editing and have another user is editing the site too , I wanna get one alert message to tell the user that now who is editing.


title: plugins_url function mixes system path and URL

text: In my WordPress widget I use the following code:               wp_register_script('jquery-ui.widget', plugins_url('assets/js/jquery-ui-1.9.2.widget.js', dirname( __FILE__ )));      Unfortunately, the code gives me an invalid URL which is mixed with my system path:               http://test.dev/wp-content/plugins/C:/projects/wordpress/plugins/assets/js/jquery-ui-1.9.2.widget.js?ver=3.6      Is this problem maybe related to the fact that I have a local WordPress installation running on a Windows computer (with Apache 2)?


title: using the loop on a page

text: I'm trying to display the excerpt of the most recent post and just the titles of the 4 previous posts before that at the top of a page and display the content of the page below. I have a solution that's close and works but not sure if I need to reset query and how to get excerpt on most recent post and title on 4 previous. Here's the page with post titles at top (B's recommended articles) and the content (that can be edited) of the page is underneath. Here's the code http://pastebin.com/41x30Uyb


title: Add and Remove fields in Profile page

text: Registration Form Fields: (Front-end Registration)               Username,     Email (password will generate to email).      Edit Profile: (Front-end Edit Profile)               Firstname,     Lastname,     Username,     Email,     Phone,      Address,     Zip / postal code,     Website,     State(Drop down-Dynamic),     Country(Drop down),      Newsletter (Check box),     Change password.      The above fields are required for their corresponding pages. Currently, i am using Theme My Login Plugin for Front-end Login and Registration. and, Cimy User Extra Fields Plugin for Registration page fields editing. (but, it has no option for adding fields and changing fields in profile page.) How can we do this by using Custom code editing or Plugin? If there is any plugin to do this, tell me the Plugin name and Download links. If it is possible only by Custom code editing, please guide me how to complete this.


title: Gravatar always shows default image

text: When I call the following code:               echo get_avatar(         get_the_author_meta('user_email'),          '70',          get_bloginfo('template_directory')."/images/default.png"     );      It generates the following: > > > [http://1.gravatar.com/avatar/f456a030d4086504d0796f0134139410?s=70&d=http%3A%2F%2Fblogs.com%2Fscience- > and-medical%2Fwp- > content%2Fthemes%2FBlog%2Fimages%2Fdefault.png%3Fs%3D70&r=G][1] >   It is adding to the end of the default URL:               %3Fs%3D70      This prevents it from working and always returns the default image. If you remove the extra data from the URL it works.


title: How to list updates using WordPress XML-RPC methods

text: Can any one tell me how I can list the updates using WordPress **XML-RPC methods** , like how we list **posts** and **comments** using `wp.getPosts` and `wp.GetComments`. I searched for the methods but I couldn't find any.


title: Proper way to enqueue a generated script that isn't in a .js file?

text: What's the proper way for loading a script via WordPress that isn't in a `.js` file?   I'm generating some javascript on the fly based on some field options in a plugin. I want to load it into the page, but I want to do it the right way. How should I proceed?


title: How to Control user registrations directly on sub-sites

text: Does anybody have Idea to enable a wordpress based multisite user to automatically get access to all sub-sites under same Multi site ? If I have _A Multi-site_ installation(Also Buddypress enabled) at **mysite.com** .And the sub-sites created by my friends and their friends are **sub1.mysite.com by A, sub2.mysite.com by B ,sub3.mysite.com by C** and so on My friends **A** and **B** wants to allow registrations on their websites to run member ship sites like bookmarking sites etc .So every website runs as a separate member ship site.If a User **X** want to join in **sub1.mysite.com** .He clicks on 'Register' and will be redirected to the main site and get registered there. He will come back to the sub-site manually entering the URL again.Even if he is an existent user of the Network.The sub-site owner should give him a subscriber or Editor privilege to post or access that sub-site. I want a functionality that a new person should be able to join directly on any sub-site.If the person is an existent user he should be able to login simply. The plugin suggested by Andrea is useful but it is only useful to set ' who is eligible to join' .But again the users need to go to main site to registration .Later the sub-site owner should manually set the privileges .Even an existent user doesn't have any privileges to access the sub-site if we use this plugin. Because the sub-site owner should allow the user manually. My wish is that,the Network owner should have *An option to control the sub-sites whether or not to allow a specific sub-site to use registrations.  *The sub-site owners also should have option to decide whether to allow a user to register or not.  *This is the basic functionality.A user should able to join if the sub-site owner allow the registration,without out waiting for privilege setup manually. _The first two options are available with the plugin. But the third one is not available._ Sorry if the question is too long and wasting your time


title: Removing a Parent Theme's Menu Items

text: I have a parent theme that is using this code to create menus:               function cornerstone_menus() {              register_nav_menus(             array(                 'header-menu-left' => __( 'Header Menu (left)', 'cornerstone' ),                 'header-menu-right' => __( 'Header Menu (right)', 'cornerstone' ),                 'footer-menu' => __( 'Footer Menu', 'cornerstone' )             )         );          }     add_action( 'init', 'cornerstone_menus' );      In my child theme, I want my own menus, so I've created them, but these three parent theme menu items still show up in the Appearance > Menu section. I have a function in my child theme that removes the menus:               function remove_cornerstone_menus() {         unregister_nav_menu( 'header-menu-left' );         unregister_nav_menu( 'header-menu-right' );         unregister_nav_menu( 'footer-menu' );     }      but I don't know what action to tie it to in order for it to work. I assumed that since the menu creation is being called in the "init" action, I could do this:               add_action('init', 'remove_cornerstone_menus');      But the menus still show up. I read elsewhere that I needed to hook into the after_setup_theme action, so I tried this:               add_action('after_setup_theme', 'remove_cornerstone_menus');      But that didn't work either. I'm at a loss as to how to remove the menus. I can manually remove them, but if the theme updates I'll have to do it again, and I'm trying to avoid that, which is why I'm using a child theme. Can anyone point me in the right direction?


title: I w'd like to know If there are simple solutions to integrate other CMSs to wordpress

text: I w'd like to know If I can Integrate my other web-sites created to my wordpress multisite using the CMSs like   * Dolphin ( integration discussion )    * Oxwall   * status.net   * sharetronix   * peoplepods   * yetanotherforum   * vidiscript   * Tikiwiki   * shapado (script, inspired by stackoverflow) ( seems to integrate with wordpress.com via OpenID ) These are the Opensource scripts for social networking and micro blogging.I have the websites created with all these scripts for different purposes like social networking and micro blogging .I w'd like to Integrate these websites to my wordpress multi site.So my users need not sign up/sign in for every site and access all of them with single account . There are some other users of dolphin and shapado who are willing to integrate their site to wordpress .So I have listed all the scripts using for my websites .So this topic may be useful to others who are looking for Integration of the popular Opensource CMSs to wordpress . Right now we have some SSO plugins which allows us to login using popular logins like facebook,google etc. But these SSO modules are not available for the above mentioned scripts .How ever the direct Integration is always helpful . Does any body have Idea on this?


title: Disable automatic linking

text: How can I disable automatic linking? For example if I write http://www.test.com I don't want it converted to a link.


title: Associate an existing image with a post

text: I'm trying to associate an existing image from the media library with a post (It's a custom post type), If I use `wp_insert_attachment` I get a duplicate in the media library, so I'm getting the image `id` and using that as the `attach_id`.               $attach_id = intval( $file['id'] );     $attach_data = wp_generate_attachment_metadata( $attach_id, $filename );     $result = wp_update_attachment_metadata( $attach_id,  $attach_data );      This doesn't work and the `$result` is false. I'm sure I'm missing something simple. Can anybody enlighten me?


title: Is there a way to display Woocommerce nav filter widget filters for shop page in all headers?

text: I'm trying to display the Woocommerce nav filters on the home page so visitors can filter all the shop products from any page (when they hit the filter they will be taken to the shop page as usual). What I wanted is to include it on the header to accomplish this but it doesn't work. To my understanding it loads only when the shop loop is loaded. I tried to do a custom loop but that didn't work.


title: Slider's missing navigation

text: I've got BuddyPress and Easy FancyBox installed, I've also got carouFredSel slider (not the WordPress plugin). When those two plugins are enabled, slider stops working properly (navigation bullets are missing). Could it be some kind of jQuery conflict? Here's header.php: http://pastebin.com/eBLpFBZ9 and here's page with the slider: http://adamklimowski.pl/chamois/ Thanks in advance for any help you are able to provide.


title: Print out last 3 blogposts

text: From problem to problem, disco to disco :P My template requires that i print out headlines of 3 last blogposts in the header of my template. Its single page layout so those blogposts will link to posts that will be on page anyway - just somewhere down the line... Since im complete wordpress newbie - i've already required help with creating this whole single page layout: Single page theme Modified home page query does not yield expected results Long story short - i created app hook, that changes original query to include all pages. These blogposts need to be taken care of before we get to parsing the pages. What i tried - following some examples i set up something like this:                           <?php                 $args = array(                      'orderby' => 'ID',                      'order' => 'DESC',                      'post_type' => 'post',                     'post_status' => 'publish',                     );                 $children = get_pages($args);                 foreach( $children as $post ){                     setup_postdata($post);                     get_template_part( 'header', 'blogheader' );                 }                 wp_reset_postdata();                 ?>      Yes the query does not include the posts limit 3 - but so be it. What this gives me - exactly nothing. If i comment everything out from those args, then i get my main query. Even just one argument, like 'post_type' => 'post' - i get nothing. This led me into thinking that all those args are just modifying the original main query, not creating new one. Fine. I replaced `get_pages($args)` with `new WP_Query( $args );`. Now i got funny results - whole load of posts - even though i actually have just one, original, "hello world" post. It prints out even posts that have no title (im guessing they are drafts or something, even though i have not created any draft blogposts). So what i want - i thought that setting post_type to post will give me blogposts only - i was wrong. What parameters do i have to set to get only published blogposts, sorted by id? Alan


title: get_post_custom single array

text: Is there a way to return single values only when I run               get_post_custom($post_id);      it seems that I'm receiving double array, even when there only one value for this meta_key


title: Site Crashes When Updating to WordPress (Version 3.6)

text: I was just clicking the update button behind in the admin panel. it said no enough space in my hosting. then i went and removed some files and tried again then it was processing the wp update. suddenly it took me to a blank page and now the entire site looks empty. I am guessing this could be due to space limitation in hosting account. even though i removed a few and tried updating, it might have meet not enough space in the middle of updating and its leading to this issue. Also in the mean time i tried accessing this page: `www.mywebsite.com/wp- admin/update-core.php` and got the below error. > Fatal error: Call to undefined function nocache_headers() in > /home/webmas8/public_html/azraar/wp-admin/admin.php on line 32 This is the website that causes the issue: http://www.azraar.com/


title: How to remove only pages from Admin Bar?

text: How can I remove only pages from Admin Bar? ![enter image description here](http://i.stack.imgur.com/PcVpv.jpg)


title: woocommerce: restrict customer to log to see price and exclusive products

text: I am using woocommerce2.0.13 to showcase products for a wholesale selling business. we have products exclusively available to customers. So customers are our registered members and they can see only the products that they are subscribed to. Also they should not see the price of th eproduct until logged in. The shop is offline, so I have hidden add to cart and checkout functionality. Can you plz suggest how to achieve the restricted access to products and price. Also how to manage the customers? I have just used basic woocommerce plugin. Plz suggest me any extensions?


title: What is the $menu parameter used of in wp_nav_menu()?

text: I have a theme where I register multiple menus in function.php. All menus have a unique name and a simple description (we just use the name of the theme so they all have the same desc but thats ok). In our templates we use the following code               wp_nav_menu(array('theme_location' => 'sub_menu_manager', 'menu' => 'Manager', 'sort_column' => 'menu_order', 'container_class' => 'manager-menu', 'menu_class' => 'template-menu'));      Can someone explain what 'menu'=> 'Manager' does please? Thanks


title: custom post on homepage

text: How would I include a post from a specific category on my homepage in buddypress? Example I have a category 'Homepage Banners' with an ID of 3. In the admin I create a post and assign the 'Homepage Banners' category to it. I then need this to show up on the homepage (the latest post). I am new to WP/BP, any help appreciated. Thanks.


title: Is website for online game guides doable in WordPress?

text: It will almost work as blog but: Writers will work only with one kind of content "guide". They will write it in markup language with custom tags that will be replaced by presets. They will choose game version they write against. When game will be updated presets will also be updated to much new game mechanics. Writers will be notified about such changes with list of changes relevant to their guide (based on the list of tags used, that got changed!). Since whole content (with comments) could be moderated, there may be need for ranks, badges, points, etc. for users, so they would like to moderate it themselfs. Readers will search for guides via rating, game version, categories, etc. (Creation date will be irrelevant!), will rate and comment them. As you can see both writers and readers will be users to my website. And main selling point will be:   * Help with keeping guides up to date for writers.   * Help with providing game data via simple tags for writers (so they write less, and make less mistakes)   * Help with searching for relevant guides for readers. As for admins, modderators:   * Keeping tags and presets up to date will be critical (probably there will be new set of those for every game update -- every 2-3 months)   * Moderating guides is requirement, moderating every comment may be requirement, so ability to offload such work onto users themselfs would be very good! (Like peer review for guides). **Can I do such website in WordPress?** Will it require much work with customization? PS If you know better tags, title for this question change them or leave comment below!


title: Wrong theme being activated

text: I have two installations of Wordpress in Network mode. In one network, when I change a theme of any one of my network websites, one particular network website has it's theme changed to the same theme I set the first one to. In the other network, a similar thing occurs, in that a particular theme has become stuck, and will not change to a new theme, Why is this occurring? **Clarification** : Changing the theme of one network website will change the theme of another website. I don't want this interaction happening. Also, no matter what I do with the 2nd website (the one which inadvertently had its theme switched), I can't get the theme to go back to the one I want - the new theme is stuck there. Changing the theme makes no difference, the imposter theme remains active. DEBUG INFO: > Notice: register_sidebar_widget is deprecated since version 2.8! Use > wp_register_sidebar_widget() instead. in /home/doig/public_html/wp- > includes/functions.php on line 2638 > > Notice: register_widget_control is deprecated since version 2.8! Use > wp_register_widget_control() instead. in /home/doig/public_html/wp- > includes/functions.php on line 2638 > > Notice: wp_register_style was called incorrectly. Scripts and styles should > not be registered or enqueued until the wp_enqueue_scripts, > admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for > more information. (This message was added in version 3.3.) in > /home/doig/public_html/wp-includes/functions.php on line 2758 > > Notice: wp_enqueue_script was called incorrectly. Scripts and styles should > not be registered or enqueued until the wp_enqueue_scripts, > admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for > more information. (This message was added in version 3.3.) in > /home/doig/public_html/wp-includes/functions.php on line 2758 > > Notice: automatic_feed_links is deprecated since version 3.0! Use > add_theme_support( 'automatic-feed-links' ) instead. in > /home/doig/public_html/wp-includes/functions.php on line 2638 > > Notice: Undefined variable: post in /home/doig/public_html/wp- > content/themes/vermillon/functions.php on line 70 > > Notice: Trying to get property of non-object in /home/doig/public_html/wp- > content/themes/vermillon/functions.php on line 70


title: Wordpress multidomains and subfolders

text: Is it possible to have wordpress installed in subfolder (e.g.: example.com/wodpress-installation ) as multisite / folders, and have the folders as example.com/foo or example.com/bar or it must be example.com/wordpressinstallations/foo or example.com/wordpressinstallations/bar


title: Undefined is_user_logged_in() error with Plugin Query code

text:
I'm getting an:                Fatal error: Call to undefined function is_user_logged_in() in C:\wamp\www\benracicot\wp-includes\query.php on line 2521      If I remove the $args from WP_Query I get no errors and I can print the return object (all empty values) What am I doing wrong in my plugin query code?               function getPostIDsByMonth($month){         $args = array( 'monthnum' => 1, 'post_type' => 'post' );         $ids = new WP_Query($args);         return $ids;     }          $months = 1;     $bymonth = getPostIDsByMonth($months);     print_r($bymonth);     echo $bymonth->post_count;     if (! empty($bymonth)){               while($bymonth->have_posts()): $bymonth->the_post();              ?>
<?php the_title(); ?>
<?php              the_content();          endwhile;          }


title: Create post thumbnails from images stored outside of uploads directory

text: I am redoing some of my older blogs and I noticed with the new themes most of them take advantage of featured images which is fine. The problem is a lot of my older posts that was never set either because I did not use it or because it didn't exist. Now I know of the featured thumbnail plugin the regenerates your posts and it grabs the images from your post and makes a thumbnail which is great and that works, but I have some posts where the images were not stored in the uploads folder where the plugin seems to be looking and those posts fail. Any thoughts on how I can get these featured images without going through every single post manually?


title: Conditionally load CSS/JS/PHP in wp-admin if using a mobile device

text: I'm looking for a way to conditionally load different scripts if the user is accessing the admin area from a mobile device. In my case I'm looking to restrict the user to just be able to make new posts, so if you log in to the admin area from a mobile device you're redirected to the post listing and the admin menu isn't even available. Ideas?


title: Change function in responsive theme

text: I have this code on my header: `$rPosts->query('showposts=3&cat=2174');` But I want to show 4 posts on desktop and 2-3 on mobile. In CSS I could use @mediaqueries, could I use something like that on PHP? Thanks,


title: .htaccess redirect not properly working [ ?utm_source=]

text: I have a wordperss blog. This blog has two domain names (example1.com and example2.com). In my situation, example1.com redirected to the example2.com. This redirecting work properly. I saw that Google bot continually indexing my Feedbuner and Wordpress RSS feeds utm_source URL parameters. Then I have added following code to the .htaccess file, above the mod_rewrite rules.               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteCond %{QUERY_STRING} .     RewriteCond %{QUERY_STRING} !^(s|p)=.*     RewriteCond %{REQUEST_URI} !.*wp-admin.*     RewriteRule ^(.*)$ /$1? [R=301,L]     </IfModule>      Now new domain (example2.com) URL parameters are automatically redirecting to the original posts. But the old domain (example1.com) URL parameters contain URL gives 404 error. For an instance now old domain URL parameters links give following type 404 error URL (final URL). http://www.example2.com/example1.com/2013/05/myblogposts.html How do I fix this issue?


title: How to output comments number of a post per day?

text:
I have a question about the comment numbers in a post... For now, I can output the total number of a comment inside a post outside the loop. That's cool enough, but I want to get **show the comment number/amount of a post PER DAY**. So let's say I have a post and people are commenting 10 times today... Than, I want to show ' 10 comments' after the post title... If the day goes by and just 1 person comments the next day, I want it to output '1 comment' after the post title... Is this possible, if yes, how? I want to use the following function to output this "comment today per post after each post":               function wowPosts($num) {         global $wpdb;              $posts = $wpdb->get_results("SELECT comment_count, ID, post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , $num");              foreach ($posts as $post) {             setup_postdata($post);             $id = $post->ID;             $title = $post->post_title;             $count = $post->comment_count;             $comment_count = get_comment_count($post->ID);             $all_comments = get_comment_count( array ( 'post_id' => get_the_ID() ) );                  if ($count != 0) {                 $popular .= '
';                 $popular .= '' . $title . ' '. count( $all_comments ) . ' ';                 $popular .= '
';             }         }         return $popular;     }


title: Passing widget options to external script

text: I am trying to pass some widget options to an external script using `wp_localize_script`. I know how to pass the variables and how to use them within the script, but how do I extract the widget options to pass them as an array to the script? Here is what I have currently:               class WidgetName extends WP_Widget {         public function __construct() {                  // load plugin text domain             add_action( 'init', array( $this, 'widget_textdomain' ) );             add_action( 'wp_enqueue_scripts', array( $this, 'register_widget_scripts' ) );              }              // This is what i'm having a problem with         public function register_widget_scripts() {             $options = get_option('widget-name');             wp_localize_script('handle', 'obj-name', $options);              }         // The rest of the widget code goes here     }


title: Displaying shortcode in footer

text: Using SMOF as a backend admin and trying to include a shortcode in the text field for inclusion in the footer. I am generaing the shortcode as               // Add Shortcode     function copyright_shortcode() {         // Code         return '<?php echo date("Y") ?>';     }     add_shortcode( 'copyright', 'copyright_shortcode' );      and calling the data from the SMOF options panel as so               <?php global $data; echo do_shortcode($data['footer_text']); ?>      The footer is generating the text from the field however, it is putting the shortcode data in `<!-- -->.`


title: WordPress Bones theme, changing default Excerpt amount of words

text: Been back and forth with this one and cannot find anything on the Themble site about this. I am trying to shorten the length of the_Excerpt from 55 words to 20. Have checked the codex and know what I need to do and tried implementing several options to no avail. Upon doing a folder search for "excerpt" I came across this in the bones.php file                // This removes the annoying […] to a Read More link      function bones_excerpt_more($more) {      global $post;      // edit here if you like      return '...  ID) . '"              title="'. __( 'Read', 'bonestheme' ) . get_the_title($post->ID).'">'. __( 'Read            more »', 'bonestheme' ) .'';      }      with a call earlier up the in the page to                // cleaning up excerpt      add_filter( 'excerpt_more', 'bones_excerpt_more' );      In the bones_excerpt_more function I have tried adding some random text to see if it will output the text which it didn't. Tried removing all of the content of this function and it made no difference either which tells me this is not even being called. Originally in my functions.php file I had this from the Codex.                  function custom_excerpt_length( $length ) {            return 20;        }        add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );      I tried changing the priority but nothing's happening there either so I am at a loss and cannot find any more documentation in the bones theme even though it is very well documented in my opinion. Many thanks


title: find posts with exactly 3/4 categories

text: I see wordpress gives you opportunity for searching posts with exactly N categories...so i tried by myself and produced this code...               $catIDs = get_cat_ID( $cat_name='CategoryName1' );     $catIDs .= ',' . get_cat_ID( $cat_name='CategoryName2');     $catIDs .= ',' . get_cat_ID( $cat_name='CategoryName3');     echo "$catIDs </br>";          $my_query = new WP_Query( array( 'category__and' => array($catIDs) ) );     if( $my_query->have_posts() ) : while( $my_query->have_posts() ) : $my_query->the_post(); ?>     <li>         <a href="<?php the_permalink(); ?>"> <?php the_ID(); ?> </a>     </li>     <?php endwhile; endif; wp_reset_postdata(); ?>      if i replace the array($catIDs) with 1,2,3 (the ID of the category) this solution works....why with the variable $catIDs it doesn't? and how can i make this solution dynamic (i have a form and i would pass the data in this form -category name/ID in this case)


title: Lock one of WP Network sites for not registered users

text: I have a blog network (Multisite), with domain mapping plugin installed, and some of my sites are under development, so I want to lock them from not registered users. I tested a few plugins designed for this purpose ( _Private Only_ , _Private WP suite_ , _Private WP_ , _Members Only_ , _Registered Users Only_ , _Absolute Privacy_ and _Wp-Private_ ) and all failed. I accessed site, saw login form, filled it in, marked "Remember Me", logged in and I was redirected to Dashboard (user section) not to site itself. When I re-entered site URL (domain) I again saw login page, though I marked "Remember Me". There is not way I can access site itself. I even wrote my own, as simple as possible, plugin for this:               function show_guest_notice()     {         if(!is_user_logged_in())         {             echo('No way, man!');             die();         }     }          add_action('get_header', 'show_guest_notice');      and it also failed. It seems that either `is_user_logged_in()` or string user cookie fails on Multisite with Domain Mapping plugin. I saw this post and answer by _amontobin_ (" _(...) was a domain mapping cookie issue. Now working fine_ "), but it only assured me that using Multisite with Domain Mapping is source of these problems, but it brings no solution to it. So, can anyone help me or got any idea how to make site bloking (`is_user_logged_in()`) work on Multisite network with Domain Mapping plugin enabled?


title: Conditional display for custom fields/taxonomy

text: If there's a value for the custom field, I want it to display the value. If there's no value for the custom field, I want it to display "N/A". I have this working for custom fields but cant replicate the same functionality for a custom taxonomy. This works for a custom field:               $url = get_post_meta( get_the_ID(), 'event-code', true );     if ( ! empty( $url ) ) {     print ( $url );     }     else {     print 'N/A';     }      In the case of a custom taxonomy entry with a value, this displays both the value and "N/A":               $promtax = the_terms( get_the_ID(), 'promotion','' );     if ( ! empty( $promtax ) ) {     print ( $promtax );     }     else {     print 'N/A';     }      I've used variations and combinations of isset, empty without any luck. Thanks.


title: Is it safe to use Web Invoice 2.1.0 without SSL?

text: Is it safe to use Web Invoice 2.1.0 without SSL, (if only interfacing with it using Paypay)?


title: Any recommendation on how to manage ads?

text: I am in the process of creating a network of >40 sites with wordpress, and I am trying to put together the base that each site will use, for example all the sites will use google analytics so I will use this http://wordpress.org/extend/plugins/google-analytics-for-wordpress/ plugin for that. For sitemaps I will use http://wordpress.org/extend/plugins/bwp-google- xml-sitemaps/, etc. (These plugins works well with wp multisite) All the sites will use google adsense, so I was wondering if someone knows some plugin or something that will help managing the ads directly from the dashboard, taking in count this will be a multisite environment. I browsed the wp plugins directory but I didn't find anything good, I'd like to hear if someone is already using something for managing ads and such.


title: I want to add to a side bar a Featured Blogs rss feed and looking for suggestions on how to do that in Wordpress

text: Blogger.com has a gadget called Blog List that aggregates a list of selected blogs in a RSS feed format. One way of using it on wordpress is to create a blogger blog that contains only the Blog Links then pulling that RSS into wordpress. What would like to do in a sidebar widget include the same feeds (right now five blogs) showing the most recent post as they are posted. These would not be my own blogs. If someone has seen this done and can point me to the page or suggest a plugin that might do what I'm looking for


title: Best Browser for Editing Posts

text: What browser is best supported by Wordpress.org for editing posts in the visual editor (which I guess is TinyMCE)? I use Google Chrome and have run into issues which are specific to just this browser. Here's an example bug.


title: Add current class to queried term on taxonomy term archive

text:
I'm currently using get_terms to list terms of a certain taxonomy. I would like to add a class to the term currently being queried via the archive template. I tried putting together the below code but this bizarrely results in the class being applied to not just the current term being queried but every term AFTER it as well. I've tried comparing the slugs, ids and names of $term and $currentterm - all of which output correctly.               $terms = get_terms('MYTAX');     $currentterm = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );     foreach ($terms as $term) {       if($currentterm->slug == $term->slug) $class = "live";       echo '
slug .'">' . $term->name . '
';     }


title: Media sizes aren't being created - server config?

text: I have 3 sites with WordPress on a RedHat Centos server. Everything were fine until days ago, when I needed to recompile Apache to use mb_string, so I did it using WHM "Easy Apache". But from then, my sites aren't creating image sizes. I mean, when I upload an image, aditional sizes (already defined on functions) aren't created. If I look inside media folders, only the original file is there, and none thumbnail or extra sizes. When I try to insert media inside posts, no aditional sizes appears on menu. Any idea on what happened? Thank you all.


title: Unable to get Wordpress auto update working on Ubuntu 12.04

text: I'm getting a tiny bit fed up with having to `chown 777` my entire Wordpress folder in order to auto update a plugin, and then set the permissions back again. I've looked around for fixes now, but no fix I try seems to work. I'm on an Amazon EC2 instance running Ubuntu 12.04. So, the Apache2 installation is stock standard out of the box, runs as the www-data user. I've set my owner:groups to my entire project to ubuntu:www-data, and the permissions through the bank is set to `***rwxrwx--r**`, or `774`, meaning that either the ubuntu user, or the www-data group will have full read/write access to the file structure. Whenever I try to update Wordpress however, it asks me for FTP/SFTP details, so in order to get that going away, I need to run `chown -R 777` ... on the entire project folder. That's annoying, and I've got no clue as to why this is happening. How can Wordpress execute something other than the Apache2 user?


title: Image not showing up in media loader success area - followup

text: This is part two to this question: Post Specific Uploader I am using an upload filter to put files in a location based on `post_id`. Now when the file uploads, the URL path in the meta is wrong and the image preview is broken (missing the `post_id`). the URL shows as: `http://foo.com/blog/wp-content/uploads/icon_jpeg.png` but should (in this case) be: `http://foo.com/blog/wp- content/uploads/571/icon_jpeg.png` This part is truly magic to me. Should the path be correct if those were the value when the file was uploaded? Is there a query param I need to change? Thanks for helping a WP noob! Cheers.Bo


title: How to set post author to custom post field via front-end form?

text: hope someone can help. I have my WP install configured to capture posts via a front-end form. Users do not log in, which is an explicit requirement. The author should be set based on a custom post field (by matchting the emailadress filled out in the form). Authors do have a profile already. I found the wp_insert_post_data() function, assuming this could provide what I was looking for, and wrote a small plugin to set the author from default to submitter. However, it changes the post data _before_ it is inserted into the database. Ergo: it can't set an author based on meta for a post that isn't inserted/doesn't exist yet. In effect, submitted posts don't have an author at all. How can I work around this problem and automatically set the author of a post based on a custom field within that post _after_ the post is created? I've been combing through the references/codex but couldn't recognize anything that could solve this. Any suggestions? Hope so! Best of luck & cheers, -Pim


title: wpdb getting avatars and author url

text:
Running an SQL query to pull authors by votes they've received on posts. @bonger helped me out on my first post and helped me get this working great, but I created this new question since it's a separate issue.               <?php                                   global $wpdb;                              $date2 = date('Y-m-d', strtotime('-60 days'));                               $weekly = $wpdb->get_results ( "                        SELECT u.display_name as name,                         ( SELECT                           CONCAT_WS('.',                             SUM(CASE WHEN p.post_date > '$date2' THEN pm.meta_value ELSE 0 END),                             SUM(pm.meta_value))                           FROM wp_posts p, wp_postmeta pm                           WHERE p.post_author = u.ID                           AND p.post_status LIKE 'publish'                           AND pm.meta_key = 'epicredvote'                           AND p.ID = pm.post_id ) as votes                           FROM wp_users u                           ORDER BY votes+0 DESC LIMIT 0,5                     " );                                             foreach ($weekly as $result) {                             $name = $result->name;                             list( $weekly_vote, $total_vote ) = explode( '.', $result->votes ? $result->votes : '0.0' );                             // do stuff with $name, $weekly_vote, $total_vote ...eg                             echo $name, '
',  ' Weekly Karma: ', $weekly_vote, '
',' Total Karma: ', $total_vote, '

';                         }                          ?>      After doing some look around I've run across some example code that I'm having trouble integrating with this. I'd like to have name link to the author URL and to display the author avatar. Something like ->               ID ) . '">' . get_the_author_meta( 'user_nicename' , $author->ID ) . '                  ' . get_avatar( $author->ID , 40 ) . '                  ' Weekly Karma: ', $weekly_vote, '
',' Total Karma: ', $total_vote, '

';


title: how to insert content into my taxonomy

text: how to insert content into my taxonomy this code is correct or not?                  // Create post object       $my_post = array(      'post_title' => 'My post',      'post_content' => 'This is my post.',      'post_status' => 'publish',      'post_author' => 1,       'tax_input' => array( 'taxonomy_name' => array( 'Newpostlist' ) ) ,       'post_category' => array(8,39),             );                // Insert the post into the database            wp_insert_post( $my_post );


title: How to check main site user level from subsite in a multisite network

text: I'm using wordpress multisite. I installed s2member plugin. s2member plugin creates 4 extra level. I mean like level1,level2,.... I'm displaying content using this code               if (current_user_can("access_s2member_level1")){           the_content();      }      Here level1 member is premium member. If the user is not a premium member then the content will be hidden. ## My problem I created separate site for each niche. I'm the only admin for all sites. My goal is user buys the premium account in my main site and access all my site network without paying extra money. But s2member work for only for that individual site. Its not working globally. So i was thinking like `activate s2member only in main site and check the user level from subsite. If the user level is 1 then display the content` So can anyone help me how to check main site user level from sub site? I mean like this               if (current_user_can("access_mainsite_s2member_level1")){               the_content();          }      Thanks


title: Remove Tag from theme support

text: I would remove Tag capability from classic Post type, can I use `remove_theme_support( $feature );` and how to do this ? Thanks in advance


title: Post Specific Uploader

text: I have played around with filters for uploading files. The closest I have gotten is to have the files uploaded to the directory, but after the file uploads, I get a series of errors: `Undefined index: post_id` I think the issue is as simple as not having access to the current post id. I have tried `$wp_query->post->ID;` and `$post->ID` and neither seem to work. These files would always be associated with a post. The last iteration of the code I am using:               // filter for uploads         function ml_media_upload_dir($upload) {              $id = $_REQUEST['post_id'];         $parent = get_post( $id )->post_parent;                  if (isset($_REQUEST['post_id'])) {                 $upload['path']    = "/foo/www/folder/blog/wp-content/uploads/" . $id;                 $upload['url']     = "http://foo.com/blog/wp-content/uploads/" . $id;                 $upload['basedir'] = "/foo/www/folder/blog/wp-content/uploads/" . $id;                 $upload['baseurl'] = "http://foo.com/blog/wp-content/uploads/" . $id;                      if (!file_exists("/foo/www/folder/blog/wp-content/uploads/" . $id)) {                     mkdir("/foo/www/folder/blog/wp-content/uploads/" . $id, 0777);                 }             }                       return $upload;         }         add_filter('upload_dir', 'ml_media_upload_dir');      I even tried adding another 'insert media' link with the post_action=1 param to test. (`http://foo.com/blog/wp-admin/media- upload.php?post_id=571&TB_iframe=1&post_action=1&width=640&height=567`) How can I ensure that if there is a post_id, that the file gets loaded into the specific folder? Any help.. cheers! Bo


title: Run shortcodes in custom setting value that holds user supplied HTML in my header?

text: My plugin I built for a client shows a special header type banner/head section for a visitor on every nTH visit to the site. I have a setting where the user picks the number for `nTH` visit to show this header content and then a setting which holds the HTML to show. My problem now is my client is trying to run HTML mixed with shortcodes in it and the shortcodes obviously don't work, how can I detect a shortcode in my custom setting text so that I can then cal the shortcode with PHP?


title: Setting Up Scheduled Tasks (For Scripts to Run)

text: I am going to make a script that requires a scheduled run time. What is the best way to do this in Wordpress? Or maybe this can be done through some PHP method? I'm having a hard time finding even a clear place to start on this. > Forgive the vague tag. "chron, scheduled" and other helpful tags were > rejected by system and couldn't submit.


title: Login form not saving values when login incorrect

text: I am using a login form created with the following...               <?php $args = array(             'value_remember' => true );              wp_login_form($args);     ?>      It works great but if somebody puts an incorrect password in then the page reloads and instead of keeping the username in it is blank. The person then has to re-enter it, is there anyway to get it to save this value?


title: Open WordPress Posts in Bootstrap Modal

text:
I am looking for some assistance in opening WordPress posts in the Bootstrap Modal. Right now I have a home page with a grid that pull posts. I have it setup so that each post is in a square box and linked to open the Bootstrap Modal window. The modal window should pull the data from the post which is clicked. At this time, it only opens the latest post on the page no matter which post is clicked. I assume I need to let the model window know which post has been clicked so it can pull the correct data but I am at a loss. Any help would be appreciated. Here is my current code:                   <?php get_template_part('templates/page', 'header'); ?>     <?php if (!have_posts()) : ?>
       <?php _e('Sorry, no results were found.', 'roots'); ?>
     <?php get_search_form(); ?>     <?php endif; ?>
       <?php while (have_posts()) : the_post(); ?>       <?php     $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, '' );     ?>              <div class="span2" style="background: #09F url(<?php echo $src[0]; ?>) center no-repeat !important;">         <?php get_template_part('templates/content', get_post_format()); ?>

             <?php the_title(); ?>

<?php the_post_thumbnail(); ?>

           <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

                 <?php endwhile; ?>


title: change sidebar or just widgets for 2 specific post type single posts

text: I would like to show a different sidebar for 2 specific posts(same custom post type). I understand how to do this using separate templates for different pages, but I want to have it all happen in the single-posttype.php page. Or am I thinking about this wrong? My end goal is to show different text widgets in the sidebar on specific posts.


title: Pagination between images (active/inactive)

text:
I would like to add a check on the following piece of code that shows the arrows next/prev only if the next/prev image exists:

               <img src="<?php echo $att_image[0];?>"                  width="<?php echo $att_image[1];?>"                  height="<?php echo $att_image[2];?>"                   class="attachment-medium"                  alt="<?php $post->post_excerpt; ?>" />                                   <?php previous_image_link(false); ?>                                                <?php next_image_link(false); ?>

      This is an example of last image of a gallery so the next arrow shouldn't appears. If you have any suggestions, please show me the right way to implement this behaviour :) Thanks in advance, Fabio


title: How to put placeholder text in the main post input area?

text: I'm making a course plugin for a university in England. I'm looking to put some default placeholder text in the main post content area, on the admin side. Its the rich text editor I want it to go behind. I might just be typing the wrong words, but can't find it here... preferably a non js thing... Basically something like 'Use this area to write an introduction to the course...'. Thanks


title: Pinterest Integration Using functions.php

text:
I use a theme to build an portfolio. I´d like to add an pinterest "pin-it button" into the fuctions.php: Facebook, Google+ an Twitter were done, just the pinterest won´t work. Can´t found the the wrong code. This ist my code:               function share_this($content){     if ( is_singular( 'portfolio' ) ) {     $content .= '
' .             /* Facebook */           '
' .                  'ID ) ) .                  '&layout=button_count&show_faces=false&width=200&action=like&colorscheme=light&height=21"' .                  'scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:21px;" allowTransparency="true">' .           '
' .                /* Pinterest */         '
'                   '<a href="http://pinterest.com/pin/create/button/?url=<?php echo get_permalink(); ?>&media=<?php echo get_thumbnail(); ?>                  '&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin It                 ''.         '
' .                /* Googgle+ */         '
<g:plusone size="medium" href="'.get_permalink().'"></g:plusone>
' .          /* Twitter */         '
Tweet
' .          '
';     }      Thanks


title: Images don't update after being edited

text: I have **many** pictures on my site and after posting for a while, I realized that I should have watermarked them. So I did just that, I downloaded all the images and watermarked them. I uploaded a few of them back up to the site using FTP and replacing the images in the wp-content folder and I cleared my cache but the images dont show the updated version with the watermark. Is there no way to edit the image? Do I have to manually re-add the images to WP using the upload button on the page? Thanks for any help.


title: Custom post types templates

text: I have registered a custom post type called "Services" but when I am giving the single post the template "single-services.php" its not accepting this but choosing the "homepage.php" template can u tell the problem? It is also not taking the "archive-services.php" template but instead using the blog template (index.php) UPDATE. Here's the code:               add_action('init', 'services_register');     function services_register() {          $labels = array(         'name' => _x('Services', 'post type general name'),         'singular_name' => _x('Service', 'post type singular name'),         'add_new' => _x('Add New', 'service'),         'add_new_item' => __('Add New Service'),         'edit_item' => __('Edit Service'),         'new_item' => __('New Service'),         'view_item' => __('View Service'),         'search_items' => __('Search Service'),         'not_found' =>  __('Nothing found'),         'not_found_in_trash' => __('Nothing found in Trash'),         'parent_item_colon' => ''     );          $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'query_var' => true,         'menu_icon' => null,         'rewrite' => true,         'capability_type' => 'post',         'hierarchical' => false,         'menu_position' => null,         'supports' => array('title','editor','thumbnail')       );           register_post_type( 'services' , $args );     }


title: WP Clone by WP Academy need to restore using Zip instead of URL

text: I have used WP Clone by WP Academy to clone my old web site. Successfully copied to a new host and have now terminated my old hosting. The new site is now blank. I can not restore from URLsince I have terminated the old host, but I have saved a zip. I need help on how to do this restore using this method? Please Please Please anyone. This was a large site. Rebuilding from scratch is going to be HUGE