• Hi All,

    I’m converting a HTML site to WordPress and I’m faced with importing the sidebar on every page. I’m using WordPress Import 2 plugin with good success on other sites but here I can’t seem to avoid importing the sidebar with every page.

    I could have a solution if I can selectively remove a particular div id I could make it work. I “think” I need some jQuery script to remove it before the closing /body tag though I’m honestly not sure.

    Here is the source of the page:

    <div id="columnMain">
    <div id="contentLeft">
    CONTENT HERE
    </div>
    <div id="containerPageTitle">
    <h1 id="pageTitle">Criminal Defense Lawyers</h1>
    </div>
    <div id="content">

    and here is what I was using before /body:

    <script>
    $(document).ready(function(){
        $("#contentLeft").remove();
    });
    <script>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Any help is appreciated.

    Eric

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m faced with importing the sidebar on every page

    What do you mean by “importing the sidebar “?

    Thread Starter murthax

    (@murthax)

    Well the HTML imported page has a section that I seem forced to import (a div id). I want to remove that section on every page.

    So this div is in the old site?

    Thread Starter murthax

    (@murthax)

    Yea, it’s on every page like:
    <div id=”columnMain”>
    <div id=”contentLeft”>
    CONTENT HERE
    </div>
    <div id=”containerPageTitle”>
    <h1 id=”pageTitle”>Criminal Defense Lawyers</h1>
    </div>
    <div id=”content”>

    As this isn’t actually a WordPress issue, all I can suggest is that you try using a search & replace tool that can grep multiple files and remove that markup.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove Elements by div id’ is closed to new replies.