WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need Help Converting Some PHP to HTML (4 posts)

  1. The Night Fox
    Member
    Posted 3 years ago #

    Hi,

    I am the webmaster of a website called videogamecoupons.org. 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

  2. stvwlf
    Member
    Posted 3 years ago #

    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.

  3. The Night Fox
    Member
    Posted 3 years ago #

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

  4. stvwlf
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.