Title: specialmachine's Replies | WordPress.org

---

# specialmachine

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

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

 Search replies:

## Forum Replies Created

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

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064491)
 * For anyone’s future reference, the code works in both manners as you would assume…
 *     ```
       <?php
       	$args=array(
       		'orderby' =>'parent',
       		'tag_slug__in' => array('food','cocktails','wine'),
       		'order' =>'asc',
       		'post_type' =>'page'
       		);
       	$page_query = new WP_Query($args);
       ?>
   
       <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
       	<div class="teaser">
       	<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
       	<?php the_excerpt(); ?>
       	</div>
       <?php endwhile; ?>
       ```
   
 * or…
 *     ```
       <?php
       	$args=array(
       		'orderby' =>'parent',
       		'tag_slug__in' => array('menu'),
       		'order' =>'asc',
       		'post_type' =>'page'
       		);
       	$page_query = new WP_Query($args);
       ?>
   
       <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
       	<div class="teaser">
       	<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
       	<?php the_excerpt(); ?>
       	</div>
       <?php endwhile; ?>
       ```
   
 * So, a nice use for this code could be displaying pages in a single template, 
   like if you have a menu with three sections (food, cocktails, wine). So you can
   tag them all “menu” and use just that tag in the code, or you can control the
   order in an arbitrary way by listing the tags in the array.
 * Thank you again to Hakkim. I’m really happy to know there are kind people out
   there, willing to help. It’s really cool.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064485)
 * Boom! That works! THANK YOU! Now I have two very useful bits of code. Lots of
   love from Germany, Hakkim!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064477)
 * Ah, just saw your new post. I’ll try it.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064476)
 * In this case, would it be looking for a page that is tagged, ‘essen’, and ‘trinken’
   and ‘wein’?
 * Sorry. I’ve realized I can just tag all three pages with ‘menu’ and as they are
   set to order anyway, it really achieves what I’m after.
 * That said, ideally, it would be great to be able to have an arbitrary order for
   design purposes. But this achieves what I’m after, so I do thank you. The reason
   I was after a way to display pages by slug was so I could just list them in the
   order I wanted them to appear, along with not having to fuss over an ID as they
   are often if ever in sync unless the databases are exactly the same between what’s
   online and my local machine where I build the sites.
 * So thank you for your help. We can leave it there if you like. Perhaps some day
   I’ll achieve my dream. 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064462)
 * Thanks for sticking with me, Hakkim. I really appreciate it.
 * This is currently the code I’m using, after having removed the comma after ‘post_type’
   =>’page’
 * It seems to only work with a single tag. If I add more than one, it stops working
   and nothing displays, although it doesn’t break the page.
 *     ```
       <?php
       	$args=array(
       		'orderby' =>'parent',
       		'tag' => 'essen+trinken+wein',
       		'order' =>'asc',
       		'post_type' =>'page'
       		);
       	 query_posts($args);
       	$page_query = new WP_Query($args);
       ?>
   
       <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
       	<div class="teaser">
       	<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
       	<?php the_excerpt(); ?>
       	</div>
       <?php endwhile; ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064459)
 * Sorry, I was using this….
 *     ```
       <?php
       	$args=array(
       		'orderby' =>'parent',
       		'tag' => 'essen+trinken+wein',
       		'order' =>'asc',
       		'post_type' =>'page',
       		);
       	 query_posts($args);
       	$page_query = new WP_Query($args);
       ?>
   
       <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
       	<div class="teaser">
       	<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
       	<?php the_excerpt(); ?>
       	</div>
       <?php endwhile; ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064458)
 * Okay, I enabled tagging for pages by grabbing some code here and slapping it 
   in my functions.php. I tagged each page with the corresponding name, so just 
   like the slug names. Then I tried to add in your code with the updates to the
   tag names and it broke the page. Again, lack of understanding for how this works.
   Sorry. This is the code i’m trying to use now…
 *     ```
       <?php
       	$args=array(
       		'orderby' =>'parent',
       		'tag' => 'food+cocktails+wine',
       		'order' =>'asc',
       		'post_type' =>'page',
       		);
       	 query_posts($args);
       ?>
   
       <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
       	<div class="teaser">
       	<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
       	<?php the_excerpt(); ?>
       	</div>
       <?php endwhile; ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064444)
 * Hi Hakkim – I really don’t know how to do any of this. I’m not a developer. I
   know what I’m after, and then when it comes to how to do it, I just scour the
   web looking for a snippet of code.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Listing specific page by slug](https://wordpress.org/support/topic/listing-specific-page-by-slug/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/listing-specific-page-by-slug/#post-4064431)
 * Yes, wonderful – I can do it with one slug, but I’m after multiple slugs. Perhaps
   I’m just not doing that part right as this code breaks the page…
 *     ```
       <?php
       					$the_slug = 'food', 'cocktails', 'wine';
       					$args=array(
       						'orderby' =>'parent',
       					        'name' => $the_slug,
       						'order' =>'asc',
       						'post_type' =>'page',
       						);
       					$page_query = new WP_Query($args);
       				?>
   
       				<?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
       					<div class="teaser">
       					<h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
       					<?php the_excerpt(); ?>
       					</div>
       				<?php endwhile; ?>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: Official Facebook Plugin]](https://wordpress.org/support/topic/plugin-official-facebook-plugin/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-official-facebook-plugin/#post-3945149)
 * I found some documentation. I guess I just have to bite the bullet. Arrghghg.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [site navigation not working](https://wordpress.org/support/topic/site-navigation-not-working-need-help-asap-or-sooner/)
 *  [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/site-navigation-not-working-need-help-asap-or-sooner/#post-3871661)
 * Do you have a url?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Exclude categories by slug in twentytwelve_entry_meta](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/#post-3813427)
 * I really appreciate your trying. I did trying to adapt the other code to this,
   but had no luck myself.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Exclude categories by slug in twentytwelve_entry_meta](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/#post-3813408)
 * I’ve even excluded “uncategorized” (or “Uncategorized” if it’s the category name
   version) so that is why there are no categories at all. There are only three 
   categories in total at the moment, and I don’t want any of them to display. As
   I add posts, I will add additional categories, obviously, and each of the existing
   posts will get some category that will display as well, but it’s good that this
   popped up like this as it shows there’s a bug when there is no category assigned(
   other than “uncategorized”).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Exclude categories by slug in twentytwelve_entry_meta](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/#post-3813407)
 * Sorry it’s only local at the moment.
 * I created a child theme of Twenty Twelve with no changes to this particular function
   that displays the meta entry at the footer of the post, both in the index.php
   and single.php, other than the code we have both posted in this thread. Each 
   result is the result of using that code independently – I am using either the
   snippet I posted, or yours. Not both at the same time.
 * Here are the differences…
 * ***
 * This entry was posted on 3. June 2013.
 * This entry was posted in , on 3. June 2013.
 * ***
 * The first is a result of using the category name code. The second is the result
   of your snippet. You can see in the first result, the default behavior coded 
   into the twentytwelve_entry_meta function kicks in so what’s displayed is tidy
   in the absence of a category.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Exclude categories by slug in twentytwelve_entry_meta](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/)
 *  Thread Starter [specialmachine](https://wordpress.org/support/users/specialmachine/)
 * (@specialmachine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/exclude-categories-by-slug-in-twentytwelve_entry_meta/#post-3813402)
 * Very nearly. I really appreciate the effort. You can see how its behaving here
   with these two screens. One is using the category names, which is the first screen
   capture, and the second is using your code. The former displays a tidy category
   free version when there are no categories present as all three of the existing
   categories have been excluded.
 * [http://cl.ly/image/451E1Y3G1f2m](http://cl.ly/image/451E1Y3G1f2m)
 * [http://cl.ly/image/2247241y0w2z](http://cl.ly/image/2247241y0w2z)

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

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