This repository was archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.php
More file actions
46 lines (34 loc) · 1.3 KB
/
functions.php
File metadata and controls
46 lines (34 loc) · 1.3 KB
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
<?php
/**
* Functions and definitions
*
* @package WordPress
* @subpackage ETHDB
* @since EdTech Hub Database 0.1
*/
add_action( 'init', 'ethdb_register_menus' );
add_action( 'wp_enqueue_scripts', 'ethdb_register_styles' );
add_action( 'wp_enqueue_scripts', 'ethdb_register_scripts' );
add_action( 'pre_get_posts', 'ethdb_change_post_order' );
add_theme_support( 'title-tag' );
function ethdb_register_styles() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_style( 'ethdb-font', 'https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap', array(), null);
wp_enqueue_style( 'ethdb-bootstrap', get_template_directory_uri().'/bootstrap.min.css', array(), null );
wp_enqueue_style( 'ethdb-style', get_stylesheet_uri(), array(), $theme_version );
}
function ethdb_register_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_script( 'ethdb-bootstrap-js', get_template_directory_uri().'/bootstrap.min.js', array(), null);
}
function ethdb_register_menus() {
register_nav_menu('ethdb-header-menu',__( 'Header Menu' ));
}
function ethdb_change_post_order($query)
{
if ( ($query->is_tax() || $query->is_post_type_archive('tools')) && $query->is_main_query())
{
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC');
}
}