Beans newbie trying to develop a theme from scratch


Hi everyone,

My name is Walleska and I am Beans newbie trying to develop a theme from scratch.

For now, my functions.php file is like this:

<?php

/* Include Beans. Do not remove the line below. */
require_once( get_template_directory() . '/lib/init.php' );

// Enqueue CSS.
add_action( 'wp_enqueue_scripts', 'beans_child_enqueue_assets' );

function beans_child_enqueue_assets() {

  wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' );

}

// Remove Header
beans_remove_action( 'beans_header_partial_template' );
// Remove Header Padding

beans_remove_attribute( 'beans_main', 'class', ' uk-block' );

// Remove Left Sidebar
add_action( 'widgets_init', 'example_widget_area' );

function example_widget_area() {

  beans_deregister_widget_area( 'sidebar_primary' );

}
// Remove Content Area
beans_remove_action( 'beans_content_template' );
// Remove Footer
beans_remove_action( 'beans_footer_partial_template' );

The code above resulted in a blank page just like I expected to. The problem is my CSS file I tried to change the background color just to test out if everything is working out well. See my code:

/* Content */
.tm-main {
    background-color: #000000;
}

But nothing has changed.... What am I doing wrong?

Thank you so much in advance for any help you can provide!


By including beans_remove_action( 'beans_content_template' ); you've removed the content area (that is, content written using the normal WP editor). There's nothing wrong with the CSS, but without any content the .tm-main element has no height which is why you're not seeing the background.

If you really want the content area gone, you could try doing this in page templates...

add_action( 'beans_main_append_markup', 'some_content' );

function some_content() {

  ?>

  <p>this is some content</p>
    <?php echo get_some_custom_field(); ?>

 <?php

}



Hello,

What do you want to do exactly ?

Center the logo of your header ? A quick search in the Beans Forum : https://community.getbeans.io/discussion/logo-between-menu/#post-3556. Maybe it helps ?

Do you want to display the sidebar to the left ? Then, in the WP customizer, choose the appropriate layout.

If you want efficient help, I would advise you to be more specific in the questions you ask and in the title of the tickets you open. I'm afraid that "Beans newbie trying to develop a theme from scratch" does not encourage people to help you... 🙁

Mathieu

Write a reply

Login or register to write a reply, it's free!