bjornhall
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Three-level menu. On different locations?I could try! I can post a link, since its for a client. But i uploaded a “drawing” explaining!
https://awesomescreenshot.com/0aaegm181My problem is that. i can get it to list the third level. But when i enter that third level page, i second level starts to display the third level aswell.
Right now i got a temp fix for it, a nasty one, including plugin and hiding elements. And the query to get the third level is ugly. Here it is:
<?php $gen1 = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_parent = 0 AND $wpdb->posts.post_type = 'page' AND $wpdb->posts.post_status = 'publish' ORDER BY $wpdb->posts.ID ASC"); $gen1_ids = implode($gen1,', '); $gen2 = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_parent IN ($gen1_ids) AND $wpdb->posts.post_type = 'page' AND $wpdb->posts.post_status = 'publish' ORDER BY $wpdb->posts.ID ASC"); $gen2_ids = implode($gen2,', '); $gen3 = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_parent IN ($gen2_ids) AND $wpdb->posts.post_type = 'page' AND $wpdb->posts.post_status = 'publish' ORDER BY $wpdb->posts.ID ASC"); $gen3_ids = implode($gen3,', '); wp_list_pages('include=' . $gen3_ids . '&title_li='); ?>
and using the “simple nav” plugin to display the second lvl. and hiding the the parts i dont want:
simple_section_nav('before_widget=<li>&after_widget=</li>&show_on_home=0&title= ');
Forum: Fixing WordPress
In reply to: Three-level menu. On different locations?Yes, that is correct. But how do i do it? Got to be more people who have this issue. But all i can find is older forums posts with soloutions that uses plugins thats no longer supported.
I have gotten as far as i can list the child of a parent, and then on the child, list its children. But when i click the grandchild. The child of the parent (top level) displays the grandchild instead of the child of the parent (top level).