Archived topic
Custom Blog Post Template for importing csv file
8 replies · Started by Robert on July 12, 2017
Hi I need to import over 200 posts into a blog, I can import them no problem using .csv , but then:
As you can see, I still need to open each post and make them full width and untick a bunch of settings, is there any way that it can be done automatically.
I use Elementor for the final template
All Import to fetch the posts
Hi there,
1. The page header. Currently, there's no way to do this globally. However, there will be in GPP 1.4: https://vimeo.com/223381628
2. The disable elements meta box. Are you wanting to disable these on all single posts? If so, I can give you some code.
3. Sidebar layout. You can set this in "Customize > Layout > Sidebars".
4. Full width content. Again, on all single posts? If so, I'll give you the code.
Thanks!
Hi Tom the code would be appreciated since if I do not need to keep ticking checkboxes and only do the header it will save me time :)
Robert
So, only on single posts, you want to disable:
Top bar
Header
Secondary Navigation
Content title
Footer
And you want the container to be full width?
Correct?
yip that will do it :)
Try this:
add_action( 'wp', 'tu_disable_global_elements' );
function tu_disable_global_elements() {
if ( is_single() ) {
remove_action( 'generate_before_header','generate_top_bar', 5 );
remove_action( 'generate_header','generate_construct_header' );
remove_action( 'generate_footer','generate_construct_footer' );
add_filter( 'generate_show_title', '__return_false' );
}
}
Then add this CSS:
.single .secondary-navigation {
display: none;
}
.single .container.grid-container {
max-width: 100%;
}
.single.no-sidebar.separate-containers .site-main {
margin: 0;
}
.single.separate-containers .inside-article,
.single.one-container .site-content {
padding: 0;
}
thank you i will try it now and get back to you
Tom thank you so much
I created a basic child theme added the functions code and css in to it and left everything default except the header options and tested it, perfect
You Rock
You're very welcome :)