@font-face {
font-family: 'Proxima Nova Regular';
font-weight: 400;
font-style: normal;
src: url('./assets/fonts/proxima-nova/proxima-nova-regular.eot');
src: url('./assets/fonts/proxima-nova/proxima-nova-regular.eot?#iefix') format('embedded-opentype'),
url('./assets/fonts/proxima-nova/proxima-nova-regular.woff') format('woff'),
url('./assets/fonts/proxima-nova/proxima-nova-regular.ttf') format('truetype'),
url('./assets/fonts/proxima-nova/proxima-nova-regular.otf') format('opentype');
}
add_filter( 'tiny_mce_before_init', 'mce_custom_fonts' );
function mce_custom_fonts( $init ) {
$theme_advanced_fonts = "Andale Mono=andale mono,times;" .
"Arial=arial,helvetica,sans-serif;" .
"Arial Black=arial black,avant garde;" .
"Book Antiqua=book antiqua,palatino;" .
"Comic Sans MS=comic sans ms,sans-serif;" .
"Courier New=courier new,courier;" .
"Georgia=georgia,palatino;" .
"Helvetica=helvetica;" .
"Impact=impact,chicago;" .
"Proxima Nova Regular=Proxima Nova Regular;" . /* <---------- This is my custom font */
"Symbol=symbol;" .
"Tahoma=tahoma,arial,helvetica,sans-serif;" .
"Terminal=terminal,monaco;" .
"Times New Roman=times new roman,times;" .
"Trebuchet MS=trebuchet ms,geneva;" .
"Verdana=verdana,geneva;" .
"Webdings=webdings;" .
"Wingdings=wingdings,zapf dingbats";
$init['font_formats'] = $theme_advanced_fonts;
return $init;
}
add_action('wp_insert_post', function ($post_id) {
if ( get_post_type($post_id) == 'my-post-type' ) {
add_post_meta($post_id, 'meta-description', '', true);
}
return true;
});
esc_html
esc_attr
esc_js
esc_textarea
do_action( 'get_header');
locate_template(['custom_header/header-statistics.php'], true );
if (is_page()) {
do_action( 'get_header');
locate_template(['custom_header/header-statistics.php'], true );
} else {
get_header();
}
$related = new WP_Query( ( array( 'category__in' => wp_get_post_categories($post->ID), 'posts_per_page' => 5, 'post__not_in' => array($post->ID) ) );
if( $related->have_posts() ) {
while( $related->have_posts() ) { $related->the_post();
the_title();
}
}
wp_reset_postdata();
public function register_scripts() {
$script_path = WP_TILES_ASSETS_URL . 'js/';
$in_footer = apply_filters( 'wp_tiles_js_in_footer', true );
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
wp_register_script( 'tilesjs', $script_path . 'tiles.js', array( "jquery" ), "2013-05-18", $in_footer );
wp_register_script( 'jquery-dotdotdot', $script_path . 'jquery.dotdotdot.js', array( "jquery" ), "1.6.14", $in_footer );
wp_register_script( 'wp-tiles', $script_path . 'wp-tiles.js', array( "jquery", "tilesjs", "jquery-dotdotdot" ), WP_TILES_VERSION, $in_footer );
} else {
wp_register_script( 'wp-tiles', $script_path . 'wp-tiles.min.js', array( "jquery" ), WP_TILES_VERSION, $in_footer );
}
}
public function register_styles() {
$stylesheet = WP_TILES_ASSETS_URL . 'css/wp-tiles.css';
// In admin we want vanilla WP Tiles styles
if ( !is_admin() ) {
/**
* Get the WP Tiles stylesheet
*
* @since 1.0
* @param string Stylesheet location or false to disable separate css
*/
$stylesheet = apply_filters( 'wp_tiles_stylesheet', $stylesheet );
if ( false === $stylesheet )
return;
}
wp_register_style( 'wp-tiles', $stylesheet, false, WP_TILES_VERSION );
/**
* Always enqueue stylesheet or defer loading until an instance of
* WP Tiles has been detected
*
* @since 1.0
* @param bool Always enqueue
*/
if ( !is_admin() && apply_filters( 'wp_tiles_always_enqueue_stylesheet', false ) ) {
$this->enqueue_styles();
}
}
public function enqueue_scripts() {
wp_enqueue_script( 'wp-tiles' );
$this->add_action( 'wp_footer', 'add_data', 1 );
}
public function enqueue_styles() {
wp_enqueue_style( 'wp-tiles' );
do_action( 'wp_tiles_enqueue_styles' );
}
$wpTiles = new WPTiles/WPTiles;
$wpTiles->register_scripts();
$wpTiles->register_styles();
$wpTiles->enqueue_scripts);
$wpTiles->enqueue_styles();
$script_path = путь-к-папке-с-скриптом
...
wp_register_script( 'tilesjs', $script_path . 'tiles.js', array( "jquery" ), "2013-05-18", $in_footer );
...