• Resolved Hachi

    (@hachi)


    I was wondering, I want to add some pages to my blix layout. I don’t want them to be in the navigation at the top, though, I just want to add links to them in my sidebar, to reduce clutter. Could anyone help me out?

Viewing 5 replies - 1 through 5 (of 5 total)
  • In the header.php of that theme you’ll find a <ul> element which has a bit of PHP that displays the Page links. You can remove this to take it out of your header, and then copy it over to your sidebar.php, or make use of the wp_list_pages() tag:

    https://codex.www.ads-software.com/Template_Tags/wp_list_pages

    Thread Starter Hachi

    (@hachi)

    Well, I still want to have some up there, but not all of the pages, just the ones that are already up there. Here is the code:

      <li<?php if (is_home()) echo ” class=\”selected\””; ?>>“>Home
      <?php
      $pages = BX_get_pages();
      if ($pages) {
      foreach ($pages as $page) {
      $page_id = $page->ID;
      $page_title = $page->post_title;
      $page_name = $page->post_name;
      if ($page_name == “archives”) {
      (is_page($page_id) || is_archive() || is_search() || is_single())?$selected = ‘ class=”selected”‘:$selected=”;
      echo “<li”.$selected.”>Archives\n”;
      }
      elseif($page_name == “about”) {
      (is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
      echo “<li”.$selected.”>About\n”;
      }
      elseif ($page_name == “contact”) {
      (is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
      echo “<li”.$selected.”>Contact\n”;
      }
      elseif ($page_name == “about_short”) {/*ignore*/}
      else {
      (is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
      echo ”

    • $page_title
    • \n”;
      }
      }
      }
      ?>

    Now, it already has a condition for a page named about_short, to exclude it, but I would like to exclude some more, what kind of coding would I need to do that?

    This version of it only displays the home, archives, about and contact Page links:

    https://pastebin.com/301226

    Note that I’ve just shut off what’s displayed to the if/elseif statements that test the Page name slug. For any Pages you want displayed there, just replace an elseif you don’t require, or insert a new one.

    Thread Starter Hachi

    (@hachi)

    Thanks!

    How can you make pages without getting on the navbar or on any menu? just a page.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Pages and Blix’ is closed to new replies.