Results 1 to 5 of 5

Thread: Navbar

  1. #1
    Brandon Dennis is offline Newbie Net Builder
    Join Date
    Apr 2009
    Posts
    24
    Thanks
    0
    Thanked 14 Times in 6 Posts

    Navbar

    Can someone help me with my navbar? I'm trying to include pages 2 and 3 (About Us and Contact) in my navbar with my homepage while excluding all other pages. I've found the two following methods:

    <strong>include=2,3</strong
    and

    <ul>
    <?php wp_list_pages('include=2,3&title_li=<h2>' . __('Pages') . '</h2>' ); ?>
    </ul>

    but neither one of them seems to work. I also can't figure out exactly where to put the code at, which I imagine is the main reason that it isn't working.


    Thanks in advance,
    Brandon

  2. #2
    Aziz's Avatar
    Aziz is offline no investment, no glory
    Join Date
    May 2009
    Location
    IL
    Posts
    736
    Thanks
    588
    Thanked 243 Times in 168 Posts
    can you show the original source code?

  3. #3
    Brandon Dennis is offline Newbie Net Builder
    Join Date
    Apr 2009
    Posts
    24
    Thanks
    0
    Thanked 14 Times in 6 Posts
    Yeah, sorry.

    Link:
    DennCorp

    Source:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta name="Cube_option1" content="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/wp-content/themes/business portfolio/cubit" />
    <title>DennCorp</title>

    <link rel="alternate" type="application/rss+xml" title="DennCorp RSS Feed" href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/?feed=rss2" />
    <link rel="pingback" href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/xmlrpc.php" />

    <link rel="stylesheet" href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/wp-content/themes/business portfolio/cubit/style.css" type="text/css" media="screen" />

    <link rel="stylesheet" href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/wp-content/themes/business portfolio/cubit/css/style1.css" type="text/css" media="screen" />
    <script type='text/javascript' src='http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/wp-content/themes/businessportfolio/cubit/js/jquery-1.3.1.min.js?ver=2.9.1'></script>
    <script type='text/javascript' src='http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/wp-content/themes/businessportfolio/cubit/js/custom.js?ver=2.9.1'></script>
    <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/xmlrpc.php?rsd" />
    <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/wp-includes/wlwmanifest.xml" />
    <link rel='index' title='DennCorp' href='http://denncorp.freeiz.com/wordpress-2.9.1/wordpress' />

    <meta name="robots" content="index, follow" />


    </head>
    <body id='frontpage' >
    <div id="top">
    <div id="head">
    <h1 id='logo'><a href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/">DennCorp</a></h1>
    <ul id="nav">
    <li class='current_page_item' ><a href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress">Home</a></li>

    <li class="page_item page-item-2"><a href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/?page_id=2" title="About Us">About Us</a></li>
    <li class="page_item page-item-3"><a href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/?page_id=3" title="Contact">Contact</a></li>
    <li class="page_item page-item-24"><a href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/?page_id=24" title="Business Solutions">Business Solutions</a></li>
    </ul>
    <div id="main_transition">
    <div id="transition-container">
    </div>
    </div><!-- end main_transition-->
    </div><!-- end head-->
    <div id="main">


    <div class="info_box box1">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/?page_id=19">Go to Site</a></span>
    <h2>Business Solutions</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam.<br/><br/> quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box2">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title B</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p><br/><br/>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box3">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title C</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box4">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title D</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box5">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title E</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box6">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title F</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>


    </div><!-- end main-->
    <div id="footer">
    &copy; Copyright - All content on this page is owned and operated by DennCorp.
    </div>
    </div><!-- end top-->

    </body>
    </html>

    <!-- www.000webhost.com Analytics Code -->
    <script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
    <noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
    Index:
    <?php global $kriesi_options; get_header(); ?>

    <?php if($kriesi_options['fill_main'] == 1 || $kriesi_options['fill_main'] == ""){


    //*if you did choose: "edit by html" you can now edit the following lines: *//
    ?>

    <div class="info_box box1">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="http://denncorp.freeiz.com/wordpress-2.9.1/wordpress/?page_id=19">Go to Site</a></span>
    <h2>Business Solutions</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam.<br/><br/> quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box2">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title B</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p><br/><br/>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box3">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title C</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box4">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title D</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box5">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title E</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <div class="info_box box6">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="url">Go to Site</a></span>
    <h2>Title F</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.<br/><br/> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
    <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p>
    </div>

    <?php
    //stop editing here if you did choose "edit by html"



    }else if($kriesi_options['fill_main'] == 2){
    $query_string .= "&showposts=3";
    $query_string .= "&cat=".$kriesi_options['com_cat'];
    query_posts($query_string);
    $counter = 1;

    if (have_posts()) : while (have_posts()) : the_post();

    $preview_pic_mainpage = get_post_meta($post->ID, "preview_pic_mainpage", true);
    $punchline = get_post_meta($post->ID, "punchline", true);
    ?>


    <div class="info_box box<?php echo $counter; $counter++; ?>">
    <div class="box_image"><img src='<?php echo $preview_pic_mainpage; $preview_pic_mainpage =''; ?>' alt="" /></div>
    <span class="meta"><?php echo $punchline; $punchline='';?></span>
    <h2><?php the_title(); ?></h2>
    <?php the_content('Read more'); ?>
    <?php edit_post_link('Edit','', '' ); ?>
    </div>
    <?php endwhile; endif; ?>


    <?php } ?>
    <?php get_footer(); ?>
    Kriesi Options:
    <?php
    global $kriesi_options;

    function k_generate(){
    $options = $newoptions = get_option('kriesi_options');

    if ( $_POST['kriesi_options'] ) {
    $newoptions['slide_page'] = strip_tags(stripslashes($_POST['slide_page']));
    $newoptions['whichdesign'] = strip_tags(stripslashes($_POST['whichdesign']));
    $newoptions['fill_main'] = strip_tags(stripslashes($_POST['fill_main']));
    $newoptions['com_cat'] = strip_tags(stripslashes($_POST['com_cat']));
    $newoptions['com_port'] = strip_tags(stripslashes($_POST['com_port']));
    $newoptions['com_page'] = strip_tags(stripslashes($_POST['com_page']));
    $newoptions['enable_exc_post'] = strip_tags(stripslashes($_POST['enable_exc_post']));
    $newoptions['google_analaytics'] = stripslashes($_POST['google_analaytics']);
    }

    if ( $options != $newoptions ) {
    $options = $newoptions;
    update_option('kriesi_options', $options);
    }

    $slide_page = empty( $options['slide_page'] ) ? "" : $options['slide_page'];
    $whichdesign = empty( $options['whichdesign'] ) ? 1 : $options['whichdesign'];
    $fill_main = empty( $options['fill_main'] ) ? 1 : $options['fill_main'];
    $com_cat = empty( $options['com_cat'] ) ? "" : $options['com_cat'];
    $com_port = empty( $options['com_port'] ) ? "" : $options['com_port'];
    $com_page = empty( $options['com_page'] ) ? "" : $options['com_page'];
    $enable_exc_post = empty( $options['enable_exc_post'] ) ? false : true;
    $google_analaytics = empty( $options['google_analaytics'] ) ? "" : $options['google_analaytics'];

    ?>
    <div class="wrap">
    <h2>Cubit Options</h2>

    <form method="post" action="">
    <table class="form-table">
    <tr valign="top">
    <th scope="row">Cubit Design</th>
    <td><br/>
    <label><input type="radio" name="whichdesign" id="whichdesign" value="1" <?php if ($whichdesign == 1){echo "checked = checked";}?> /> Design 1 - Cubit Light/Blue</label><br/>
    <label><input type="radio" name="whichdesign" id="whichdesign2" value="2" <?php if ($whichdesign == 2){echo "checked = checked";}?>/> Design 2 - Cubit Light/Green</label><br/>
    <label><input type="radio" name="whichdesign" id="whichdesign3" value="3" <?php if ($whichdesign == 3){echo "checked = checked";}?>/> Design 3 - Cubit Light/Orange</label><br/>
    <label><input type="radio" name="whichdesign" id="whichdesign4" value="4" <?php if ($whichdesign == 4){echo "checked = checked";}?>/> Design 4 - Cubit Dark/Pink</label><br/>
    <label><input type="radio" name="whichdesign" id="whichdesign5" value="5" <?php if ($whichdesign == 5){echo "checked = checked";}?>/> Design 5 - Cubit Dark/Gold</label><br/>
    <label><input type="radio" name="whichdesign" id="whichdesign6" value="6" <?php if ($whichdesign == 6){echo "checked = checked";}?>/> Design 6 - Cubit Dark/Crimson</label><br/>
    </td>
    </tr>
    <tr valign="top">
    <th scope="row">Cubit Starting Page Image Slider</th>
    <td><br/>
    Here you can choose which way you want to populate the Image slider on your starting page. <br/>
    You can select an existing page and add all images to this page. If no page is selected the script uses the images defined in your header.php file. If you want to, you can edit the images directly in this file. <br/>

    <select class="postform" id="slide_page" name="slide_page">
    <option value="">Select Page</option>
    <?php
    $pages = get_pages('title_li=&orderby=name');
    foreach ($pages as $page){

    if ($slide_page == $page->ID){
    $selected = "selected='selected'";
    }else{
    $selected = "";
    }
    echo"<option $selected value='". $page->ID."'>". $page->post_title."</option>";
    }
    ?>
    </select>
    </td>
    </tr>



    <tr valign="top">
    <th scope="row">Cubit Starting Page Content</th>
    <td><br/>
    Here you can choose in which way you want to add content to your starting page. <br/>
    You can either choose to edit the index.php file directly, or fill the page with 3 posts. <br/>
    If you choose <strong>posts</strong> please select a category as well. This category will be excluded from the news section.<br/>

    <br/>
    <label><input type="radio" name="fill_main" id="fill_main" value="1" <?php if ($fill_main == 1){echo "checked = checked";}?> /> Use HTML (edit html in index.php)</label><br/>
    <label><input type="radio" name="fill_main" id="fill_main" value="2" <?php if ($fill_main == 2){echo "checked = checked";}?> /> Use Posts</label><br/>

    Category for Posts IF using post is selected:<br/>

    <select class="postform" id="com_cat" name="com_cat">
    <option value="">Select Category</option>
    <?php
    $categories = get_categories('title_li=&orderby=name');
    foreach ($categories as $category){

    if ($com_cat == $category->term_id){
    $selected = "selected='selected'";
    }else{
    $selected = "";
    }
    echo"<option $selected value='". $category->term_id."'>". $category->name."</option>";
    }
    ?>
    </select>
    </td>
    </tr>


    <tr valign="top">
    <th scope="row">Cubit Portfolio Page Content</th>
    <td><br/>
    Here you can choose which category is your portfolio category.<br/> This category will be excluded from the news section.<br/>

    <br/>
    <select class="postform" id="com_port" name="com_port">
    <option value="">Select Category</option>
    <?php
    $categories = get_categories('title_li=&orderby=name');
    foreach ($categories as $category){

    if ($com_port == $category->term_id){
    $selected = "selected='selected'";
    }else{
    $selected = "";
    }
    echo"<option $selected value='". $category->term_id."'>". $category->name."</option>";
    }
    ?>
    </select>
    </td>
    </tr>

    <tr valign="top">
    <th scope="row"><label for="com_page">Page Navigation</label></th>
    <td>

    <input name="com_page" type="text" id="com_page" value="<?php if ($com_page){echo $com_page;}?>" size="70" maxlength="255" /><br/>
    Enter the query string of the pages you want to display in the main menu (top right corner of the page)<br/>
    If left empty it will display all pages<br/>
    Some Examples:<br/>
    <strong>include=9,16,22,24,33</strong> (this would display 5 menu items for the pages with the id 9, 16, 22, 24, 33)<br/>
    <strong>exclude=2,6,12</strong> (this would display menu itemsfor all pages except those with id 2, 6, 12)<br/>
    </td>
    </tr>

    <tr valign="top">
    <th scope="row"><label for="google_analaytics">Google analytics tracking code</label></th>
    <td>
    <textarea class="code" style="width: 98%; font-size: 12px;" id="google_analaytics" rows="10" cols="60" name="google_analaytics">
    <?php if ($google_analaytics){echo $google_analaytics;}?>
    </textarea>
    Enter your analtics tracking code here
    </td>
    </tr>


    </table>

    <p class="submit">
    <input id="kriesi_options" type="hidden" value="1" name="kriesi_options"/>
    <input type="submit" name="Submit" value="Save Changes" /></p>

    </form>

    </div>
    <?php
    }

    ?>

  4. #4
    TopDogger's Avatar
    TopDogger is offline Über Hund
    Join Date
    Jan 2009
    Location
    Hellfire, AZ
    Posts
    3,075
    Thanks
    347
    Thanked 913 Times in 697 Posts
    The first example does nothing except display the code you have between the strong tags.

    Try this to just display pages 2 and 3 in a menu. You might still have to format it using CSS.
    Code:
    <?php if ( is_home() ) { wp_list_pages('include=2,3&title_li=<h2>Category Title</h2>'); } ?>
    There is a plugin that allows you to control the pages that display in a menu without changing the code. You may want to try that first.

    http://wordpress.org/extend/plugins/exclude-pages/
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


  5. #5
    Brandon Dennis is offline Newbie Net Builder
    Join Date
    Apr 2009
    Posts
    24
    Thanks
    0
    Thanked 14 Times in 6 Posts
    Thanks again man. I just used the plugin.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •