This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'dt_register_taxonomy_for_object_type' ); | |
function dt_register_taxonomy_for_object_type() { | |
register_taxonomy_for_object_type( 'post_tag', 'dt_portfolio' ); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('vc_before_init_base', 'lid_force_fron_css'); | |
function lid_force_fron_css() { | |
if ( !is_admin() ) { | |
visual_composer()->initPage(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add following code to the function.php of your child theme | |
add_action( 'get_header', 'dt_archive_layout', 10 ); | |
function dt_archive_layout() { | |
$config = Presscore_Config::get_instance(); | |
echo '<pre>'; | |
print_r( $config ); | |
echo '</pre>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'dt_core_send_mail-headers', 'my_dt_core_send_mail', 10); | |
function my_dt_core_send_mail($headers) { | |
$em = apply_filters( 'dt_core_send_mail-to', get_option( 'admin_email' ) ); | |
if ( !empty( $fields['name'] ) ) { | |
$name = $fields['name']; | |
} | |
$headers[0] = 'From: ' . esc_attr( strip_tags( $name ) ) . ' <' . $em . '>'; | |
return $headers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'get_header', 'dt_404_widget', 10 ); | |
function dt_404_widget() { | |
$config = Presscore_Config::get_instance(); | |
if( is_404() ) { | |
$config->set( 'sidebar_position', 'right' ); | |
$config->set( 'sidebar_widgetarea_id', 'sidebar_1' ); | |
$config->set( 'footer_show', '1' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_dt_portfolio_thumbnail_args($thumb_args){ | |
$thumb_args['wrap'] = '<div %CLASS% %TITLE% %CUSTOM%><img %IMG_CLASS% %SRC% %ALT% %SIZE% /></div>'; | |
return $thumb_args; | |
} | |
add_filter( 'dt_portfolio_thumbnail_args', 'my_dt_portfolio_thumbnail_args', 30 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_presscore_credits(){ | |
?> | |
<div class="wf-td"> | |
<div class="wf-float-left"> | |
<?php | |
echo '©' . date("Y") . ' Dream-Theme' ; | |
?> | |
</div> | |
</div> | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_vc_from_excerpt( $excerpt ) { | |
$patterns = "/\[[\/]?vc_[^\]]*\]/"; | |
$replacements = ""; | |
return preg_replace($patterns, $replacements, $excerpt); | |
} | |
function custom_content($content) { | |
$content = get_the_content( '' ); | |
$content = remove_vc_from_excerpt( $content ); | |
$content = strip_shortcodes( $content ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function template_change_title($title) { | |
if ( is_post_type_archive('dt_portfolio' )) { | |
return 'Custom name Archive'; | |
} | |
return $title; | |
} | |
add_filter( 'presscore_get_page_title', 'template_change_title', 30); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'get_header', 'dt_archive_layout', 10 ); | |
function dt_archive_layout() { | |
if (is_archive() && get_post_type() == 'dt_portfolio') { | |
$config = Presscore_Config::get_instance(); | |
$config->set( 'show_excerpts', false ); | |
} | |
} |