WordPress.org

Ready to get started?Download WordPress

Forums

Coraline
[resolved] save different page templates with custom widget area (4 posts)

  1. ceffi
    Member
    Posted 2 years ago #

    hi I'm new and not very familiar with WP and coraline.

    I've tried to generate and save different page templates with different widget arrangements. Does this work with coraline?

    thx in advance
    ceffi

    http://wordpress.org/extend/themes/coraline/

  2. ceffi
    Member
    Posted 2 years ago #

    Hello,
    good morning

    is there no one woh can help me or is this a bad question?

    best regards
    ceffi

  3. igoddess
    Member
    Posted 2 years ago #

    I would like to know the answer to this also. Or to have an option to choose a one-or-two-column template when creating individual pages.

    Anita

  4. marties
    Member
    Posted 1 year ago #

    hi,
    i found an option, it's a two part modifications :
    in functions.php i added the id's post where i wanted a 2cols template 3 by default for me) to give some space for a forum ; the first modifications is for the classes added to body tag.

    Find this function and add this line at the begining

    function coraline_current_layout() {
    $pagesforum = array(0,4,5,6,7,8,9) // line to add ; define the ids for 2 cols instead of 3 cols by default;

    Add this line for the first test and modify if to elseif

    if (in_array(get_the_ID(),$pagesforum) || is_single() || is_page())
    		return 'two-column ' . 'content-sidebar';
    	elseif ( in_array( $current_layout, $two_columns ) )
    		return 'two-column ' . $current_layout;

    Then in sidebar.php encapsulate the sidebar you want to get rid of based on your test
    define the array of pages where you don't want 3 cols by adding this line

    <?php $pagesforum = array(0,4,5,6,7,8,9); ?>

    then add this tag around the sidebar code (ie <div id="primary" class="widget-area" role="complementary">)

    <?php if (!in_array(get_the_ID(),$pagesforum) && !is_single() && !is_page()) : ?>
    <div id="primary" class="widget-area" role="complementary">

    then after the closing div add

    <?php endif; // ends the check 2 cols ?>

    Hope that helps

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags