Support » Themes and Templates » Need Help Converting Some PHP to HTML

  • Resolved The Night Fox



    I am the webmaster of a website called I’m trying to edit the category menu so that I can list the categories using HTML instead of using PHP to call them from a wordpress database.

    I tried simply implementing an unordered list, but some of the styling features no longer work. If you click the link above and look at the category menu you will notice that as you scoll over the category name a black border surounds the link. When I implemented the unordered list the styling now looks like this when I hover over a link (also notice the links are side by side without any space). I think the styling features are controlled in my theme functions file, specifically ‘function themefunction_category_menu’

    Can anyone shed some light on how I might go about implementing the style function from my theme functions file via css or raw html?

    Pastebin of theme functions file

Viewing 3 replies - 1 through 3 (of 3 total)
  • If the category menu is already displaying the way you want it to look when using the PHP, then put that up on a page. Do a browser View Source, and copy and paste the HTML code generated for the category menu. It will contain all the ID’s and classes you need to get the menu to display, in HTML as it does using the PHP routine.

    Thanks, can’t believe I overlooked such a simple idea!

    Oh, I forgot one thing…

    When you copy the HTML, a special class is going to be set on the category that is active/current when you copy the HTML. Because you are pasting the HTML, that will be permanently set on the one category that was active when you captured the HTML.

    Some themes use that special class to CSS style the active menu item. If you find you can’t make the one category look like all the others, this will be why. You’ll need to look at the classes assigned to that one category and remove the ones that aren’t on the other categories.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need Help Converting Some PHP to HTML’ is closed to new replies.