Custom page for custom posts


Hello,

I've already found a lot of content here and I think I understood the very basic, but I still have some doubts:

1) Where can I find all avaiable hooks for templates?

I've collected some I've found:

beans_post_title_after_markup
beans_post_body_before_markup
beans_post_body_prepend_markup
beans_post_content_after_markup
beans_body_prepend_markup

2) What does _markup sufix mean? Is it the HTML tag? So _prepend_markup would insert custom content inside the html tags?

3) How to wrap the_content() with html and css markups? Maybe beans_post_content_before_markup and beans_post_content_after_markup?

4) How to activate Page Layouts for custom posts?

Thank you and best regards.

PS: It is a beautiful designed framework, I don't even know the full power of it, I'm discovering new functions everyday! Congrats!


Hi Leo and welcome to Beans Community,

  1. Here is an answer that you might benefit from and it will hopefully give you a better understanding of how to find hooks. If it doesn't, let me know and I will try to re-word it differently.

  2. Yes markup refers to HyperText Markup Language (HTML).

  3. While you could use beans_post_content_before_markup hook to add you opening wrapping div and beans_post_content_after_markup to close your wrapping div, Beans has other useful HTML API functions to achieve that in a "cleaner" way. In your example you could/should use beans_wrap_markup() (see reference here) as follow:
beans_wrap_markup( 'beans_post_content', 'example_post_wrap', 'div', array( 'class' => 'example-wrap-class' ) );
  1. Since Beans uses its Post Meta API to register the layout options, you can use the beans_post_meta_post_types_{$section} (see reference here) to add it to other post types. Here is how you could add the layout options on the attachment post type for example.
add_filter( 'beans_post_meta_post_types_tm-beans', 'example_register_beans_layout' );

function example_register_beans_layout( $conditions ) {
  $conditions[] = 'attachment';

 return $conditions;
}

If you don't understand everything from day 1, don't sweat it, it is a very complete framework with which you can really quickly build anything when you know it inside out and you will find really cool new features everyday. One step at the time 🙂

Last be not least, have fun!

Happy coding,


Hi, Thierry,

Sorry for not thank you before! I have lost the access to my another account!

Thank you for your awesome support!

Oh, and congrats again for your work, this framework really seems to be able to solve every thing!

Write a reply

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