aeioux
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: get current post id?You can use <?php echo $post->ID ?> to output or use the current post ID.
Forum: Fixing WordPress
In reply to: Dyanmic sup page links on parentI’ve found a solution for small sites that need this.
In each page in your menu structure add a ‘custom field’ (at the bottom of the manage post page in the admin area).
Find out the ID of the main section page. For instance my About page has an ID of 2 – this appears to the left of the page name on the Manage Pages page.
Add a custom field with the name ‘section’ and the value 2 to each page within that section of your site.
Then, to make your menu, edit your header.php page and paste in the following code.
<?php
if($section_id = get_post_meta($page_id, ‘section’, $single = true))
{
wp_list_pages(‘depth=1&sort_column=menu_order&title_li=&child_of=’.$section_id );
}
?>Instant submenu that does not disappear when you click on one of the pages in the section.
Forum: Fixing WordPress
In reply to: (How) can I pass “the_category_ID” to “wp_list_cats()”?I’ve found a solution for small sites that need this.
In each page in your menu structure add a ‘custom field’ (at the bottom of the manage post page in the admin area).
Find out the ID of the main section page. For instance my About page has an ID of 2 – this appears to the left of the page name on the Manage Pages page.
Add a custom field with the name ‘section’ and the value 2 to each page within that section of your site.
Then, to make your menu, edit your header.php page and paste in the following code.
<?php
if($section_id = get_post_meta($page_id, ‘section’, $single = true))
{
wp_list_pages(‘depth=1&sort_column=menu_order&title_li=&child_of=’.$section_id );
}
?>Instant submenu that does not disappear when you click on one of the pages in the section.