SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Guru
    Join Date
    Feb 2006
    Posts
    980
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's wrong with this code?

    Ever since I added this code to three pages, the code goes wonky when the client tries updating any page (it's WordPress). It doesn't happen when I update it for some reason. What's wrong with the code? Site is subtleyoga.com.

    HTML Code:
    <div class="faculty">
    <a href="http://www.subtleyoga.com/about-kaoverii/"><img class="fltleft" src="http://www.subtleyoga.com/wp-content/uploads/2011/08/kaoverii-small.jpg" alt="Kristine Kaoverii Weber, MA, eRYT500" title="Kristine Kaoverii Weber, MA, eRYT500" width="127" height="166" /></a>
    <p><span class="bio-title">Program Director<br />
    Kristine Kaoverii Weber, MA, eRYT500</span><br />
    Kaoverii Weber teaches about half of the curriculum. <a href="http://www.subtleyoga.com/about-kaoverii/">Please click here for more about Kaoverii.</a></p>
    <div class="clearfloat"></div>
    </div>
    CSS
    Code:
    .bio-title{font-weight:bold;}
    #content img.fltleft{float:left;margin:0 10px 5px 0;}
    .clearfloat{clear:both;}
    .faculty{background-color:#E8E8E8; margin:10px 20px 20px 20px;}
    #content .faculty p{margin:0 20px 10px 8px;}

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    I don't know where on your site this code appears, but anyway, even though it's "valid" to have an <a> next to a <p>, generally it can lead to buggy page rendering to do so. It's better to wrap the <a> in a block level element, even if a <div>. For more suggestions, could you point out where this code appears on your site?

  3. #3
    SitePoint Guru
    Join Date
    Feb 2006
    Posts
    980
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ralph. Here's the page: subtleyoga.com/yoga-teacher-training/ryt-200/. This is one page I haven't fixed yet - see most of the text is not lined up and too large? WordPress just adds <div></div> tags around every line -- replaces most <p></p> tags with them every time she does an edit - no matter how small. And this also messes up the faculty section. Here's a page I fixed - how it's supposed to look: subtleyoga.com/yoga-teacher-training/ryt500-chattanooga/

  4. #4
    SitePoint Guru
    Join Date
    Feb 2006
    Posts
    980
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any ideas Ralph?

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    From an HTML standpoint, it's obvious what to do, but with WordPress in the mix it's a different ball game, and I'm not up to speed with that. [I've moved this to the WP forum in the hope that someone there will have suggestions from that point of view.]

  6. #6
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    How does she enter the content? Does she include the HTML in her posts manually? If so, an option might be to disable WordPress' auto-paragraphing function by placing the following line in your /themes/mytheme/functions.php file:

    Code PHP:
    remove_filter('the_content', 'wpautop');
    Maleika E. A. | Rockatee | Twitter | Dribbble



  7. #7
    SitePoint Guru
    Join Date
    Feb 2006
    Posts
    980
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Ralph, what's the solution from an html standard? It might work.

    @Kohoutek, thanks. I think she just uses design view - she doesn't know html. I did ask her to use the html tab and make changes but it always messes up when she does it. I could try that though.

  8. #8
    SitePoint Guru
    Join Date
    Feb 2006
    Posts
    980
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need to fix the page that has the bad code. @Ralph, what's the solution you're referring to? @kahouteck? Thanks!

  9. #9
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    If you applied the filter I posted, then she'd have to use HTML view and add the markup herself. That may be more work but it'd also give her more control.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Sculley View Post
    @Ralph, what's the solution you're referring to?
    Even like something you have on the page that you've fixed is OK. So I meant that it's easy to do this statically, but when using WP there are more factors involved. [I didtched WP some years ago, because I found other tools that were better for this kind of scenario.]

  11. #11
    SitePoint Guru
    Join Date
    Feb 2006
    Posts
    980
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @kohoutek - she doesn't know html or any kind of markup. @Ralph, what are those other tools? I am pretty sick of WP.

  12. #12
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Sculley, another option would be to install a different editor. There are many alternate editors for WordPress, some of which simplify the content creation process, such as this one. If you type in "simple editor" or a similar term on WP's plugin repository, you'll get quite a few results, some of which might be a good fit and also rectify the issue you're currently having with the default editor.

    If you want to move away from WordPress as a whole, you could use some of the simpler CMSes such as Perch or TextPattern. They're both very, very good alternatives, a lot simpler, but they might be sufficient for the task.

    For bigger sites, you could look into ExpressionEngine. It's what I use and I couldn't be happier with my choice.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  13. #13
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by kohoutek View Post
    For bigger sites, you could look into ExpressionEngine. It's what I use and I couldn't be happier with my choice.
    +1 for Perch and ExpressionEngine.

  14. #14
    SitePoint Guru
    Join Date
    Feb 2006
    Posts
    980
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, thanks so much. I'll look into 'simple editor' and see if that works. Thank you both so much for your help!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •