Untitled

 avatar
unknown
plain_text
2 years ago
2.1 kB
7
Indexable
<?php

add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );

function enqueue_parent_styles() {

wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );

}

/**
 * Function to automatically update the focus keyword with the post title, if no focus keyword is set
 */
function update_focus_keywords() {
    $posts = get_posts(array(
    'posts_per_page'    => -1,
    'post_type' => array('zlobek', 'przedszkole') // Replace post with the name of your post type
    ));
    foreach($posts as $p){
        // Checks if Rank Math keyword already exists and only updates if it doesn't have it
        $rank_math_keyword = get_post_meta( $p->ID, 'rank_math_focus_keyword', true );
    if ( ! $rank_math_keyword ){ 
            update_post_meta($p->ID,'rank_math_focus_keyword',strtolower(get_the_title($p->ID)));
        }
    }

}
add_action( 'init', 'update_focus_keywords' );

function hints() {  
  header("link: <https://placowkowo.pl/wp-content/themes/voxel/assets/dist/commons.js?ver=0.9.9.4-beta.2>; rel=preload, </wp-includes/css/dist/block-library/style.min.css?ver=6.1.1>; rel=preload");
}
add_action('send_headers', 'hints');

/*--- Remove Google Fonts 
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );  ---*/

/*--- Remove Font Awesome 
add_action( 'elementor/frontend/after_register_styles',function() {
	foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
		wp_deregister_style( 'elementor-icons-fa-' . $style );
	}
}, 20 );  ---*/

/*---  Remove Eicons:
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 ); 
function remove_default_stylesheet() { 
	wp_deregister_style( 'elementor-icons' );
}  ---*/

/* Disable lazy loading for single image* */
function wphelp_no_lazy_load_id( $value, $image, $context ) {
if ( 'the_content' === $context ) {
$image_url = wp_get_attachment_image_url( 906, 'large' ); 
if ( false !== strpos( $image, ' src="' . $image_url . '"' )) {
return false;
}
}
return $value;
}
add_filter( 'wp_img_tag_add_loading_attr', 'wphelp_no_lazy_load_id', 906, 906 );

?>
Editor is loading...