Hi. I want to create a blank template for my website homepage.
Here's what I have. I know this is not the best practice.
<?php /* Template Name: Blank Page */
// Add hero after header.
add_action( 'beans_header_after_markup', 'example_hero' );
function example_hero() {
?>
<div class="tm-main tm-hero uk-block-large">
<div class="uk-container uk-container-center uk-text-center">
MAIN CONTENT HERE
</div>
</div>
<?php
}
// Replace the main loop with my own section.
beans_modify_action_callback( 'beans_loop_template', 'example_content' );
function example_content() {
?>
<?php
}
// Load the document which is always needed at the bottom of template files.
beans_load_document();
But the thing is I want to be able to update the content from Wordpress without touching the theme editor.
How can I call the wordpress the_content only from the loop? I don't need the breadcrumb, title, meta, comments and stuff.
Thanks.
/**
* Since you are replacing 1/3 of the theme,
* you can do it with the WordPress way.
*
* Instead of loading the entire document, `beans_load_document()`,
* load only parts that you want.
*
* Template Name: Blank Page
*/
/**
* Here you can modify the Beans Header and Footer sections ONLY,
* using their helper functions.
*/
// beans_add_attribute(); // just an example.
beans_add_filter( 'beans_layout', 'c' ); // show content only.
/**
* After changes, load the parts you want
* and not the entire document `beans_load_document()`.
*/
// Load Beans header only.
get_header();
// Your custom content here.
the_content();
// Load Beans footer only.
get_footer();