Title: WillxD's Replies | WordPress.org

---

# WillxD

  [  ](https://wordpress.org/support/users/willxd/)

 *   [Profile](https://wordpress.org/support/users/willxd/)
 *   [Topics Started](https://wordpress.org/support/users/willxd/topics/)
 *   [Replies Created](https://wordpress.org/support/users/willxd/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/willxd/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/willxd/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/willxd/engagements/)
 *   [Favorites](https://wordpress.org/support/users/willxd/favorites/)

 Search replies:

## Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP install in subdirectory can't find pages/posts](https://wordpress.org/support/topic/wp-install-in-subdirectory-cant-find-pagesposts/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp-install-in-subdirectory-cant-find-pagesposts/#post-2579371)
 * Hello,
 * maybe these links are useful.
    [http://codex.wordpress.org/Rewrite_API/flush_rules](http://codex.wordpress.org/Rewrite_API/flush_rules)
   [http://www.josscrowcroft.com/2011/code/manually-clear-wordpress-rewrite-rules-mysql-phpmyadmin/](http://www.josscrowcroft.com/2011/code/manually-clear-wordpress-rewrite-rules-mysql-phpmyadmin/)
 * Cheers
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Something went screwy](https://wordpress.org/support/topic/something-went-screwy/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/something-went-screwy/#post-2579368)
 * You should use Chrome Developer Tools or firebug if you use firefox to fix your
   problem.
    In the case of your logo, it is showed more than once because in the
   css you don’t specific “no-repeat”. Another problem is that you don’t define 
   the width of some elements. I recommend you, read more about css.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[AutoFocus] [Theme: AutoFocus] Again… sidebar not visible](https://wordpress.org/support/topic/theme-autofocus-again-sidebar-not-visible/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/theme-autofocus-again-sidebar-not-visible/#post-2579366)
 * What is the content of your sidebar.php file?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to automatically change the category assigned to a post?](https://wordpress.org/support/topic/how-to-automatically-change-the-category-assigned-to-a-post/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/how-to-automatically-change-the-category-assigned-to-a-post/#post-2568054)
 * I’m sorry, I hadn’t tried the previous code. Well, here is the new code. I hope
   it helps.
 *     ```
       add_action('publish_post', 'remove_cat_gen');
   
       function remove_cat_gen() {
       		global $post;
       		wp_schedule_single_event(time()+604800, 'clean_my_post', array($post->ID) );
       }
   
       add_action('clean_my_post','remove_cat_from_post');
   
       // the function that removes the category from the post
       function remove_cat_from_post($post_id) {
           global $wpdb;
       		$cat_id = get_cat_ID('new this week');
       		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = $post_id AND term_taxonomy_id = $cat_id" ) );
       }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to automatically change the category assigned to a post?](https://wordpress.org/support/topic/how-to-automatically-change-the-category-assigned-to-a-post/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/how-to-automatically-change-the-category-assigned-to-a-post/#post-2567981)
 * Hello,
 * That code should work fine..
    Well, if you need always remove the category “new
   this week” after 7 days. You can try this code (in your functions.php).
 *     ```
       add_action('save_post', 'save_Featured_Removal_options');
   
       function save_Featured_Removal_options($post_id) {
           // check autosave
           if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
               return $post_id;
           }
       		//create scheduled event (7 days)
       		$time = time() + 604800;
       		wp_schedule_single_event($time, 'clean_my_featured',$post_id);
           }
       }
   
       /* hook removal event function */
       add_action('clean_my_featured','remove_post_from_featured');
   
       // the function that removes a post form a category and sets a new one
       function remove_post_from_featured($post_id) {
           $cat_id = get_cat_ID('new this week');
           wp_set_post_terms( $post_id, $cat_id, 'category');
       }
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [png images aren't transparent](https://wordpress.org/support/topic/png-images-arent-transparent/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/png-images-arent-transparent/#post-2564438)
 * This won’t be possible with css, an image is a square (if it is png or not), 
   and so the shadow will be the shadow of a square.
 * If you need the shadow in your image, the easiest way would be to use an image
   editor to apply the shadow.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Adding site from dev to production](https://wordpress.org/support/topic/adding-site-from-dev-to-production/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/adding-site-from-dev-to-production/#post-2564434)
 * If your dev environment is localhost, you can try to replicate the multisite 
   using your real domain to avoid changing the url in the db and add the new site.
   [http://devpress.com/blog/how-to-setup-subdomains-for-a-local-wordpress-network/](http://devpress.com/blog/how-to-setup-subdomains-for-a-local-wordpress-network/)
 * Cheers.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Subdomain for Sub-directory Network](https://wordpress.org/support/topic/subdomain-for-sub-directory-network/)
 *  Thread Starter [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/subdomain-for-sub-directory-network/#post-2347522)
 * Thanks but when I’m trying to set up the network with sub-directory, I only have
   this option:
    mysite.com/site1 and mysite.com/site2
 * How can I custom these option to **blogs**.mysite.com/site1
    considering that
   the main site is mysite.com.
 * Best Regards.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Div not expanding](https://wordpress.org/support/topic/div-not-expanding/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/div-not-expanding/#post-1822138)
 * Hello,
 * Why don’t you create a new file CSS and separate the style of code?
 * The structure of the site is messy.
 *     ```
       <div id="wrap">
       <div id="header">
        your code here..
       </div>
   
       <div id="container">
   
       <div id="content">
        your code here..
       </div><!-- end content -->
   
       <div id="sidebar">
        your code here..
       </div><!-- end sidebar-->
   
       </div> <!-- end container -->
   
       <div class="clear"></div>
   
       <div id="footer">
       your footer code...
       </div><!--end footer-->
       </div><!-- end wrap -->
       ```
   
 * and create a style.css
 *     ```
       #wrap{
          width:1024px;
          margin:auto;
          }
       #header{
          .....
          }
   
       #content{
          padding:20px;
          ....
       }
   
       .clear{
          clear:both;
          }
   
       #footer{
        ....
       }
       ```
   
 * If you do a good structure of your site, its easier to find any mistake.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Change tab colors in Twenty Ten Theme](https://wordpress.org/support/topic/change-tab-colors-in-twenty-ten-theme/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/change-tab-colors-in-twenty-ten-theme/#post-1617876)
 * Hello,
    You can check the file style.css at line 369 and change the background
   color from #000 to #fff.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Get the number of item in a gallery](https://wordpress.org/support/topic/get-the-number-of-item-in-a-gallery/)
 *  Thread Starter [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/get-the-number-of-item-in-a-gallery/#post-1617223)
 * I made a mistake. The correct code is:
 *     ```
       <?php
       $parent = $post->post_parent;
       $id = $post->ID;
       $total_attachments = $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->prefix}posts WHERE post_type = 'attachment' AND post_parent = $parent");
       $imgnum = $wpdb->get_var("SELECT menu_order FROM {$wpdb->prefix}posts WHERE post_type = 'attachment' AND post_parent = $parent AND ID = $id");
       ?>
       Image <?php echo $imgnum;?> of <?php echo $total_attachments;?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WORDPRESS DOESN'T OBEY ME!!!](https://wordpress.org/support/topic/wordpress-doesnt-obey-me/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-doesnt-obey-me/#post-1616775)
 * You can list the latest post of all categories like this:
 *     ```
       <?php
       $categories = get_categories();
       foreach ($categories as $cat) : ?>
       	<div class="wrap_cat">
       	<?php
       	// get most recent post in cat
       	query_posts('posts_per_page=1&cat='.$cat->cat_ID);
       	if (have_posts()) : while (have_posts()) : the_post();
       	?>
       	<h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
       	<?php the_content('continue reading...'); ?>
       	<?php endwhile; endif; wp_reset_query();
       	// get 4 most recent posts in cat offset by 1
       	query_posts('posts_per_page=4&offset=1&cat='.$cat->cat_ID);
       	if (have_posts()) : ?>
       	<ul class="moreposts">
       	<?php while (have_posts()) : the_post(); ?>
       		<li><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
       	<?php endwhile; ?>
       	</ul> <!-- .moreposts -->
       	<?php endif; wp_reset_query();?>
       	</div> <!-- .wrap_cat -->
       <?php endforeach; ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Get the number of item in a gallery](https://wordpress.org/support/topic/get-the-number-of-item-in-a-gallery/)
 *  Thread Starter [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/get-the-number-of-item-in-a-gallery/#post-1617210)
 * I’ve just found solution to my problem. What I miss was to add the order number
   in the admin panel, and for this the row menu_order was 0.
 * If someone has the same problem as me, here I leave the code.
 *     ```
       <?php
       $id = $post->post_parent;
       $total_attachments = $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->prefix}posts WHERE post_type = 'attachment' AND post_parent = $id");
       $imgnum = $wpdb->get_var("SELECT menu_order FROM {$wpdb->prefix}posts WHERE post_type = 'attachment' AND post_parent = $id");
       ?>
   
       Image <?php echo $imgnum;?> of <?php echo $total_attachments;?>
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Space Where No Featured Image](https://wordpress.org/support/topic/space-where-no-featured-image/)
 *  [WillxD](https://wordpress.org/support/users/willxd/)
 * (@willxd)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/space-where-no-featured-image/#post-1616691)
 * Hello, you can check this page [http://codex.wordpress.org/Function_Reference/has_post_thumbnail](http://codex.wordpress.org/Function_Reference/has_post_thumbnail)
 * On your theme, you should put a condition if the post had a thumbnail.

Viewing 14 replies - 1 through 14 (of 14 total)