TBM_Print.php - AlexWT/TheBigMagazine GitHub Wiki
The most called class from my project specificly. It contain methods that do common job for the developer like calling list of posts, listing categories, printing the author link and others. Here is full list of them:
Message()
public function message( $type = 'notice', $msg = 'Notice: Add a message and type!' ) - Prints message on the screen. It is allready styled but you can style it as you like. It has 8 diferent styles - blue orange green red magenta black white
Breadcrumbs()
public function breadcrumbs() - Display breadcrumbs for the current page. The breadcrumbs them self are located in another file, but instead of making objects and calling a method from it, its separated like that + it keep the logic to print content from the TBM_Print class.
Author_link()
public function author_link() - Because of the weird actions from the build in to the core function the_author( ) i decided to write my own function. This will print on the screen ( by the right way ) who is the author and a link to the posts by the given author. No parameters are needed.
Pagination()
public function pagination() - Print on the screen pagination links. Can be used from various of pages, like categories, tags and so on.
List_categories()
public function list_categories( $parent = 'uncategorized', $print_ul = true, $limit = 3 ) - List categories from given parent slug ame. There is simpler wordpress function for this logic, but not with the parent category. This is why this comes in handy. (as well as the limit variable for the categories).
Prev_next_links()
public function prev_next_links( $link = 'both', $length = 0, $before = '', $after = '' ) - Previous and next posts for posts. If there are no more posts left, the next link will be unclickable, because, if we could click it, there would be errors appearing.
Posts()
public function posts( $category = NULL , $limit = 3, $offset = 1, $print_ul = true, $show_comments = true ) - Query $count posts in unordered list. This is in its own function, because its helpful in many parts of the site, instead of writing queries in the template files.
Comments_title()
public function comments_title() - Print the comments title for single pages. Its separated on another method for better read insidte the comments template. ( + if its used elsewhere )
Category_name()
public function category_name( $print_link = FALSE ) - Link to one post category whitout anyhing else. It can also give a string only.