Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Problematic PHP Navigation Code: [modified]

Problematic PHP Navigation Code: [modified]

Scheduled Pinned Locked Moved Web Development
phpcsharpcomhelpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrewVos
    wrote on last edited by
    #1

    I'm trying to get my wordpress working right. I want to add the Search function, and maybe a Categories function if possible. I was told code_frog or Christian could help me, cause the dabble in WordPress?? http://blogs.wickedorange.com/andrew/ Heres the code which works:

    >home Here's the code i added, which doesn't work...* .NET Search

    www.wickedorange.com

    M R 2 Replies Last reply
    0
    • A AndrewVos

      I'm trying to get my wordpress working right. I want to add the Search function, and maybe a Categories function if possible. I was told code_frog or Christian could help me, cause the dabble in WordPress?? http://blogs.wickedorange.com/andrew/ Heres the code which works:

      >home Here's the code i added, which doesn't work...* .NET Search

      www.wickedorange.com

      M Offline
      M Offline
      MatrixCoder
      wrote on last edited by
      #2

      AndrewVos wrote:

      Here's the code i added, which doesn't work...

      What do you mean? What happens when you use that bit of code?


      Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.

      A 1 Reply Last reply
      0
      • A AndrewVos

        I'm trying to get my wordpress working right. I want to add the Search function, and maybe a Categories function if possible. I was told code_frog or Christian could help me, cause the dabble in WordPress?? http://blogs.wickedorange.com/andrew/ Heres the code which works:

        >home Here's the code i added, which doesn't work...* .NET Search

        www.wickedorange.com

        R Offline
        R Offline
        realJSOP
        wrote on last edited by
        #3

        When I need to do php stuff inside html, I build the string and then echo it.

        <?php

        $strHtml = "<div id=\"header\"></div>";
        $strHtml .= "<div id=\"container\">";
        $strHtml .= "<ul id=\"nav\">";
        $strHtml .= "<li ";
        if (is_home())
        {
        $strHtml .= "id=\"current\"";
        }
        $strHtml .= ">"
        $strHtml .= get_settings('home');
        $strHtml .= " title=\"home\">home</a>";
        $strHtml .= "</li>";

        $strHtml .= "<li>";
        $strHtml .= "<a href=\"?paged_id=110\">.NET Search</a>";
        $strHtml .= "</li>";
        $strHtml .= "</ul>";
        $strHtml .= "</div>";

        echo $strHtml;
        ?>

        You also have an extra /ul and were missing a /div...

        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

        B 1 Reply Last reply
        0
        • R realJSOP

          When I need to do php stuff inside html, I build the string and then echo it.

          <?php

          $strHtml = "<div id=\"header\"></div>";
          $strHtml .= "<div id=\"container\">";
          $strHtml .= "<ul id=\"nav\">";
          $strHtml .= "<li ";
          if (is_home())
          {
          $strHtml .= "id=\"current\"";
          }
          $strHtml .= ">"
          $strHtml .= get_settings('home');
          $strHtml .= " title=\"home\">home</a>";
          $strHtml .= "</li>";

          $strHtml .= "<li>";
          $strHtml .= "<a href=\"?paged_id=110\">.NET Search</a>";
          $strHtml .= "</li>";
          $strHtml .= "</ul>";
          $strHtml .= "</div>";

          echo $strHtml;
          ?>

          You also have an extra /ul and were missing a /div...

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          B Offline
          B Offline
          Bradml
          wrote on last edited by
          #4

          Just to be the little nit picker I am, echo'ing text takes 1/4 more time then leaving it outside of PHP tags. Usefull fact when printing over 1,000,000 records.

          1 Reply Last reply
          0
          • M MatrixCoder

            AndrewVos wrote:

            Here's the code i added, which doesn't work...

            What do you mean? What happens when you use that bit of code?


            Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.

            A Offline
            A Offline
            AndrewVos
            wrote on last edited by
            #5

            Well, the .NET Search button doesn't show as selected when on that page. How would I do an If url = someurl in php? Also, what is the link for the search page in wordpress?


            www.wickedorange.com

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups