-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
55 lines (46 loc) · 1.42 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
55
<?php
/** GeneratePress:
* Alternative version of the function to load templates.
*/
function gdrts__generate_do_template_part( $template, $post_type ) {
do_action( 'generate_before_do_template_part', $template, $post_type );
if ( apply_filters( 'generate_do_template_part', true, $template ) ) {
if ( 'archive' === $template ) {
get_template_part( 'content-archive', $post_type );
}
if ( 'single' === $template ) {
get_template_part( 'content-single', $post_type );
}
}
do_action( 'generate_after_do_template_part', $template, $post_type );
}
/** GD Rating System Pro:
* Display the thumbs rating block with few customizations
*/
function gdrts__display_thumbs_rating_block() {
echo '<div class="trend-rating">';
gdrts_posts_render_rating(
array(
'echo' => true,
'method' => 'thumbs-rating'
),
array(
'style_size' => 40,
'style_theme' => 'trend',
'template' => 'trend',
'style_class' => '',
'style_type' => 'gdrts-trend',
'style_name' => 'arrows'
)
);
echo '</div>';
}
/** GeneratePress:
* Enable entry meta block for 'product' post type.
*/
add_filter( 'generate_entry_meta_post_types', 'gdrts__generate_entry_meta_post_types' );
add_filter( 'generate_footer_meta_post_types', 'gdrts__generate_entry_meta_post_types' );
function gdrts__generate_entry_meta_post_types( $types ) {
$types[] = 'product';
return $types;
}