-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
47 lines (42 loc) · 1.18 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Construye Mundo Theme
*
* @author Ilán Vivanco <ilanvivanco@gmail.com>
* @package Construye Mundo
* @since 1.0.0
*/
/**
* Define Constants
*/
define( 'CM_THEME_VERSION', '1.0.0' );
/**
* Enqueue styles
*/
function iv_enqueue_styles() {
wp_enqueue_style( 'construye-mundo-theme-css', get_stylesheet_directory_uri() . '/style.css', array( 'astra-theme-css' ), rand() . CM_THEME_VERSION, 'all' );
}
add_action( 'wp_enqueue_scripts', 'iv_enqueue_styles', 15 );
/**
* Filter blog page to show only 'noticias'
*
* @param WP_Query $query Current $query.
*/
function iv_filter_blog_posts_on_blog_page( $query ) {
if ( ! is_admin() && $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', 3 );
}
}
add_action( 'pre_get_posts', 'iv_filter_blog_posts_on_blog_page' );
/**
* Disables AddToAny's core script on non-posts
*
* @param Boolean $script_disabled Current status.
*/
function addtoany_disable_script_except_for_posts( $script_disabled ) {
if ( ! is_single() && ! is_archive() ) {
return true;
}
return $script_disabled;
}
add_filter( 'addtoany_script_disabled', 'addtoany_disable_script_except_for_posts' );