Beans Layouts 101


That's basically it - you just created a page template which you can select when editing a page on WP Admin. If you wanted to create a post type-specific template, you'd have to name the file single-{post_type}.php and get rid of the Template Name: Test Page Layout part. (See https://codex.wordpress.org/Post_Type_Templates.)

On the page you referenced, those hooks beans_header_after_markup and beans_content_prepend_markup are places in a Beans theme where you can insert / manipulate / remove content and such.

Running with the example you gave, here's your template with some said hooks in action.

<?php
/*
Template Name: Test Page Layout
*/

// some text just after content
add_action( 'beans_content_append_markup', 'template_stuff' );

function template_stuff() {

 ?>

  <div class="uk-text-center uk-margin-top">
    <span class="uk-h1">something after content is displayed</span>
 </div>

  <?php

}

beans_load_document();

To see more Beans hooks, enable developer mode (from WP Admin, Appearance -> Settings) then go to the front and and open your console. Browse through the markup, you'll see parts that look like data-markup-id="beans_content_append_markup". Those are all places that you can manipulate using Beans.


Thats great - thenks Kevin. Works fine. No idea why mine wasn't working!

Write a reply

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