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_custom_post_type_args( $args, $post_type ) { | |
if ( $post_type === "dt_team" ) { | |
$args['has_archive'] = false; | |
$args['rewrite'] = true; | |
} | |
return $args; | |
} | |
add_filter( 'register_post_type_args', 'my_custom_post_type_args', PHP_INT_MAX, 2 ); |
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
Starting from 5.4.x The7 theme update, there was changed icon format from SVG to font. If you want to add custom social icons to the theme, you should prepare font and paste this font to child theme, then add PHP and CSS code with required modificaton to function.php and style.css child theme files. | |
To prepare font, you can use fontello.com online service, just import https://www.screencast.com/t/Hgna4hqD predefined configuration file https://www.dropbox.com/s/lbtgzmaqqxis78r/config.json?dl=0 | |
Upload own SVG file or choose icon from fontello library, then edit glyph, configure glyph name to the name that you use into PHP array https://www.screencast.com/t/GP8fSVtDZ | |
After you finish, download webfont and unpack it. | |
Copy font folder that persist into archive to the root dir of your child theme. | |
Open css/my-social-icon-codes.css and create css rules witn icon codes like this ".icon_name .soc-font-icon: { content: '\eXXX'; }" where XXX icon code. | |
How to prepare SVG | |
You can prepare SVG by using online SVG editor |
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 ); | |
} | |
} |
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
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 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 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
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
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 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>'; | |
} |