-
AuthorPosts
-
March 11, 2021 at 9:08 pm #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(); ?>
March 12, 2021 at 1:12 pm #1287668Hi 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!
YigitMarch 12, 2021 at 5:38 pm #1287781Thanks 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:
And here is that same page after switching to the template with the “show sidebar” commented out:
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,
RobMarch 22, 2021 at 10:24 pm #1289722Hi 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,
YigitMarch 22, 2021 at 10:26 pm #1289723Thanks 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!
RobMarch 23, 2021 at 1:49 pm #1289862 -
AuthorPosts
- You must be logged in to reply to this topic.