<?php
get_header();
$bc = get_post(3392);
echo do_shortcode($bc->post_content);
if(is_archive()) {
$args = array(
'post_type' => 'template_archive',
'posts_per_page' => -1,
);
$tpls = get_posts($args);
function getActiveMeta($tpl) {
$archive = get_queried_object()->name;
$value = get_post_meta($tpl->ID, '_tpl_archive_meta_key', true);
if($value == $archive) {
return true;
}
}
$arrfiltered = array_filter($tpls, 'getActiveMeta');
$firstKey = array_keys($arrfiltered)[0];
$post = $arrfiltered[$firstKey];
echo do_shortcode($post->post_content);
}
get_footer();
?>
<?php
get_header();
$bc = get_post(3392);
echo do_shortcode($bc->post_content);
if(is_archive()) {
$args = array(
'post_type' => 'template_archive',
'posts_per_page' => -1,
);
$tpls = get_posts($args);
function getActiveMeta($tpl) {
$archive = get_queried_object()->name;
$value = get_post_meta($tpl->ID, '_tpl_archive_meta_key', true);
if($value == $archive) {
return true;
}
}
$arrfiltered = array_filter($tpls, 'getActiveMeta');
$firstKey = array_keys($arrfiltered)[0];
$post = $arrfiltered[$firstKey];
echo do_shortcode($post->post_content);
}
get_footer();
?>
*/
$template = apply_filters( 'template_include', $template );
$is_stringy = is_string( $template ) || ( is_object( $template ) && method_exists( $template, '__toString' ) );
$template = $is_stringy ? realpath( (string) $template ) : null;
if (
is_string( $template ) &&
( str_ends_with( $template, '.php' ) || str_ends_with( $template, '.html' ) ) &&
is_file( $template ) &&
is_readable( $template )
) {
/**
* Fires immediately before including the template.
*
* @since 6.9.0
*
* @param string $template The path of the template about to be included.
*/
do_action( 'wp_before_include_template', $template );
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';