Search page



Hey Jason,

As Jochen mentioned, Banks search page is a good example. I think what you are looking for is the following snippet:

// Post.
beans_add_attribute( 'beans_content', 'class', 'uk-panel-box' );
beans_remove_attribute( 'beans_post', 'class', 'uk-panel-box' );
beans_modify_markup( 'beans_post_title', 'h2' );
beans_add_attribute( 'beans_post_title', 'class', 'uk-h2' );

// Post image.
beans_remove_action( 'beans_post_image' );

// Post meta.
beans_remove_action( 'beans_post_meta' );
beans_remove_action( 'beans_post_meta_tags' );
beans_remove_action( 'beans_post_meta_categories' );

// Truncate content.
add_action( 'the_content', 'example_truncate_content' );

function example_truncate_content( $content ) {

     return '<p>' . wp_trim_words( wp_strip_all_tags( $content, true ), 55, ' ...' ) . '</p>';

}

// Add horizontal dividers.
add_action( 'beans_post_before_markup', 'example_horizontal_divider' );
add_action( 'beans_posts_pagination_before_markup', 'example_horizontal_divider' );

function example_horizontal_divider() {

    ?><hr class="uk-article-divider" /><?php

}

// Load document which is always needed at the bottom of template files.
beans_load_document();

Note that I didn't add your custom footer and layout modification which I will let you add yourself (before the beans_load_document(); line indeed). Regarding the uk-hidden added to the footer, if the intention is to hide/remove remove it, you should rather use beans_remove_action( 'beans_footer_partial_template' ); so that it doesn't load on the page (hiding is not very good practice).

Have fun,


Thanks guys

Yes that's exactly what I needed.

Cheers Jason


Fantastic, I am glad we could help Jason 🙂

Happy coding,

Write a reply

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