Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1287546

    Hi,

    I need to upload a template that has a header / footer but no sidebar.
    This is for a real estate plugin I use that has property pages scraped from a central server which are then dropped into my theme. It comes with its own sidebar so I need to disable the sidebar… but since these are virtual pages on my site there’s no way to go into each page and set the sidebar setting.
    It pulls the sidebars from somewhere in the theme templates ? section and they appear as a dropdown menu in the plugin options… so I would like to upload a template to Enfold that would appear in this dropdown.

    I do have one custom template that a developer created and it’s showing in my child theme under appearance –> theme editor. I do not use this template so maybe I could just customize it? Code is below…

    Thanks,
    Rob

    <?php /* Template Name: IDX w/Sidebar */ 
    	global $avia_config, $more;
    
    	/*
    	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    	 */
    	 get_header();
    ?>
    
    		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
    
    			<div class='container test'>
    
    				<main class='template-page content  <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>
    
                        <?php
                        if(!empty($avia_config['conditionals']['is_builder']))
    					 {
    						$avia_config['conditionals']['is_builder_template'] = true;
    						get_template_part('template-builder');
    						exit();
    					 }
    					 else
    					 {
    						get_template_part('page');
    						exit();
    					 }
                        ?>
    
    				<!--end content-->
    				</main>
    
    				<?php
    
    				//get the sidebar
    				//$avia_config['currently_viewing'] = 'page';
    				get_sidebar('IDX');
    
    				?>
    
    			</div><!--end container-->
    
    		</div><!-- close default .container_wrap element -->
    
    <?php get_footer(); ?>
    #1287668

    Hi Rob,

    Thanks for contacting us!

    As far as I remember, you have a staging site. Could you please change following line

    get_sidebar('IDX');

    to following one

    //get_sidebar('IDX');

    and check if that helps? :)

    Cheers!
    Yigit

    #1287781

    Thanks for the response, Yigit! I tried that and it does make a change but we still end up with a blank sidebar.
    Easier to show you than try to explain.
    Here is a page using the default template:
    Screenshot-2021-03-12-20-CORTE-PLACIDA-GREENBRAE-CA-94904-Greenbrae-Home-for-Sale-Thomas-Henthorne-2

    And here is that same page after switching to the template with the “show sidebar” commented out:

    Screenshot-2021-03-12-20-CORTE-PLACIDA-GREENBRAE-CA-94904-Greenbrae-Home-for-Sale-Thomas-Henthorne-1

    As you can see from the second image where the show sidebar is commented out, the sidebar shifts to the left and leaves a big blank space on the right.
    Any additional ideas? I have also tried using the “archives” template which appears in my dropdown menu and turning off sidebar for archives, but sidebar also appears there even when turned off.

    Thanks,
    Rob

    #1289722

    Hi Rob,

    Sorry for my late reply!

    Please add following code to Quick CSS, replace the “Filename-of-your-file” with the filename of your file and it will be fixed :)

    .page-template-Filename-of-your-file .container .av-content-small.units {
        width: 100%;
        border: none;
    }

    If your file is named page_idx-template.php, your code would look as following

    .page-template-page_idx-template .container .av-content-small.units {
        width: 100%;
        border: none;
    }

    Best regards,
    Yigit

    #1289723

    Thanks Yigit!
    In the meantime I went ahead and changed default for the site to “no sidebars” and then added them to pages where I need them… that seems to be working… but I am going to save this thread in case I need to go back to a different approach.
    Is it possible to leave this thread open for a little while in case?

    Thanks!
    Rob

    #1289862

    Hi Rob,

    Sure! Thread will be on hold and you can simply reply to re-open it :)

    You are welcome!

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.