Title: CodeyMonkey's Replies | WordPress.org

---

# CodeyMonkey

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

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

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/users/codeymonkey/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/codeymonkey/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[All Bootstrap Blocks] Compatibility Issue with Qi Blocks – Can’t work together.](https://wordpress.org/support/topic/compatibility-issue-with-qi-blocks-cant-work-together/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/compatibility-issue-with-qi-blocks-cant-work-together/#post-16896323)
 * Hi Miles,
   This has now been fixed, I had some legacy code in functions.php leftover
   from my first post, which was causing them not to display, e.g.
 *     ```wp-block-code
       function custom_allowed_block_types( $allowed_blocks ) {   return array(        
       'core/paragraph',        
       'core/heading',        
       'core/list',
   
       Etc.
       ```
   
 * Removed this and now all is well.
   Thank you.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[All Bootstrap Blocks] Compatibility Issue with Qi Blocks – Can’t work together.](https://wordpress.org/support/topic/compatibility-issue-with-qi-blocks-cant-work-together/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/compatibility-issue-with-qi-blocks-cant-work-together/#post-16896287)
 * Hi Miles,
   Thank you kindly for your response and for looking into this issue.
   I can confirm that the boxes were unticked, although interestingly upon saving,
   it doesn’t appear to have the issue anymore, so that’s some improvement, thank
   you.The issue now appears to be more UX/block list bug – I’ve found that neither
   the QI Blocks nor the Bootstrap blocks are not visible in the side panel (Qi 
   Blocks were there previously) – any ideas, please?
 * ![](https://i0.wp.com/i.ibb.co/3RwFZzz/4347y.jpg?ssl=1)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Skip first attachment on a get_children array](https://wordpress.org/support/topic/skip-first-attachment-on-a-get_children-array/)
 *  [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/skip-first-attachment-on-a-get_children-array/#post-2295127)
 * Thanks very much, appreciated.
 * So with 3.3 – how do you the check “If has children” (e.g. I want to show a “
   Placeholder” image if the post doesn’t have any attachments? (But does have a
   featured image)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Skip first attachment on a get_children array](https://wordpress.org/support/topic/skip-first-attachment-on-a-get_children-array/)
 *  [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/skip-first-attachment-on-a-get_children-array/#post-2295125)
 * This doesn’t work in WordPress 3.3
 * e.g. I want to skip the first image…which will be my featured image…and just 
   show the other images attached to the post…
 * But this no longer works as of WordPress 3.3. – do you have a solution?
 * (I also use the “else” part to just show a “no Image” graphic, but as I say, 
   it no longer shows since the update to 3.3
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Created a new theme…no need for index.php – this ok?](https://wordpress.org/support/topic/created-a-new-themeno-need-for-indexphp-this-ok/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/created-a-new-themeno-need-for-indexphp-this-ok/#post-2461774)
 * It’s not what I intended, but it’s the way it’s happened…
 * home.php – is my homepage
    I use page for contact, portfolio blog index single-
   portfolio.php takes care of the single portfolio items single.php takes care 
   of single blog posts archive.php, search.php, 404.php and pages.php take care
   of the rest…
 * So you can see why index.php isn’t needed with any code inside.
 * It’s fine, I have 404.php and search.php…search works fine, I have everything,
   even an index.php file…. there’s just no code in it…
 * Everything seems to work great….
 * Shall I put some default code in there? Seems like I can leave it blank, just
   wondered if therer would be any repurcussions?
 * _[[No bumping](http://codex.wordpress.org/Forum_Welcome#No_Bumping), thank you.]_
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Only show posts of current category?](https://wordpress.org/support/topic/only-show-posts-of-current-category/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/only-show-posts-of-current-category/#post-2361925)
 * Hi,
 * Sorry I meant to use a “-” instead of an “_”… So if I was to go the category 
   route…
 * How would I show only the current categories posts?
 * e.g. posts of /category/portfolio/
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Only show posts of current category?](https://wordpress.org/support/topic/only-show-posts-of-current-category/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/only-show-posts-of-current-category/#post-2361883)
 * Hi Alchymyth,
 * I’m pretty new to wordpress, so I might have to use archive.php instead of category_portfolio.
   php, but i’ll see what you think.
 * I’m building a Portfolio website with just
 * Home/Portfolio/Blog/Contact
 * Home = index.php
    Portfolio = category_portfolio.php Blog = category_blog.php
   Contact = (I havn’t got this far yet, might use “Pages” and a plugin)
 * /blog/ & /portfolio/sub-categories – will need different looking archives.
 * Portfolio has sub categories like “Web Design/Illustartion/Print etc” and if 
   a user goes to /category/portolio it would list all posts posted within those
   child categories…
 * But currently it shows posts from both “Portfolio” and “Blog” I don’t know how
   to differentiate, what do you suggest?
 * I can currently list the “child Categories” only using:
 *     ```
       <?php
   
       $args=array(							'orderby' => 'name',
       'order' => 'ASC'
       );
       $categories=  get_categories('child_of='.get_query_var('cat'));
       foreach($categories as $category) {
       echo '<li class="segment-' . $category->cat_ID.'"><a href="#" class="' . $category->cat_ID.'">' . $category->name.'</a></li>';
       }
       ?>
       ```
   
 * But… I don’t know how to pull the posts from these child categories only.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Display Sub Categories of Current Parent Category if there are posts](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/#post-2337676)
 * I have a “Parent Category” which works as /category/portfolio/
 * And the category is named category-portfolio.php.
 * All I have inside is:
 *     ```
       <?php query_posts('showposts=25'); while (have_posts()) : the_post(); ?>
       <li data-type="<?php $category = get_the_category(); echo $category[0]->cat_ID; ?>"></li>
       <?php endwhile; ?>
   
       <?php
       $args=array(
         'orderby' => 'name',
         'order' => 'ASC'
         );
        $categories=  get_categories('child_of='.get_query_var('cat'));
         foreach($categories as $category) {
           echo '<p>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
           echo '<p> Description:'. $category->description . '</p>';
           echo '<p> Post Count: '. $category->count . '</p>';  }
       ?>
       ```
   
 * And this produces:
 * > Category: Photography
   >  Description:Lorem ipsum dolor sit amet, consectetur 
   > adipiscing elit. Post Count: 1
   > Category: Portfolio
   >  Description:Portfolio description would go here Post Count:
   > 0
   > Category: Illustration
   >  Description:Lorem ipsum dolor sit amet, consectetur
   > adipiscing elit. Post Count: 1
 * Why is portfolio even showing!!?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Display Sub Categories of Current Parent Category if there are posts](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/#post-2337420)
 * Can someone help please, the above code pulls the parent as well as the child
   categories, when I only want just the “children” only.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Display Sub Categories of Current Parent Category if there are posts](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/#post-2337415)
 * OK, to be more specfic, I chnaged the first line of the example, to what you 
   said e.g.
 *     ```
       <?php
         $categories=  get_categories('child_of='.get_query_var('cat'));
         foreach ($categories as $category) {
       ```
   
 * But it’s still pulling the title of the “Parent” e.g. “Portfolio”, within the
   results any ideas? – Whcih it shouldn’t if I want it to show only ones with posts
   within it. (excluding the parent)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Display Sub Categories of Current Parent Category if there are posts](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/display-sub-categories-of-current-parent-category-if-there-are-posts/#post-2337413)
 * This doesn’t work unfortauntely 🙁
 * I’d like to have more styling over this for example, ideally i’d like:
    -  (Query loop here)
    - <li >(Sub Category ID)(Sub Category Title)</li >
       (End Queryy)
 * Hope that makes sense.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Template per Category?](https://wordpress.org/support/topic/template-per-category-1/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/template-per-category-1/#post-2335713)
 * Hi,
 * I don’t know what you mean by “Single posts don’t have the category in the url.”–
   Of course they do, otherwise would just be mysite.com/single-post/… which is 
   weird.
 * They have a category or sub category in the url like mysite.com/cat/subcat/single-
   post/
 * Or have i missed something…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Template per Category?](https://wordpress.org/support/topic/template-per-category-1/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/template-per-category-1/#post-2335706)
 * Hi,
 * Thanks for your response, The only thing I really want to hardcore is “portfolio”–
   As mentioned above, the sub-category (e.g. ID7) – I want to remain as a variable
   so I don’t have to keep hardcoding things everytime I add a new category, hope
   that makes sense.
 * OK so from what your’re saying.
 * category.php would handle /portfolio/ & /portfolio/subcategories
 * &
 * single.php would handle /portfolio/subcategory/single-post-here
 * ?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Template per Category?](https://wordpress.org/support/topic/template-per-category-1/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/template-per-category-1/#post-2335701)
 * Same thing again, thanks for repsonding, though perhaps I havn’t explained my
   self properly.
 * /Portfolio/ – will be an index of sub categories
 * /portfolio/photogrpahy – will be an index of all photography items
    /portfolio/
   $anycategory(e.g.photography/single-post-item/ – Will be an individual post item
   from a subcategory e.g. (A phto with all the text)
 * Hope that clears it up.
 * So essentially I need:
    1. – One template for /portfolio/ 2. – One template for
   the sub category /portfolio/photography/ 3. – One for the individual post item.
 * Note: the subcategory page e.g. /photography/ -will be dynamic, so I don’t want
   to have to hard code that part, so I can add any category e.g. illustration/art/
   design etc etc without having to create a new template each time.
 * _[[No bumping](http://codex.wordpress.org/Forum_Welcome#No_Bumping), thank you–
   especially after less than 20 minutes! If it’s that urgent, [hire someone](http://jobs.wordpress.net/).]_
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Template per Category?](https://wordpress.org/support/topic/template-per-category-1/)
 *  Thread Starter [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/template-per-category-1/#post-2335698)
 * But if I created category-portfolio.php – I assume this would give the styling
   for /portfolio/ ok, but wouldn’t the same styling be applied for /portfilio/photography/
   some-post-heere/..
 * As it’s still got the “portfolio” identifier in the url?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/users/codeymonkey/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/codeymonkey/replies/page/2/?output_format=md)