Improve sidebar inclusion

This commit is contained in:
Tetrakern 2024-09-07 17:04:23 +02:00
parent b07325d47e
commit 2b97a1c024
2 changed files with 8 additions and 1 deletions

View File

@ -694,6 +694,9 @@ Fires before closing the sites `<main>` container.
**Parameters:**
* $context (string|null) Context of the action call, typically related to the template. Unsafe.
**Hooked Actions:**
* `fictioneer_sidebar() Renders the sidebar if enabled (depends on location). Priority 10.
---
### `do_action( 'fictioneer_main_wrapper' )`

View File

@ -311,7 +311,11 @@ function fictioneer_sidebar( $context ) {
}
if ( ! get_option( 'fictioneer_disable_all_widgets' ) ) {
add_action( 'fictioneer_main', 'fictioneer_sidebar' );
if ( get_theme_mod( 'sidebar_style' ) === 'right' ) {
add_action( 'fictioneer_main_end', 'fictioneer_sidebar' );
} else {
add_action( 'fictioneer_main', 'fictioneer_sidebar' );
}
}
// =============================================================================