Skip to content

Instantly share code, notes, and snippets.

@bigdigital
bigdigital / functions.php
Created May 22, 2017 06:28
Add multiple emails to The7 contact form
function my_dt_core_send_mailo($mail){
$mail = '[email protected],[email protected]';
return $mail;
}
add_filter( 'dt_core_send_mail-to', 'my_dt_core_send_mailo',$mail );
@bigdigital
bigdigital / gist:64a97eb1dfedf0a3b66fc7774154c81b
Created May 31, 2017 10:31
The Events Calendar add The7 page options
add_action( 'get_header', 'tribe_event_fix', 10 );
function tribe_event_fix() {
if ( is_post_type_archive('tribe_events') ) {
$post_id =704; //sidebar, footer settings of the page id given will be applied to event page
presscore_get_config()->set( 'post_id', $post_id ); presscore_config_populate_header_options();
@bigdigital
bigdigital / functions.php
Created June 2, 2017 06:14
Woocommerce, remove Product Sales Icon
add_filter('woocommerce_sale_flash', 'woo_custom_hide_sales_flash');
function woo_custom_hide_sales_flash()
{
return false;
}
@bigdigital
bigdigital / gist:8b443fb78d1487812b7b616fcfc4a52c
Created June 14, 2017 11:21
The7 add JS/ HTML to footer
// Add scripts to wp_footer()
function child_theme_footer_script() { ?>
<!-- Your JS/HTML goes here -->
<?php }
add_action( 'wp_footer', 'child_theme_footer_script' );
@bigdigital
bigdigital / fuction.php
Last active June 28, 2017 12:59
The7 Handle portfolio archive pages
add_filter( 'presscore_config_post_id_filter', 'dt_portfolio_archive_id_filter' );
function dt_portfolio_archive_id_filter($new_post_id) {
if (is_post_type_archive('dt_portfolio'))
{
$new_post_id = 84; //replace this to template post id
}
return $new_post_id;
}
@bigdigital
bigdigital / functions.php
Last active June 20, 2017 11:58
The7, add script before the end of your closing body tag </body>
add_action( 'wp_footer', function () { ?>
<script src="//lcp360.cachefly.net/panoskin.min.js"></script>
<script>
PANOSKIN.createViewer({
id: 'pano',
tour: 'TOUR-ID' /* Replace TOUR-ID with your tour's ID */
});
</script>
<?php } );
function add_after_head() {
?>
<meta name="google-site-verification" content="PLACE HERE MY CODE" />
<?php
}
add_action( 'wp_head', 'add_after_head' );
@bigdigital
bigdigital / functions.php
Last active June 28, 2017 08:21
The7 Add standard page title after slide page title
function custom_presscore_do_header_slideshow( $title ) {
$id = get_the_ID();
$myPostId = 36444;
if ($id !== $myPostId ) return;
$config = Presscore_Config::get_instance();
if ( 'slideshow' != $config->get('header_title') ){
return;
}
$config->set( 'page_title.breadcrumbs.enabled', true );
$config->set( 'header_title', 'enabled' );
@bigdigital
bigdigital / gist:a7523a1365877d064967ff24cef8afa2
Created July 11, 2017 14:04
change default portfolio metaboxed in The7
function dt_change_default_metabox() {
global $DT_META_BOXES;
if ( $DT_META_BOXES ) {
foreach ( $DT_META_BOXES as $key => $DT_META_BOX ) {
if (key_exists('id',$DT_META_BOX ) && ($DT_META_BOX['id'] === 'dt_page_box-portfolio_post_media_options') )
{
$DT_META_BOXES[ $key ]['fields']['0']['std'] = 'before';
@bigdigital
bigdigital / function.php
Created July 13, 2017 09:09
Remove Nofollow Link in The7
function my_filter_presscore_post_details_link( $output ){
$output = str_replace( 'rel="nofollow"', '' ,$output);
return $output;
}
add_filter( 'presscore_post_details_link', 'my_filter_presscore_post_details_link' );