Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

[SOLVED] New Template to show child menu pages

Old Aug 17, 2010, 04:14 PM
24 posts · May 2010

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:
    <div id="nav2">
<div class="clearfix" id="nav-content2">
<ul class="sf-menu2">   
  $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
  $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
  if ($children) { ?>
  <?php echo $children; ?>
  <?php if(function_exists('wp_print')) { print_link(); } ?> 
  <?php } ?>
right after:

<?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:
#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:

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

Any help, much appreciated.
Old Aug 18, 2010, 09:13 AM
24 posts · May 2010
Ok, I have got a little further with this.

I need to set this for this new template only, is that possible ?
div.post, div.page {
margin-right: 170px;
Old Aug 18, 2010, 11:06 AM
24 posts · May 2010
Ok, cracked it, I had to add this in the HTML/CSS settings:

div.post {margin-left: 170px; }
div.post#post-3,div.post#post-49,div.post#post-55,div.post#post-445,div.post#post-376,div.post#post-105,div.post#post-48  {margin-left: 0px; }
So by default all pages have a margin-left of 170px and then I explicitly set the pages I want to have no left margin...


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 10:57 AM.

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