Turn page background into hooked action
This commit is contained in:
parent
60d8bdd97e
commit
406d33a629
2
404.php
2
404.php
@ -22,8 +22,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -676,6 +676,9 @@ Fires before the content of the card grid is rendered in the `partials/_card-sto
|
||||
### `do_action( 'fictioneer_main' )`
|
||||
Fires after opening the site’s `<main>` container, right after the `.main-observer` element.
|
||||
|
||||
**Hooked Actions:**
|
||||
* `fictioneer_page_background()` – Renders the page background. Priority 10.
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_main_wrapper' )`
|
||||
|
@ -726,6 +726,14 @@ Filters the obfuscation string generated for chapter spoilers and protected post
|
||||
|
||||
---
|
||||
|
||||
### `apply_filters( 'fictioneer_filter_page_background', $html )`
|
||||
Filters the HTML of the page background element, which is absolute positioned under the actual content.
|
||||
|
||||
**Parameters:**
|
||||
* $html (string) – The HTML element of the page background.
|
||||
|
||||
---
|
||||
|
||||
### `apply_filters( 'fictioneer_filter_page_card_footer', $footer_items, $post, $args )`
|
||||
Filters the intermediate output array in the `_card-page.php` partial before it is imploded and rendered. Contains statistics with icons such as the author, publishing date, and comments.
|
||||
|
||||
|
@ -97,8 +97,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -20,8 +20,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -97,8 +97,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -57,8 +57,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -2043,3 +2043,24 @@ function fictioneer_get_story_changelog( $story_id ) {
|
||||
// Return
|
||||
return $changelog;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// PAGE BACKGROUND
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* Render the page background element
|
||||
*
|
||||
* Note: The page background is a separate element, absolute positioned under the
|
||||
* actual content. This allows for quite some CSS shenanigans and can improve the
|
||||
* render performance in certain scenarios. Hooked to 'fictioneer_main' action.
|
||||
*
|
||||
* @since 5.20.0
|
||||
*/
|
||||
|
||||
function fictioneer_page_background() {
|
||||
$background = '<div class="main__background polygon polygon--main background-texture"></div>';
|
||||
|
||||
echo apply_filters( 'fictioneer_filter_page_background', $background );
|
||||
}
|
||||
add_action( 'fictioneer_main', 'fictioneer_page_background' );
|
||||
|
@ -23,8 +23,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper"><?php
|
||||
do_action( 'fictioneer_main_wrapper' );
|
||||
get_template_part( 'partials/_loop' );
|
||||
|
@ -57,8 +57,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -68,10 +68,13 @@ get_header();
|
||||
?>
|
||||
|
||||
<main id="main" class="main search-results">
|
||||
|
||||
<div class="observer main-observer"></div>
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
||||
<article id="search-results" class="search-results__article padding-left padding-right padding-top padding-bottom">
|
||||
|
@ -26,8 +26,6 @@ get_header( null, array( 'type' => 'fcn_collection' ) );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -25,8 +25,6 @@ get_header( null, array( 'type' => 'fcn_recommendation' ) );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -33,8 +33,6 @@ get_header(
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper _no-padding-top">
|
||||
|
||||
<?php
|
||||
|
@ -22,8 +22,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -30,8 +30,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -74,8 +74,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -90,8 +90,6 @@ get_header( null, array( 'no_index' => 1 ) );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -22,8 +22,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -82,8 +82,6 @@ reset( $sorted_stories );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -78,8 +78,6 @@ reset( $sorted_stories );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -30,8 +30,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper <?php echo $render_story_header ? '_no-padding-top' : ''; ?>">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -63,8 +63,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -23,8 +23,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -23,8 +23,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -104,8 +104,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
2
tag.php
2
tag.php
@ -21,8 +21,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -20,8 +20,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -20,8 +20,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -20,8 +20,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -20,8 +20,6 @@ get_header();
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
@ -66,8 +66,6 @@ get_header( null, array( 'type' => 'user-profile', 'no_index' => 1 ) );
|
||||
|
||||
<?php do_action( 'fictioneer_main' ); ?>
|
||||
|
||||
<div class="main__background polygon polygon--main background-texture"></div>
|
||||
|
||||
<div class="main__wrapper">
|
||||
|
||||
<?php do_action( 'fictioneer_main_wrapper' ); ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user