Forum has been created to help all our customers in properly working our theme. We offer complete help with configuration theme and make default look, just like on our Pindol demo. We don`t offer theme customization.

Before creating a new discussion, please:
1. Check on forum if discussion hasn`t been created before. Use the forum Search on the right.
2. Read carefully the documentation included to package.
If you didn`t find what you need and would like to post a new question click the "Start a New Discussion" button on the right.
4. You can post on forum only after registration (you need purchase code to register) .


NOTE!!! If you are starting a new topic and have got problems with your site and you want us to check what`s wrong please always give url to your site because without that we can`t check what`s wrong. Each case may be different because of your installed plugins, servers or other things.

Add sidebar to template php file
  • Hello,

    I am in the process of creating an author.php template.
    I know this theme does not come with one as standard so have done my research and created a the page myself.

    Everything works fine apart from the fact i cannot get a sidebar to display.

    An example of the page is here


    <?php

    get_header(); 
    $sidebar = mfn_sidebar_classes();
    ?>

    <!-- #Content -->
    <div id="Content">
    <div class="container">

    <!-- .content -->
    <?php 
    $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
    if( $sidebar ) echo '<div class="content">';
    echo '<div class="the_content_wrapper">';
    echo "
    <table id='profile_table'>
    <tbody>

    ....

    </tbody>
    </table>";
     

    echo '</div>'; 

     if( $sidebar ){ 
     echo '</div>';
     } 
    else { 
     echo '<div class="clearfix"></div>'; 
     } 
     ?>

     <!-- Sidebar --> 
     <?php
    if( $sidebar ){ 
     get_sidebar( 'Advert' ); 
     }
    ?> 

     </div> 

    </div> 

     <?php get_footer(); ?>

  • 4 Comments sorted by
  • Can i ask why not ?

    Surely it is just a case of adding the required code ?

    I have managed to add the sidebar by replacing '$sidebar = mfn_sidebar_classes();' with: 

    $sidebars = mfn_opts_get( 'sidebars' );
    $sidebar = get_post_meta($post->ID, 'mfn-post-sidebar', true);
    $sidebar = $sidebars[$sidebar];

    I now need to add the following into the <body> HTML tag: 'with_aside aside_right'


    Can you tell me how to add this then ?
  • Resolved!

    For anyone who is reading this and has a similar query the solution is as follows:

    Add the following just below your get_header() function:

    $sidebars = mfn_opts_get( 'sidebars' );
    $sidebar = get_post_meta($post->ID, 'mfn-post-sidebar', true);
    $sidebar = $sidebars[$sidebar];

    and then manually code in the body tags at the very top and bottom of the document. (which was obtained from a post page that has the layout i wanted to mimic).

    Not ideal as it is statically coded, but it does have the desired effect