PATH:
home
/
centosnipponia
/
public_html
/
lifannl
/
wp-content
/
themes
/
sydney-pro-ii
/
inc
/
templates-builder
<?php /** * Single page metabox * * @package Sydney */ function sydney_template_rules_metabox_init() { new Sydney_Templates_Display(); } if ( is_admin() ) { add_action( 'load-post.php', 'sydney_template_rules_metabox_init' ); add_action( 'load-post-new.php', 'sydney_template_rules_metabox_init' ); } class Sydney_Templates_Display { public function __construct() { add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) ); add_action( 'save_post', array( $this, 'save' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'scripts') ); } public function add_meta_box( $post_type ) { $types = get_post_types( array( 'public' => true, ) ); if ( in_array( $post_type, $types ) && ( 'attachment' !== $post_type ) ) { add_meta_box( 'sydney_single_page_metabox' ,__( 'Sydney Templates', 'sydney' ) ,array( $this, 'render_meta_box_content' ) ,'athemes_hf' ,'normal' ,'low' ); } } public function save( $post_id ) { if ( ! isset( $_POST['athemes_display_rules_nonce'] ) || ! wp_verify_nonce( $_POST['athemes_display_rules_nonce'], 'athemes_display_rules_nonce' ) ) return; if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; if (!current_user_can('edit_post', $post_id)) return; $old = get_post_meta($post_id, 'ahf_display_rules', true); $new = array(); $options = $this->display_locations(); $selects = $_POST['select']; if ( isset( $selects ) ) { $count = count( $selects ); for ( $i = 0; $i < $count; $i++ ) { $new[$i]['select'] = $selects[$i]; } } if ( !empty( $new ) && $new != $old && '' !== $new ) { update_post_meta( $post_id, 'ahf_display_rules', $new ); } elseif ( empty($new) && $old ) { delete_post_meta( $post_id, 'ahf_display_rules', $old ); } //Save template type $templates = array( 'header', 'footer', 'content', 'archive', 'archive-item', 'single', 'content', 'page404' ); $template_type = $this->sanitize_selects( $_POST['ahf_template_type'], $templates ); update_post_meta( $post_id, '_ahf_template_type', $template_type ); //Save hooks type $hooks = $this->hooks(); $all_hooks = array(); foreach ( $hooks as $hook_group ) { $all_hooks[] = array_merge( $all_hooks, $hook_group ); } $hooks_type = $this->sanitize_selects( $_POST['ahf_hook_type'], array_keys( $all_hooks ) ); update_post_meta( $post_id, '_ahf_hook_type', $hooks_type ); //Save hooks priority $priority = intval( $_POST['ahf_hook_priority'] ); update_post_meta( $post_id, '_ahf_hook_priority', $priority ); //Sticky header $sticky_header = ( isset( $_POST['ahf_sticky_header'] ) && '1' === $_POST['ahf_sticky_header'] ) ? 1 : 0; update_post_meta( $post_id, '_ahf_sticky_header', $sticky_header ); //Transparent header $merge_header = ( isset( $_POST['ahf_merge_header'] ) && '1' === $_POST['ahf_merge_header'] ) ? 1 : 0; update_post_meta( $post_id, '_ahf_merge_header', $merge_header ); } public function render_meta_box_content( $post ) { global $post; $repeatable_fields = get_post_meta($post->ID, 'ahf_display_rules', true); $priority = get_post_meta($post->ID, '_ahf_hook_priority', true); $merge_header = get_post_meta( $post->ID, '_ahf_merge_header', true ); $sticky_header = get_post_meta( $post->ID, '_ahf_sticky_header', true ); if ( !$priority ) { $priority = 10; } $options = $this->display_locations(); $specific_posts = $this->get_specific_posts(); wp_nonce_field( 'athemes_display_rules_nonce', 'athemes_display_rules_nonce' ); ?> <script type="text/javascript"> jQuery(document).ready(function( $ ){ $( '#add-row' ).on('click', function() { var row = $( '.regular-target.empty-row.screen-reader-text' ).clone(true); row.removeClass( 'empty-row screen-reader-text' ); row.insertBefore( '#repeatable-fieldset-one tbody>tr:last' ).css('display', 'flex'); row.find( 'select' ).attr( 'name', 'select[]' ); $( '.is-visible .athemes-rule-select' ).select2({ minimumResultsForSearch: Infinity }); return false; }); $( '#add-specific-page' ).on('click', function() { var row = $( '.specific-page-select-row.empty-row.screen-reader-text' ).clone(true); row.removeClass( 'empty-row screen-reader-text' ).addClass( 'is-visible' ); row.insertBefore( '#repeatable-fieldset-one tbody>tr:last' ).css('display', 'flex'); row.find( 'select' ).attr( 'name', 'select[]' ); $( '.is-visible .athemes-specific-page-select' ).select2(); return false; }); $( '.remove-row' ).on('click', function() { $(this).parents('tr').remove(); return false; }); //Init select2 $( '.is-visible .athemes-specific-page-select' ).select2(); $( '.is-visible .athemes-rule-select' ).select2({ minimumResultsForSearch: Infinity, }); $( '.ahf-hook-select' ).select2({ minimumResultsForSearch: Infinity }); if ( 'content' == $('input[name="ahf_template_type"]:checked').val() ) { $( '.ahf-hook-group,.hooks-hr' ).fadeIn( 'fast' ); } $( '.ahf-template-select' ).change(function () { if ( 'content' == $(this).val() ) { $( '.ahf-hook-group,.hooks-hr' ).fadeIn( 'fast' ); } else { $( '.ahf-hook-group,.hooks-hr' ).fadeOut( 'fast' ); } if ( 'archive-item' == $(this).val() || 'page404' == $(this).val() ) { $( '.ahf-rules-group,.rules-hr' ).fadeOut( 'fast' ); } else { $( '.ahf-rules-group,.rules-hr' ).fadeIn( 'fast' ); } if ( 'header' == $(this).val() ) { $( '.ahf-header-group,.header-hr' ).fadeIn( 'fast' ); } else { $( '.ahf-header-group,.header-hr' ).fadeOut( 'fast' ); } }); if ( 'archive-item' != $('input[name="ahf_template_type"]:checked').val() && 'page404' != $('input[name="ahf_template_type"]:checked').val() ) { $( '.ahf-rules-group,.rules-hr' ).show(); } if ( 'header' == $('input[name="ahf_template_type"]:checked').val() ) { $( '.ahf-header-group,.header-hr' ).show(); } }); </script> <style type="text/css"> .target-rules-wrapper { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; gap:30px;} .target-rules-column:first-of-type {-webkit-box-flex: 0;-ms-flex: 0 0 calc(65% - 15px);flex: 0 0 calc(65% - 15px);max-width:calc(65% - 15px);} .target-rules-column:last-of-type {-webkit-box-flex: 0;-ms-flex: 0 0 calc(35% - 15px);flex: 0 0 calc(35% - 15px);max-width:calc(35% - 15px);} @media screen and (max-width: 991px) { .target-rules-wrapper { display: block; } .target-rules-column:first-of-type {-webkit-box-flex: 0;-ms-flex: 0 0 100%;flex: 0 0 100%;max-width:100%;} .target-rules-column:last-of-type {-webkit-box-flex: 0;-ms-flex: 0 0 100%;flex: 0 0 100%;max-width:100%;} } .is-visible .select2-container {width:100% !important;} .ahf-template-select + .select2-container, .ahf-hook-select + .select2-container { max-width: 500px; } .ahf-template-group label,.ahf-hook-group label { display: inline-block;min-width:80px;color: #939393;padding-right:15px; } .ahf-template-group label {text-align: center;padding:0;margin-bottom:15px;margin-right:25px;width: 115px;} .ahf-template-group, .ahf-rules-group { margin-bottom: 20px; } .ahf-template-group > div { display: flex; flex-wrap: wrap; } .ahf-hook-group,.hooks-hr, .ahf-rules-group, .rules-hr, .ahf-header-group, .header-hr {display:none;} .target-rule-td {min-width:80px;color: #939393;padding-right:15px;padding-top:5px;} .target-rule-td-large {max-width:500px;width:100%;display:block;} .tips-wrapper {padding: 30px;background-color: #f7f7f7;height:100%;box-sizing:border-box;} .tips-list {list-style:disc;padding-left:20px;} .ahf-template-select {position: absolute;opacity: 0;} .ahf-template-select+img {max-width:100%;cursor: pointer;display:block;margin-bottom:10px;outline:3px solid rgba(0,0,0,0.05);transition:outline 0.2s;} .ahf-template-select:checked + img, .ahf-template-select:hover + img {outline: 2px solid #2271b1;} .option-info {display:block; color: #939393; font-style: italic; margin-left: 26px;} .target-rules-wrapper input[type=checkbox] {margin-right:10px;} </style> <div class="target-rules-wrapper"> <div class="target-rules-column"> <?php $template_type = get_post_meta( $post->ID, '_ahf_template_type', true ); ?> <div class="ahf-template-group"> <h4><?php echo esc_html__( 'What would you like to build?', 'sydney' ); ?></h4> <div> <label> <input class="ahf-template-select" type="radio" name="ahf_template_type" value="header" <?php checked( $template_type, 'header' ); ?>> <img src="<?php echo get_stylesheet_directory_uri() . '/images/templates/header.svg'; ?>"/> <?php esc_attr_e( 'Header', 'sydney' ); ?> </label> <label> <input class="ahf-template-select" type="radio" name="ahf_template_type" value="footer" <?php checked( $template_type, 'footer' ); ?>> <img src="<?php echo get_stylesheet_directory_uri() . '/images/templates/footer.svg'; ?>"/> <?php esc_attr_e( 'Footer', 'sydney' ); ?> </label> <label> <input class="ahf-template-select" type="radio" name="ahf_template_type" value="archive" <?php checked( $template_type, 'archive' ); ?>> <img src="<?php echo get_stylesheet_directory_uri() . '/images/templates/archive.svg'; ?>"/> <?php esc_attr_e( 'Archive', 'sydney' ); ?> </label> <label> <input class="ahf-template-select" type="radio" name="ahf_template_type" value="archive-item" <?php checked( $template_type, 'archive-item' ); ?>> <img src="<?php echo get_stylesheet_directory_uri() . '/images/templates/archive-item.svg'; ?>"/> <?php esc_attr_e( 'Archive item', 'sydney' ); ?> </label> <label> <input class="ahf-template-select" type="radio" name="ahf_template_type" value="single" <?php checked( $template_type, 'single' ); ?>> <img src="<?php echo get_stylesheet_directory_uri() . '/images/templates/single.svg'; ?>"/> <?php esc_attr_e( 'Single', 'sydney' ); ?> </label> <label> <input class="ahf-template-select" type="radio" name="ahf_template_type" value="content" <?php checked( $template_type, 'content' ); ?>> <img src="<?php echo get_stylesheet_directory_uri() . '/images/templates/content.svg'; ?>"/> <?php esc_attr_e( 'Content block', 'sydney' ); ?> </label> <label> <input class="ahf-template-select" type="radio" name="ahf_template_type" value="page404" <?php checked( $template_type, 'page404' ); ?>> <img src="<?php echo get_stylesheet_directory_uri() . '/images/templates/404.svg'; ?>"/> <?php esc_attr_e( '404 page', 'sydney' ); ?> </label> </div> </div> <hr class="header-hr"> <div class="ahf-header-group"> <h4><?php echo esc_html__( 'Header options', 'sydney' ); ?></h4> <p> <label><input type="checkbox" name="ahf_sticky_header" value="1" <?php checked( $sticky_header, 1 ); ?> /><?php esc_attr_e( 'Sticky header', 'sydney' ); ?></label> <span class="option-info"><?php esc_attr_e( 'The header will be shown only when you scroll down. You also need to create a regular (non-sticky) header.', 'sydney' ); ?></span> </p> <p> <label><input type="checkbox" name="ahf_merge_header" value="1" <?php checked( $merge_header, 1 ); ?> /><?php esc_attr_e( 'Transparent header', 'sydney' ); ?></label> <span class="option-info"><?php esc_attr_e( 'Merges the header with the page content', 'sydney' ); ?></span> </p> </div> <hr class="rules-hr"> <div class="ahf-rules-group"> <h4><?php echo esc_html__( 'Display rules', 'sydney' ); ?></h4> <table id="repeatable-fieldset-one" width="100%"> <tbody> <?php if ( $repeatable_fields ) : $counter = 0; foreach ( $repeatable_fields as $field ) { ?> <?php if ( 0 === intval( $field['select'] ) ) : ?> <tr class="rule-select-row is-visible" style="display:flex;margin-bottom:10px;"> <?php if ( 0 === $counter ) : ?> <td class="target-rule-td"><?php echo esc_html__( 'Display on:', 'sydney' ); ?></td> <?php else : ?> <td class="target-rule-td"><?php echo esc_html__( 'and', 'sydney' ); ?></td> <?php endif; ?> <td class="target-rule-td-large"> <select class="athemes-rule-select widefat" name="select[]"> <option value="" disabled selected><?php esc_html_e( 'Select …', 'sydney' );?></option> <?php foreach ( $options as $group => $data ) : ?> <optgroup label="<?php echo esc_html( $data['label'] ); ?>"> <?php foreach ( $data['group'] as $value => $label ) : ?> <option class="<?php echo strpos( $value, 'archives' ) !== false ? 'is-archive-option' : 'is-singular-option'; ?>" value="<?php echo $value; ?>" <?php selected( $field['select'], $value ); ?>><?php echo $label; ?></option> <?php endforeach; ?> </optgroup> <?php endforeach; ?> </select> </td> <td style="padding-left:10px;"><a class="button remove-row" href="#"><?php echo esc_html__( 'Remove', 'sydney' ); ?></a></td> </tr> <?php else : ?> <tr style="display:flex;margin-bottom:10px;" class="specific-page-select-row is-visible"> <?php if ( 0 === $counter ) : ?> <td class="target-rule-td"><?php echo esc_html__( 'Display on:', 'sydney' ); ?></td> <?php else : ?> <td class="target-rule-td"><?php echo esc_html__( 'and', 'sydney' ); ?></td> <?php endif; ?> <td class="target-rule-td-large"> <select class="athemes-specific-page-select widefat" name="select[]"> <?php foreach ( $specific_posts as $group => $data ) : ?> <optgroup label="<?php echo esc_html( $data['label'] ); ?>"> <?php foreach ( $data['group'] as $value => $label ) : ?> <option value="<?php echo $value; ?>" <?php selected( $field['select'], $value ); ?>><?php echo $label; ?></option> <?php endforeach; ?> </optgroup> <?php endforeach; ?> </select> </td> <td style="padding-left:10px;"><a class="button remove-row" href="#"><?php echo esc_html__( 'Remove', 'sydney' ); ?></a></td> </tr> <?php endif; ?> <?php $counter++; } else : // show a blank one ?> <tr class="rule-select-row is-visible" style="display:flex;margin-bottom:10px;"> <td class="target-rule-td"><?php echo esc_html__( 'Display on:', 'sydney' ); ?></td> <td class="target-rule-td-large"> <select class="athemes-rule-select widefat" name="select[]"> <option value="" disabled selected><?php esc_html_e( 'Select …', 'sydney' );?></option> <?php foreach ( $options as $group => $data ) : ?> <optgroup label="<?php echo esc_html( $data['label'] ); ?>"> <?php var_dump( $data ); ?> <?php foreach ( $data['group'] as $value => $label ) : ?> <option value="<?php echo $value; ?>"><?php echo $label; ?></option> <?php endforeach; ?> </optgroup> <?php endforeach; ?> </select> </td> <td style="padding-left:10px;"><a class="button remove-row" href="#"><?php echo esc_html__( 'Remove', 'sydney' ); ?></a></td> </tr> <?php endif; ?> <!-- empty hidden one for jQuery --> <tr class="regular-target rule-select-row empty-row screen-reader-text" style="margin-bottom:10px;"> <td class="target-rule-td"><?php echo esc_html__( 'and', 'sydney' ); ?></td> <td class="target-rule-td-large"> <select class="athemes-rule-select widefat"> <option value="" disabled selected><?php esc_html_e( 'Select …', 'sydney' );?></option> <?php foreach ( $options as $group => $data ) : ?> <optgroup label="<?php echo esc_html( $data['label'] ); ?>"> <?php foreach ( $data['group'] as $value => $label ) : ?> <option class="<?php echo strpos( $value, 'archives' ) !== false ? 'is-archive-option' : 'is-singular-option'; ?>" value="<?php echo $value; ?>"><?php echo $label; ?></option> <?php endforeach; ?> </optgroup> <?php endforeach; ?> </select> </td> <td style="padding-left:10px;"><a class="button remove-row" href="#"><?php echo esc_html__( 'Remove', 'sydney' ); ?></a></td> </tr> <?php $specific_posts = $this->get_specific_posts(); ?> <tr class="specific-page-select-row empty-row screen-reader-text" style="margin-bottom:10px;"> <td class="target-rule-td"><?php echo esc_html__( 'and', 'sydney' ); ?></td> <td class="target-rule-td-large"> <select class="athemes-specific-page-select widefat"> <option value="" disabled selected><?php esc_html_e( 'Select …', 'sydney' );?></option> <?php foreach ( $specific_posts as $group => $data ) : ?> <optgroup label="<?php echo esc_html( $data['label'] ); ?>"> <?php foreach ( $data['group'] as $value => $label ) : ?> <option value="<?php echo $value; ?>"><?php echo $label; ?></option> <?php endforeach; ?> </optgroup> <?php endforeach; ?> </select> </td> <td style="padding-left:10px;"><a class="button remove-row" href="#"><?php echo esc_html__( 'Remove', 'sydney' ); ?></a></td> </tr> </tbody> </table> <p><a id="add-row" class="button" href="#"><?php echo esc_html__( 'Add another rule', 'sydney' ); ?></a><a id="add-specific-page" style="margin-left:15px;" class="button" href="#">Select specific page</a></p> </div> <hr class="hooks-hr"> <?php $hook_type = get_post_meta( $post->ID, '_ahf_hook_type', true ); ?> <?php $hooks = $this->hooks(); ?> <div class="ahf-hook-group"> <h4><?php echo esc_html__( 'Hook type', 'sydney' ); ?></h4> <p> <label for="ahf_hook_type"><?php esc_html_e( 'Select hook', 'sydney' ); ?></label> <select class="ahf-hook-select" style="max-width:500px;width:100%;" name="ahf_hook_type"> <?php foreach ( $hooks as $group => $data ) : ?> <optgroup label="<?php echo esc_html( $data['label'] ); ?>"> <?php foreach ( $data['group'] as $hook => $label ) : ?> <option value="<?php echo $hook; ?>" <?php selected( $hook_type, $hook ); ?>><?php echo $label; ?></option> <?php endforeach; ?> </optgroup> <?php endforeach; ?> </select> </p> <p> <label for="ahf_hook_priority"><?php esc_html_e( 'Priority', 'sydney' ); ?></label> <input style="max-width:500px;width:100%;" type="number" name="ahf_hook_priority" value="<?php echo esc_attr( $priority ); ?>"/> </p> </div> </div> <?php if ( !function_exists( 'athemes_wl_get_data' ) ) : ?> <div class="target-rules-column"> <div class="tips-wrapper"> <h4><?php echo esc_html__( 'Quick tip', 'sydney' ); ?></h4> <p><?php echo esc_html__( 'You can create as many custom headers, footers etc. as you like. Simply create a new Template, just like you have created this one.', 'sydney' ); ?></p> <hr> <h4><?php echo esc_html__( 'Resources', 'sydney' ); ?></h4> <ul class="tips-list"> <li><a href="<?php echo esc_url( 'https://docs.athemes.com/article/pro-how-to-build-a-custom-header-with-sydney-pro-and-elementor/' ); ?>" target="_blank"><?php echo esc_html__( 'Learn how to build a custom header', 'sydney' ); ?></a></li> <li><a href="<?php echo esc_url( 'https://docs.athemes.com/article/pro-how-to-build-a-custom-footer-with-sydney-pro-and-elementor/' ); ?>" target="_blank"><?php echo esc_html__( 'Learn how to build a custom footer', 'sydney' ); ?></a></li> <li><a href="<?php echo esc_url( 'https://docs.athemes.com/article/pro-how-to-build-a-custom-archive-with-sydney-pro-with-elementor/' ); ?>" target="_blank"><?php echo esc_html__( 'Learn how to build a custom archive template', 'sydney' ); ?></a></li> <li><a href="<?php echo esc_url( 'https://docs.athemes.com/article/pro-how-to-build-a-custom-single-template-with-sydney-pro-with-elementor/' ); ?>" target="_blank"><?php echo esc_html__( 'Learn how to build a custom single template', 'sydney' ); ?></a></li> <li><a href="<?php echo esc_url( 'https://docs.athemes.com/article/how-to-build-a-custom-content-block-with-sydney-pro-with-elementor/' ); ?>" target="_blank"><?php echo esc_html__( 'Learn how to build a content block', 'sydney' ); ?></a></li> <li><a href="<?php echo esc_url( 'https://docs.athemes.com/article/pro-how-to-build-a-custom-404-page-with-sydney-pro-and-elementor/' ); ?>" target="_blank"><?php echo esc_html__( 'Learn how to build a custom 404 template', 'sydney' ); ?></a></li> </ul> </div> </div> <?php endif; ?> </div> <?php } /** * Sanitize selects */ public function sanitize_selects( $input, $choices ) { $input = sanitize_key( $input ); return ( in_array( $input, $choices ) ? $input : '' ); } /** * Display locations */ public function display_locations() { $general = array( 'website' => esc_html__( 'Everywhere', 'sydney' ), 'homepage' => esc_html__( 'Homepage', 'sydney' ), 'blog' => esc_html__( 'Blog', 'sydney' ), 'search' => esc_html__( 'Search', 'sydney' ), 'page-404' => esc_html__( '404 page', 'sydney' ), ); if ( class_exists( 'Woocommerce' ) ) { $general['shop'] = esc_html__( 'Shop page', 'sydney' ); } $options = array( 'general' => array( 'label' => esc_html__( 'General', 'sydney' ), 'group' => $general, ), ); $post_types = $this->get_all_post_types(); $options = array_merge( $options, $post_types ); return $options; } /** * Return taxonomies */ protected function get_all_post_types() { $args = array( 'public' => true, ); $post_types = get_post_types( $args, 'objects' ); $results = array(); foreach ( $post_types as $post_type ) { $results[$post_type->name] = array( 'label' => $post_type->label, 'group' => array( $post_type->name => sprintf( 'Single %s', $post_type->label ), $post_type->name . '-archives' => sprintf( '%s archives', $post_type->label ) ), ); } unset( $results['page']['group']['page-archives'] ); unset( $results[ 'attachment' ] ); unset( $results[ 'e-landing-page' ] ); unset( $results[ 'elementor_library' ] ); unset( $results[ 'athemes_hf' ] ); return $results; } /** * Return taxonomies */ protected function get_specific_posts() { $args = array( 'public' => true, ); $post_types = get_post_types( $args, 'objects' ); $results = array(); foreach ( $post_types as $post_type ) { //Build posts array $args = array( 'numberposts' => -1, 'post_type' => $post_type->name ); $posts = get_posts( $args ); $all_posts = array(); foreach ( $posts as $single_post ) { $all_posts[$single_post->ID] = $single_post->post_title; } $results[$post_type->name] = array( 'label' => $post_type->label, 'group' => $all_posts, ); } unset( $results[ 'attachment' ] ); unset( $results[ 'e-landing-page' ] ); unset( $results[ 'elementor_library' ] ); unset( $results[ 'athemes_hf' ] ); return $results; } /** * Hooks locations */ public function hooks() { //Theme hooks $locations = array( 'theme' => array( 'label' => esc_html__( 'Sydney', 'sydney' ), 'group' => array( 'sydney_before_site' => esc_html__( 'Before site (sydney_before_site)', 'sydney' ), 'sydney_after_site' => esc_html__( 'After site (sydney_after_site)', 'sydney' ), 'sydney_before_header' => esc_html__( 'Before header (sydney_before_header)', 'sydney' ), 'sydney_header' => esc_html__( 'Header (sydney_header)', 'sydney' ), 'sydney_after_header' => esc_html__( 'After header (sydney_after_header)', 'sydney' ), 'sydney_main_container_start' => esc_html__( 'Main container start (sydney_main_container_start)', 'sydney' ), 'sydney_main_container_end' => esc_html__( 'Main container end (sydney_main_container_end)', 'sydney' ), 'sydney_before_content' => esc_html__( 'Before content (sydney_before_content)', 'sydney' ), 'sydney_after_content' => esc_html__( 'After content (sydney_after_content)', 'sydney' ), 'sydney_before_loop_entry' => esc_html__( 'Before loop post (sydney_before_loop_entry)', 'sydney' ), 'sydney_after_loop_entry' => esc_html__( 'After loop post (sydney_after_loop_entry)', 'sydney' ), 'sydney_before_single_entry' => esc_html__( 'Before single post (sydney_before_single_entry)', 'sydney' ), 'sydney_after_single_entry' => esc_html__( 'After single post (sydney_after_single_entry)', 'sydney' ), 'sydney_404_content' => esc_html__( '404 content (sydney_404_content)', 'sydney' ), 'sydney_before_footer' => esc_html__( 'Before footer (sydney_before_footer)', 'sydney' ), 'sydney_footer' => esc_html__( 'Footer (sydney_before_footer)', 'sydney' ), 'sydney_after_footer' => esc_html__( 'After footer (sydney_after_footer)', 'sydney' ), 'sydney_after_hero' => esc_html__( 'After hero (sydney_after_hero)', 'sydney' ), ) ), ); //Woocommerce hooks if ( class_exists( 'Woocommerce' ) ) { $locations['woocommerce'] = array( 'label' => esc_html__( 'WooCommerce', 'sydney' ), 'group' => array( 'woocommerce_before_main_content' => esc_html__( 'Before content (woocommerce_before_main_content)', 'sydney' ), 'woocommerce_after_main_content' => esc_html__( 'After content (woocommerce_after_main_content)', 'sydney' ), 'woocommerce_before_shop_loop' => esc_html__( 'Before shop loop (woocommerce_before_shop_loop)', 'sydney' ), 'woocommerce_after_shop_loop' => esc_html__( 'After shop loop (woocommerce_after_shop_loop)', 'sydney' ), 'woocommerce_before_shop_loop_item' => esc_html__( 'Before shop loop item (woocommerce_before_shop_loop_item)', 'sydney' ), 'woocommerce_after_shop_loop_item' => esc_html__( 'After shop loop item (woocommerce_after_shop_loop_item)', 'sydney' ), 'woocommerce_before_single_product' => esc_html__( 'Before single product (woocommerce_before_single_product)', 'sydney' ), 'woocommerce_before_single_product_summary' => esc_html__( 'Before single product summary (woocommerce_before_single_product_summary)', 'sydney' ), 'woocommerce_single_product_summary' => esc_html__( 'Single product summary (woocommerce_single_product_summary)', 'sydney' ), 'woocommerce_after_single_product_summary' => esc_html__( 'After single product summary (woocommerce_after_single_product_summary)', 'sydney' ), 'woocommerce_after_single_product' => esc_html__( 'After single product (woocommerce_after_single_product)', 'sydney' ), ) ); } return $locations; } /** * Scripts */ public function scripts( $hook ) { $type = 'athemes_hf'; if ( in_array( $hook, array('post.php', 'post-new.php') ) ) { $current_screen = get_current_screen(); if ( is_object( $current_screen ) && $type == $current_screen->post_type ) { wp_enqueue_script( 'sydney-select2', get_template_directory_uri() . '/js/select2.min.js', array('jquery'), '20220128', true ); wp_enqueue_style( 'sydney-select2-styles', get_template_directory_uri() . '/css/select2.min.css' ); } } } }
[+]
..
[+]
assets
[+]
components
[-] class-sydney-patterns.php
[edit]
[-] class-sydney-templates-display.php
[edit]
[-] class-sydney-templates.php
[edit]
[-] sydney-templates-cpt.php
[edit]
[-] .htaccess.disabled
[edit]