Title: Create WordPress logic custom posttype
Last modified: August 31, 2016

---

# Create WordPress logic custom posttype

 *  [AlexanderDolgan](https://wordpress.org/support/users/alexanderdolgan/)
 * (@alexanderdolgan)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/create-wordpress-logic-custom-posttype/)
 * hi, maybe you can help, if possible.
 * I have some problems with wp logic in my site. I have your plugin with erm_menu
   post type declaration file, I create other page ([link](https://gist.github.com/AlexanderDolgan/1d88faf4615ea4ab2568))
   with WP_Query, create nav list using posts title’s and the_permalink() method.
   After that, I create single-erm_menu.php (and try archive-erm_menu.php) for showing
   posts the_content(). The problem is that after following a link, I get to index.
   php
 * Thanks.
 * [https://wordpress.org/plugins/quick-restaurant-menu/](https://wordpress.org/plugins/quick-restaurant-menu/)

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

 *  Plugin Author [Alejandro](https://wordpress.org/support/users/alejandropascual/)
 * (@alejandropascual)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/create-wordpress-logic-custom-posttype/#post-7060349)
 * Post type erm_menu is not queriable at the front end. Is something Ill add in
   next release
 *  Thread Starter [AlexanderDolgan](https://wordpress.org/support/users/alexanderdolgan/)
 * (@alexanderdolgan)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/create-wordpress-logic-custom-posttype/#post-7060351)
 * Thanks, for reply!
 * I used this structure: Create pages with er_menu shortcode’s for all categories,
   and sub categories, and echo pages list with ancestors and child pages. It’s 
   work perfectly.
 *     ```
       //Get top ancestor for menu navigation
   
       function get_top_ancestor_id() {
       	global $post;
       	if ( $post->post_parent ) {
       		$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
       		return $ancestors[0];
       	}
       	return $post->ID;
       }
       ```
   

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

The topic ‘Create WordPress logic custom posttype’ is closed to new replies.

 * ![](https://ps.w.org/quick-restaurant-menu/assets/icon-256x256.png?rev=1172762)
 * [Quick Restaurant Menu](https://wordpress.org/plugins/quick-restaurant-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quick-restaurant-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quick-restaurant-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/quick-restaurant-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quick-restaurant-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quick-restaurant-menu/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [AlexanderDolgan](https://wordpress.org/support/users/alexanderdolgan/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/create-wordpress-logic-custom-posttype/#post-7060351)
 * Status: not resolved