Displaying Overlay images over thumbnail of category type?

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.


How to register_sidebar() without messing up the order?

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


CSS styling not working in a custom metabox

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.


esc_url not working within add_settings_field callback

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


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

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


Is it ever okay to include inline CSS in plugins?

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?


Commenting on a post from the admin panel?

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.


Using index.php as page template

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?


Validate Login Register Form in Fancybox

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?


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

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();     }


Wordpress: paginating array using a foreach

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?


Filter the URL of next_posts_link & previous_posts_link

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.


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

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)


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

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.


excerpt box not visible

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


wp_enqueue_script jquery and jquery ui not working

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>


Permalink not working for page without title

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?


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

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


Using theme options to change link colours

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


How to style first post differently with 'get_template_part'?

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.


Link categories to last post

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?


How Do I Use jQuery UI In My Plugin

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     });


Hook to change Custom Tag Taxonomy Links?

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?


Categories in custom post types

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?


How to create a master without relying on posts table

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.


wp-config.php file permissions

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


How to set thumbnail image for a (child) theme

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?


Meta query with timestamp using WP_query

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!


How to get_term_children output in alphabetical order?

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


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

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.


Display a registered user profile page

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.


passing '&' in return function of add_filter

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


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

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


Too many redirects when using wp super cache

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?


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

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.


plugins_url function mixes system path and URL

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


using the loop on a page

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


Add and Remove fields in Profile page

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.


Gravatar always shows default image

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.


How to list updates using WordPress XML-RPC methods

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.


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

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?


How to Control user registrations directly on sub-sites

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


Removing a Parent Theme's Menu Items

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?


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

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?


Disable automatic linking

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


Associate an existing image with a post

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?


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

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.


Slider's missing navigation

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.


Print out last 3 blogposts

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


get_post_custom single array

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


Site Crashes When Updating to WordPress (Version 3.6)

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/


How to remove only pages from Admin Bar?

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


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

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?


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

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


custom post on homepage

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.


Is website for online game guides doable in WordPress?

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!


Wrong theme being activated

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


Wordpress multidomains and subfolders

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


Undefined is_user_logged_in() error with Plugin Query code

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


Create post thumbnails from images stored outside of uploads directory

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?


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

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?


Change function in responsive theme

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,


.htaccess redirect not properly working [ ?utm_source=]

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?


How to output comments number of a post per day?

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


Passing widget options to external script

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     }


Displaying shortcode in footer

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


WordPress Bones theme, changing default Excerpt amount of words

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


find posts with exactly 3/4 categories

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)


Lock one of WP Network sites for not registered users

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?


Conditional display for custom fields/taxonomy

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.


Is it safe to use Web Invoice 2.1.0 without SSL?

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


Any recommendation on how to manage ads?

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.


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

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


Best Browser for Editing Posts

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.


Add current class to queried term on taxonomy term archive

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 . '
';     }


Media sizes aren't being created - server config?

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.


Unable to get Wordpress auto update working on Ubuntu 12.04

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?


Image not showing up in media loader success area - followup

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


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

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


wpdb getting avatars and author url

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, '

';


how to insert content into my taxonomy

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


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

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


Remove Tag from theme support

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


Post Specific Uploader

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


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

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?


Setting Up Scheduled Tasks (For Scripts to Run)

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.


Login form not saving values when login incorrect

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?


Open WordPress Posts in Bootstrap Modal

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


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

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.


Pagination between images (active/inactive)

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


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

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


Pinterest Integration Using functions.php

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


Images don't update after being edited

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.


Custom post types templates

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 );     }


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

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


Is there a capability/User role plugin that lets you specify edit 'posts' not 'custom posts'?

> **Possible Duplicate:**   >  When you create a custom post type, does that also create capabilities for > editing/deleting that post type automatically? I have many custom posts in my wordpress site. I want to add multiple members but I only want them to be able to do two things in the back end, edit their profile and add posts. However, giving them the ability to edit posts and create new ones also allows the option to add and view all custom posts as well. I only want them to be able to add basic wordpress posts.


How can I find the first post in a category that has a featured image and then return the get_the_post_thumbnail()?

I have a function that I thought should find the first article with a featured image in it, and then return that image. Not sure if this is the best way to go about it, as it's giving me a 502 Bad Gateway...               function get_category_post($cat_id){             $finished = false;             $postcount = 0;             $post_args = array(                 'numberposts' => 1,                 'category' => $cat_id,                 'fields' => 'ids'             );             $posts = get_posts($post_args);             while ( $finished != true ) {                 if ( has_post_thumbnail($posts[$postcount]) ) {                     $postthumb = get_the_post_thumbnail($posts[$postcount], $size = 'thumbnail');                     $finished = true;                 }                 $postcount++;             }             return $postthumb;         }


Using plugin functionality in external php script not working

I am encountering a strange problem which I couldn't solve so far. I'm calling a .php script via cronjob (Debian/GNU Linux). To use wordpress functionailty I added:               define('WP_USE_THEMES', false);     require( '/full/path/to/wp-blog-header.php' );      Now database queries and default wordpress functionality all works fine, but I also call some functions provided by a plugin (namely advanced custom fields, the problem however affects other plugins as well as I tested) the following php error is returned:               PHP Fatal error:  Call to undefined function update_field() in executed.php on line 24      Which tells me that the function of that plugin has not been included. So it seems to me that require wp-blog-header.php dies not include plugin functionality (which it did when I started to develop the mentioned script, but now when I tested it, it produced an php error that). Could it be, that the 3.5 upgrade of wordpress changed something here? Or does anyone of you has some piece of advice for me as to why this problem occures? Thank you! **edit** I made further tests. The problem seems to be, that I am executing the php in the shell using following command:               /usr/bin/php5 -q -d memory_limit=256M /path/to/executed.php      Thus certain variables are not set like `$_SERVER['REQUEST_METHOD']` Wordpress would therefore give me warnings in debug-mode. So what I did is, I definied the `DOCUMENT_ROOT` variable, and included my function.php (which was alos not loaded) manualy:               $_SERVER['DOCUMENT_ROOT'] = '/full/path/to/my/document/root/';     define('WP_USE_THEMES', false);     require( '/full/path/to/wp-blog-header.php' );     require_once( '/full/path/to/themes/mytheme/functions.php' );      Now it is working. Yet it seems to me as a mere unhealthy walkaround ...


Is Wordpress Suitable for my site?

I will be starting the development of a site that will allow my users to upload pictures and giving the ability to other people to view them. I just want to know if wordpress is suitable for all these things (payment system, editing the user profiles) because i hear all the time that wordpress is mostly for blogs, but my site has nothing to do with a blog. Thanks in Advance!


Error 310 too many redirects after switching domains

I'm at a loss here. My site is http://www.kgstiles.com and about 70% of my pages now result in a 310 error. There doesn't seem to be any pattern to the error, but one thing I thought was interesting: if I change the slug of a page, it works, but obviously I can't do that for all of them. I tried rebuilding the .htaccess file, saving the permalink structure again, I have restored all files from a few days ago before switching the domain, then I restored the database - none of it worked. I have tried installing "Permalink Fix & Disable Canonical Redirects Pack" which solved the problem for some people and tried one more plugin that solved the issue for others(can't think of the name at the moment). What could be the problem? Nothing has changed in Wordpress. Any help is appreciated!               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+     RewriteRule .* - [E=no-gzip:1]     </IfModule>               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress          <IfModule mod_rewrite.c>      RewriteEngine On     RewriteRule ^wp-content(/.*|)$ - [L] # don't take any action     RewriteRule ^wp-admin(/.*|)$ - [L] # don't take any action     RewriteRule ^wp-includes(/.*|)$ - [L] # don't take any action          RewriteRule ^moreinfo/(.*)$ http://www.kgstiles.com/moreinfo$1 [R=301]     RewriteRule ^healthsolutions/(.*)$ http://www.kgstiles.com/healthsolutions$1 [R=301]     RewriteRule ^(.*)\.html$ $1/ [R=301]     RewriteRule ^(.*)\.htm$ $1/ [R=301]     </IfModule>


Remove Spaces From WP_LINK_PAGES

By default, wp_link_pages (the code which allows you to breakup posts into multiple pages) creates spaces between each number. Is there a way to remove these spaces via functions.php?


How to change post status in hook?

I have similar problem as described in How to trap "Publish" button to check for meta box validation? Answer there is to hook into `save_post` and change post type. How can I do it? I try to use `wp_transition_post_status` but it doesn't work for me...               function myHook( $post_ID, $post )     {              wp_transition_post_status('pending', $post->post_status, $post );          }          add_action( 'save_post', 'myHook', 10, 2 );      Edit: I have clear wordpress installation without any plugins, additional code and similar


Where do wordpress posts go?

We have wordpress installed in our data center and it manages all the content in our corporate website. So I have a list of pages that are accessible and available in tree view. We are interested in also posting to a regular blog as a part of our corporate website. I'm not clear how to do this but I noticed a New Posts option in the very top nav. I so I created a couple draft posts. However, now I can't find them. I foudn a video that discussed saving draft posts, but my left hand nav does not show any link to posts... just pages. So I can create new posts but have no idea how to manage them. Any advice is much appreciated.


wordpress theme: on site seo

I have a site that is not getting the traffic I have been hoping for (not as much traffic as other sites I own) and I am wondering if it might be something with the theme. The site is _idolx_ (not pornographic but site has pictures of cute girls, just a heads up) Should I change the theme?   or, Try to optimize it?   or, Is it simply the content? Any ideas, opinions or advice would be appreciated. PS: I am not familiar with PHP/coding, etc.


advanced custom fields update_field for field type: Taxonomy

I need to insert a post via wp_insert_post and then add relevant post_meta - however, the WP admin has been customized with the excellent ACF. I know I can add_post_meta in this way:               add_post_meta( $post_id, 'q_key_type', $q_key_type );      However, to make ACF happy, it's required to also use the "update_field" function - like so:               update_field( "field_52c737a413e07", $q_key_type, $post_id );      This method works fine, but I can't get a Taxonomy object to register correctly - I can get the value to save using add_post_meta - when I view the new post it does not recognise the Taxonomy - the value is empty, but in the postmeta table the value is stored correctly - what is missing is the correct field recognition. I can save fields of the type "Text" and "User" correctly using these two methods. Here is an image of two rows in the post_meta table - the first two are created by acf - the last two manually - they appear to be formatted identically: ![enter image description here](http://i.stack.imgur.com/hCNZF.png) I can only find one other reference to the same field name in the post_meta table - it contains an array with the following data - which seems to be the field set-up for acf:               Array (         [key] => field_52c737a413e07         [label] => Type         [name] => q_key_type         [type] => taxonomy         [instructions] =>          [required] => 0         [taxonomy] => q_key_type         [field_type] => select         [allow_null] => 0         [load_save_terms] => 1         [return_format] => object         [conditional_logic] => Array (             [status] => 0             [rules] => Array (                 [0] => Array (                     [field] => null                     [operator] => ==                     [value] =>                  )             )             [allorany] => all         )     [order_no] => 3     )      So, the question is - where else is ACF saving the taxonomy data - I can't find anything in the terms tables?


Warning when using <?php include 'thefile.php'; ?>

Would need some more help with the Did ask a question how to import some code with php, in this case it's a sidebar that will be used on some of the pages on a website, It's wordpress and it can execute php from post / page's and have also tested directly in the main code When i did ask the question the best and most easy thing would be to create a file and use include Did create thefile.php and did put it in the theme dir where all other .php file's used is, In the file i did just put some basic html like               <div id=the-id">            <p> a test text </p>     </div>       Then i did put the include code writen as below in my template               <?php include 'thefile.php'; ?>      Doing this i see my text "a test text" but also get several warning's                Warning: include(/wp-content/themes/thetheme/thefile.php) [function.include]:       failed to open stream: No such file or directory in /home/cplac/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 22      And also this               Warning: include() [function.include]: Failed opening ‘/wp-content/themes/thetheme/thefile.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php:/home/cplac/public_html/wp-content/plugins/wpsyndicator:/home/cplac/public_html/wp-content/plugins/wp-external-links/includes/phpQuery/:/home/cplac/public_html/wp-content/plugins/wp-external-links/includes/phpQuery/plugins/’) in /home/cplac/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 22      Someone that can help me out whit this ? Have tested both in pages but also in the theme files and so on !


How to increase the thumnail size of nggallery carousel template

I want to increase the thumbnail image size of nggallery carousel template. Check this link http://arkamediaworks.com/rel_test/uncatagorize/hello-2/?pid=6 is there any better code to do it. Here, is the code:                    <?php foreach ( $images as $image ) : ?>     <?php if ( $image->hidden ) continue; ?>     <?php $subnavi[] = $image->pidlink ;?>     <li id="ngg-image-<?php echo $image->pid ?>" class="ngg-thumbnail-list <?php if ($image->pid == $current->pid) echo 'selected' ?>" >         <a href="<?php echo $image->pidlink ?>">             <img src="<?php echo $image->thumbnailURL ?>" alt="<?php echo $image->alttext ?>"   />
     <?php endforeach; ?>


remove support for 'Categories' for a custom post type

How would I go about removing support for Wordpress 'Categories' for a custom post type? I've created a custom taxonomy for the post type, so there is no need for the standard categories. Oddly, I thought this would be easy to find out how to do via Google but I can't find anything on it. Any help appreciated!