ThemeShaper Forums » Thematic

[closed]

Best way to change order of HTML elements

(6 posts)
  • Started 8 years ago by ephemeral
  • Latest reply from ephemeral
  • This topic is resolved
  1. Here is my scenario: I need to know the best way to change when/where an HTML element is inserted into the page.

    What I want to do is to be able to float two content blocks to the right of the #blog-title div. However, in order for float: right to render correctly, these elements (#blog-description and another div) have to come before #blog-title in the HTML. How can I tell Thematic to put them before #blog-title in the HTML source?

    (I am using negative margins to position these elements at the moment. It's working, but a lot more "messy" than I want.)

    Posted 8 years ago #
  2. This sounds like something that can be done with CSS. Do you have an example site up, or mockup image?

    Really there are very few scenarios where you should have to restructure the header area, it actually is pretty versatile the way it is set up.

    Posted 8 years ago #
  3. I just decided to float everything left to get proper alignment instead of floating my 2 out of 3 of my blocks to the right. :)

    However, I do still want to know how I would go about doing what I described in my original question, should I ever need to change the order in which the HTML elements are organized in the source.

    Posted 8 years ago #
  4. Restructuring the header is fairly simple.

    I would suggest checking out this post, http://forums.themeshaper.com/topic/move-header-above-wrapper-in-functionsphp just to get an idea, see all the numbers? That is just a stacking order, to move the blog description above the title, you just remove_action from blog description in slot 5 it from its normal place, and add_action it back in but change the number to 2.

    Also for reference, http://www.bluemandala.com/thematic/thematic-structure.html

    Posted 8 years ago #
  5. thumbs up to scott's answer. to reorder the markup, you remove things from their current hooks and add them to new ones. or in the case of the thematic_header you remove things from their current 'priority' (i like stacking number better) and move them to a different priority.

    another good reference:
    http://visualizing.thematic4you.com/

    Posted 8 years ago #
  6. Thanks guys, that does help with order in the header.

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.