Support » Themes and Templates » Remove code that calls widget and call content in div

  • Hello all,

    I am trying to achieve something I am personally not capable off.

    This is part of the code I have in the homepage of my site:

    [code moderated as per forum rules – please use the pastebin. if you post small amounts of code here directly, please use the ‘code’ button to mark it properly.]

    Part of this code calls in a widget that displays content on my homepage. Using a widget to place information on a homepage is a rather strange way of placing text on the homepage. I simply want to use the editor of WordPress to place text in the homepage.
    What was suggested to me, was to place inside the code that calls the widget a div and call the content inside that div and style as necessary. However I am out of my depth here.

    Could anyone point me in the right direction?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The code you posted won’t add any default content in the Widgetized sidebar, so if you don’t have any Widgets defined for that sidebar, then nothing will display.

    From your dashboard, go to Appearance -> Widgets, and remove any Widgets from the sidebar, if you don’t want them to appear.

    I have no sidebar on my homepage I do have the option to add a tagline. I also have the option to add a widget which can contain text that then will be displayed on the homepage.

    I don’t want this I just want to add text to the homepage by going to Pages > Home and write whatever I want and have it appear on the Homepage.

    Now if I want text to appear on the homepage I need to use a widget.

    The Full code of the homepage can be found here (I have no idea how to post code here in a way that is allowed so I just post a link).

    [code moderated as per forum rules – please use the pastebin]

    Yes, you do have a sidebar on your homepage. That’s what this bit of code does:

    <?php if ( ! dynamic_sidebar( 'Homepage' ) ) :  endif; ?>

    Go to Dashboard -> Appearance -> Widgets, and ensure that you don’t have any Widgets added to a sidebar called “Homepage”.

    I indeed see I sidebar widget area under Appearance > Widgets but also a Homepage widget area. Both are empty.

    Your solution didn’t change anything Chip.

    I am still as stuck as I was.

    If you don’t have any Widgets defined in either of your Widgetized Sidebars, then the content you’re seeing, that you want to remove, is not a Widget.

    It is being added some other way.

    I think there is a miscommunication here:-).

    I don’t see any content.
    I want to add content.
    However the only way I can currently add content is by adding a widget to the homepage widget area and placing content in that widget.

    That is what I do not want, because I then don’t have access to the wysiwyg editor.

    I want to add content by just typing my content in the Homepage wysiwyg editor under Pages > Home.

    I can type whatever I want there but it does not appear on the page because there is some sort of call to content neccessary in the code provided above. This call to content must be placed instead of the code that calls the widget.

    See Line #28 of your pastebin.

    Your template file is calling the_content();

    You are right but that call calls in content into a slider at the top. That’s okay. However I need a new call to content. I now have removed lines 51 to 79 and 81 to 84 and placed between 51-79 the following:
    <?php the_content();?>.

    But all this does is call in the same content that is part of the last slide of the slider at the top.

    How would I go about adding my own new content in this location?

    The call to the_content(), whether it is called in your “slider” or in another part of the template file, displays whatever you have entered into the content area in the Edit Post screen.

    Hmmmm that would mean I can’t get the content I want below the slider because there is no way to differentiate between the content of the slider (just below the header but above the center of the page) and the content of the center part of the homepage.

    These two should be seperated but seem not to be:-(.

    Just off-hand, you could try using the_excerpt() for the slider, and the_content() for the main part of the page.

    This method gives you the advantage of being able to customize the output of the_excerpt() via the Excerpt field on the Edit Post screen.

    Thanks Chip!

    I will have a look and try your suggestion and see where it leads me.

    I highly appreciate your help on this!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Remove code that calls widget and call content in div’ is closed to new replies.