Hot answers tagged


I'd suggest to not add layout, but MarkUp and offer an option to override it. The best way to do this would be to add to a hook that your users can add to their themes templates. // Theme template file do_action( 'hotel_rooms' ); // Your plugin hooks in there: add_action( 'hotel_rooms', 'callback' ); function callback() { echo "I am displaying details ...


get_the_category() retrieves the current post categories. To get all categories you should use get_categories() instead


get_post_format() returns the post format slug for either the current post, when used inside a loop, or a given post, when a WP_Post object or an integer post ID is passed to it as a parameter. So, if you're using the function in a posts loop, then you can use it like this, while ( have_posts() ) { the_post(); if ( 'gallery' === get_post_format() ) { ...

Only top voted, non community-wiki answers of a minimum length are eligible