Base child theme of Fictioneer for WordPress
Find a file
2023-11-25 02:42:02 +01:00
.github Create FUNDING.yml 2023-01-20 01:33:53 +01:00
css Initial commit 2023-01-20 01:32:29 +01:00
js Initial commit 2023-01-20 01:32:29 +01:00
.gitignore Initial commit 2023-01-20 01:32:29 +01:00
functions.php Add some more examples 2023-07-25 18:42:51 +02:00
LICENSE Initial commit 2023-01-20 01:32:29 +01:00
README.md Update README.md 2023-11-25 02:42:02 +01:00
style.css Tested up to 6.3.0 2023-08-28 00:47:26 +02:00

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 );