• I’ve been searching Google and the forum, but I can’t find exactly what I’m looking for.
    I’m building a child theme based on TwentyTen. What I want is:

    Also show the static content I’ve written in the editor of my blogpage.

    When I make a static page I write the content in the editor on the admin-page. That content is shown on the page.

    When I write content in editor when that page is my blogpage the content I wrote in the editor is not shown. I want this to be visible.

    Like this:

    ********************************************

    Text written in the editor on the adminpage.

    ********************************************

    Post 1

    **********************************************

    Post 2

    **********************************************

    Etc.

    **********************************************

    I want this to be able to edit the text on the top of the blogpage.
    A sticky post is not an option because that does give the layout that I want.

    Any help is very much appriciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Your best bet is to add a Widgetized Sidebar above the Loop, and then add your static content to a Text Widget, placed in this Widgetized Sidebar.

    Thread Starter Theo

    (@theow)

    Hi Chip,

    Thanks for your reaction.
    As far as I can understand from the name “Widgetized Sidebar” this is something to put in the sidebar. Am I right?

    I’m looking for something to put above my posts in the content area.

    As far as I can understand from the name “Widgetized Sidebar” this is something to put in the sidebar. Am I right?

    No, a Widgetized “Sidebar” can go anywhere you want to put one. The “Sidebar” part of the nomenclature is a misnomer, but we are stuck with it.

    Think of it as a Widgetized “area” instead.

    I’m looking for something to put above my posts in the content area.

    Right – for which a Widgitzed sidebar will suit your needs perfectly.

    You need to add a call to register_sidebar() in your functinos.php file:
    http://codex.wordpress.org/Function_Reference/register_sidebar

    Something like this:

    register_sidebar(array( // Above-Loop widget area
    'name'=>'sidebar-loop-above',
    'description' => 'Widget area to display above the Loop',
    'before_widget' => '<div id="%1$s" class="widget %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<div class="title widgettitle">',
    'after_title' => '</div>',
    ));

    Then, look for this line in your template files (i.e. index.php, archive.php, etc. – may be in a file such as “loop.php”):

    if ( have_posts() ) : while ( have_posts() ) : the_post();

    immediately above that line, you need to add a call to dynamic_sidebar():
    http://codex.wordpress.org/Function_Reference/dynamic_sidebar

    Something like this:

    <?php if ( !dynamic_sidebar( 'sidebar-loop-above' ) ) {
    
    // Add any default, non-Widget content here
    
    } ?>

    Thread Starter Theo

    (@theow)

    Hi Chip,

    It took me some time to figure this out.
    I did it the way you explained it, but it is not exactly what I want, although it is going in the right direction.
    When I do it that way, I get an extra widget area (which btw. is good I know now how to do that, too). But that way I don’t have the same styling as my other pages.

    This is my code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Is there a php-command I can insert in the code above beneath the <div class=”entry-content”> so I can just edit the text like on any other page?

    You help is very much appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Also show the static content on the blog page’ is closed to new replies.