-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
54 lines (43 loc) · 2.2 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
48
49
50
51
52
53
54
<?php
function add_theme_scripts()
{
wp_enqueue_style('custom.css', get_template_directory_uri() . './assets/css/custom.css', array(), false, 'all');
wp_enqueue_style('main-rtl', get_template_directory_uri() . './assets/css/main-rtl.min.css', array(), false, 'all');
// wp_enqueue_style('main' , get_template_directory_uri() . './assets/css/main.min.css' , array() , false , 'all');
// wp_enqueue_style('style' , get_stylesheet_uri() , array() , false , 'all');
// javascript source
wp_enqueue_script('jq', get_template_directory_uri() . './assets/js/vendors/jquery-3.6.0.min.js', array(), false, true);
wp_enqueue_script('bootstrap.bundle.min', get_template_directory_uri() . './assets/js/vendors/bootstrap.bundle.min.js', array(), false, true);
wp_enqueue_script('swiper', get_template_directory_uri() . './assets/js/vendors/swiper-bundle.min.js', array(), false, true);
wp_enqueue_script('jquery.magnific-popup.min', get_template_directory_uri() . './assets/js/vendors/jquery.magnific-popup.min.js', array('jquery'), false, true);
wp_enqueue_script('parallax.min', get_template_directory_uri() . './assets/js/vendors/parallax.min.js', array(), false, true);
wp_enqueue_script('aos', get_template_directory_uri() . './assets/js/vendors/aos.js', array(), false, true);
wp_enqueue_script('app', get_template_directory_uri() . './assets/js/app.js', array(), false, true);
}
add_action('wp_enqueue_scripts', 'add_theme_scripts');
function title_setup()
{
add_theme_support('title-tag');
add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');
}
add_action('after_setup_theme', 'title_setup');
function custom_excerpt_length($length)
{
return 20; // تعداد کلمات مورد نظر برای نمایش خلاصه
}
add_filter('excerpt_length', 'custom_excerpt_length');
function custom_excerpt_more($more)
{
return ' ...'; // متن بعد از خلاصه نوشته (میتوانید تغییر دهید)
}
add_filter('excerpt_more', 'custom_excerpt_more');
// show category name
function get_category_name()
{
$categories = get_the_category();
if (!empty($categories)) {
return $categories[0]->name;
}
return false;
}