mirror of
https://gh.llkk.cc/https://github.com/Tetrakern/fictioneer-child-theme.git
synced 2025-10-04 18:31:00 +08:00
Base child theme of Fictioneer for WordPress
.github | ||
css | ||
js | ||
.gitignore | ||
functions.php | ||
LICENSE | ||
README.md | ||
style.css |
Fictioneer Child Theme
A blank WordPress child theme for Fictioneer.
Action & Filter Examples
Some common examples of customization that have come up in the past. If you want to know more, take a look at the action and filter references in the main repository. You are expected to know the basics of CSS, HTML, and coding (PHP) or consult one of the many free tutorials on the matter just a quick Internet search away.
Scope the Blog shortcode to specific roles
Put the following into your functions.php
.
function child_scope_blog_shortcode_to_roles( $query_args ) {
# Optional: Only apply the filter to a specific page, etc.
if ( ! is_page( 'your-page-slug' ) ) {
return $query_args;
}
# Step 1: Get users with the specified role(s)
$users = get_users( array( 'role__in' => ['author'] ) );
# Step 2: Extract the user IDs
$user_ids = wp_list_pluck( $users, 'ID' );
# Step 3: Modify query arguments
$query_args['author__in'] = $user_ids;
# Step 4: Return modified query arguments
return $query_args;
}
add_filter( 'fictioneer_filter_shortcode_blog_query_args', 'child_scope_blog_shortcode_to_roles', 10 );