Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

[SOLVED] New Template to show child menu pages


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
 
Prev Previous Post   Next Post Next
  #1  
Old Aug 17, 2010, 04:14 PM
smitp11
 
24 posts · May 2010
[SOLVED] New Template to show child menu pages

Hi,

I have created a new template (a copy of index.php) so I can display child pages links in a menu style. In my template I added this code:
Code:
    <div id="nav2">
<div class="clearfix" id="nav-content2">
<ul class="sf-menu2">   
<?php
  if($post->post_parent)
  $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
  else
  $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
  if ($children) { ?>
  <ul>
  <?php echo $children; ?>
  <?php if(function_exists('wp_print')) { print_link(); } ?> 
  </ul>
  <?php } ?>
</ul>
</div>
</div>
right after:

Code:
<?php /* The LOOP starts here. Do this for all posts: */
	while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
and here is the css for completeness:
Code:
#nav2					{ max-height: 350px; }
#nav-content2			{ margin: 0 auto; width: 170px; background: url(../../images/topnav.jpg) repeat-x #E5E5E5; border: solid #CCC; border-width: 0px 0px 0px; }

.sf-menu2				{ font-weight: normal; max-width: 170px; }
.sf-menu2, .sf-menu2 ul	{ float: left; padding: 0; margin: 0; }
.sf-menu2 a				{ display: block; text-decoration: none; padding: 6px 8px; color:#FFFFFF; background-color: #37322F; font-size: 11px; font-weight: bold; text-transform: uppercase; line-height:1.5em; font-family: Helvetica, tahoma, arial; }
.sf-menu2 a:hover		{ color: #DB1829; }
.sf-menu2 li				{ padding: 0; line-height: 22px; border-bottom: 1px dashed #FFFFFC; }
.sf-menu2 ul				{ list-style: none; position: absolute; left: -0em; height: auto; width: 160px; margin: 0; line-height: 1; border: none; }
.sf-menu2 li.current_page_item a { color: #DB1829;}
.sf-menu2 li.current_page_item a, .sf-menu2 ul li .current_page_item a:hover { color: #DB1829; font-weight: bold;}
A demo is here:
http://sandpit.myfallriver.ca/fall-river

As you can see, it isn't quite right.

Any help, much appreciated.
Thanks,
Patrick.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display child pages in a horizontal menu bar? edvandyke Page & Category Menu Bars 4 Sep 2, 2011 09:33 AM
Child pages don't keep parent page in menu highlighted ribbu Page & Category Menu Bars 12 Dec 15, 2009 12:43 PM
Show Child Category In Category Menu Bar? mwsmedia Page & Category Menu Bars 1 Jun 29, 2009 05:06 AM
Page Menu Drop Down Only Showing First 6 Child Pages LabbyRoad Page & Category Menu Bars 4 Mar 11, 2009 11:40 AM


All times are GMT -6. The time now is 05:40 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.