Page no: P07
Page No: P07
This is a rather a design page, but it describe the functionality
Overview Light Version
The Light Version of Pictured Categories provides the following functionalities inspired from the Sahifa theme.
- We create a back-end functionality to set a category picture from Sahifa (“category logo”) and setting for authors and archives.
- Make it possible to view the category picture inside the category archives.
There are three other functionalities in the pictured category area:
- Make the home page or better all pages, “widgetable” and a page builder.
- Pictured Category Widget
- Pictured Category Menu
1. User Settings
With these plugins one can set an author avatar, an image of the author inside the user settings. This avatar is then shown on posts and pages. The Pictured Category by PromoteAuthor plugin shows it additionally on the archives.
2. General Archive Settings
Under “Tools–> PromoteAuthor Archives”, the WordPress admin can adjust the general settings for category archives and author archives.
The author archives permit to choose if the author’s bio and the author’s avatar are shown on the archives.
These settings trigger if a so-called “category picture” is shown. If an author is attached to a category, then one may show the bio of the author on this category.
The category picture and the link to the author are set in the category settings. Category settings may override the general archive settings.
3. Category Settings
Category picture in categories back-end:
The WP admin can access the settings via edit post category and quick edit post category.
- Show category pictures yes/no
- upload the picture
- Cat Pic used in the archives?
- Same as Yoast SEO does, we need a section called “PromoteAuthor Settings” that contains our new parameters.
The specification looks good. it is possible to be done in that way.
Tips & Tricks
With one simple function attached to the custom_post_author_archive hook, we can easily show both pages and authors on author archive page.
function custom_post_author_archive( &$query )
if ( $query->is_author )
$query->set( ‘post_type’, array(‘page’, ‘post’) );
remove_action( ‘pre_get_posts’, ‘page’ ); // run once!
add_action( ‘pre_get_posts’, ‘custom_post_author_archive’ );
See more for