• OK I’m fairly new to WordPress but I have a problem that should be fairly easy to solve, except I can’t find the solution online.

    I’m using the Gridline theme which uses a separate front page. So all the wonderful widgets I add to the sidebar don’t show up on the front page. I want to display the text widget on the right side of the front page, sounds simple.

    I’ve found the file to alter it’s /wp-content/themes/gridline/library/apps/featured.php. I’ve managed to insert the datafeedr ads on the front page by just pasting the template code: <?php if (function_exists(‘dfrads’)) { echo dfrads(‘xxxxxxx’); } ?>. Works great but how do I do that with other widgets, specifically the text widget. Does it have a template code?

    I’ve already wasted a couple of hours searching for the answer so I’m hoping someone will have some insights.

    M

Viewing 2 replies - 1 through 2 (of 2 total)
  • You’d be better off editing the template and adding in a widgetable area.
    see:
    https://codex.www.ads-software.com/Widgets_API

    Thread Starter mcbryant

    (@mcbryant)

    Thanks I gave that a try but found all sorts of formatting issues arose plus they’d have to enter a new text widget in the new widgetable area and duplicate entering text. I found a better solution.

    I put the sidebar on the front page using the <?php get_sidebar(); ?> command in the featured.php page and then used the widget logic plugin to turn off all widgets except the text widget on the front page. Allowed me to add a subset of the sidebar to the front page without too much fuss.

    M

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Inserting widgets in PHP code?’ is closed to new replies.