Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying parent and their child of one level wordpress
    primarykey
    data
    text
    <p>I want to show website links at footer of my website in wordpress. I want fetch all pages and their sub pages of one depth. </p> <p>Then I want to display them in three columns like if there are total 8 pages then these should be displayed 3-3-2 in first-second-third column. new to wordpress.</p> <p>can any body please help</p> <p>I tried this but dont know how i can align them in 3-3-2</p> <pre><code> &lt;?php $counter = 0; $parent_pages = $wpdb-&gt;get_results("SELECT * FROM $wpdb-&gt;posts WHERE post_parent = '0' AND ID &lt;&gt; 2 AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?&gt; &lt;?php if ( $parent_pages ) : foreach ( $parent_pages as $pageParent ) : setup_postdata( $pageParent ); ?&gt; &lt;?php $counter++; ?&gt; &lt;div class="linkSection"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="&lt;?php echo get_permalink($pageParent-&gt;ID); ?&gt;"&gt;&lt;?php echo $pageParent-&gt;post_title; ?&gt;&lt;/a&gt;&lt;/a&gt; &lt;/li&gt; &lt;?php $child_pages = $wpdb-&gt;get_results("SELECT * FROM $wpdb-&gt;posts WHERE post_parent = '".$pageParent-&gt;ID."' AND ID &lt;&gt; 2 AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?&gt; &lt;?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild ); ?&gt; &lt;li&gt;&lt;a href="&lt;?php echo get_permalink($pageChild-&gt;ID); ?&gt;"&gt;&lt;?php echo $pageChild-&gt;post_title; ?&gt;&lt;/a&gt;&lt;/a&gt; &lt;/li&gt; &lt;?php endforeach; endif; ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;?php endforeach; endif; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload