Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
thecodepoetry / functions.php
Last active July 8, 2016 11:55
Add share button to Woocommerce product page in The7.2, Armada
add_action('woocommerce_share', 'product_share', 10);
function product_share() {
presscore_display_share_buttons('post', array('echo' => true));
}
@thecodepoetry
thecodepoetry / functions.php
Created December 9, 2014 09:43
Compatibility fix for tribe event calender plugin
add_action( 'get_header', 'tribe_event_fix', 10 );
function tribe_event_fix() {
if ( 'tribe_events' == get_post_type() ) {
$config = Presscore_Config::get_instance();
presscore_config_base_init();
}
}
@thecodepoetry
thecodepoetry / functions.php
Last active August 29, 2015 14:11
Add DT meta boxes to events page
function dt_add_event_metaboxes() {
global $DT_META_BOXES;
if ( $DT_META_BOXES ) {
foreach ( array( 'dt_page_box-sidebar', 'dt_page_box-footer', 'dt_page_box-header_options', 'dt_page_box-slideshow_options', 'dt_page_box-fancy_header_options' ) as $mb_id ) {
if ( isset($DT_META_BOXES[ $mb_id ], $DT_META_BOXES[ $mb_id ]['pages']) ) {
$DT_META_BOXES[ $mb_id ]['pages'][] = 'tribe_events';
}
@thecodepoetry
thecodepoetry / functions.php
Created December 30, 2014 09:13
Custom menu filter for The7.2, Armada
add_filter( 'dt_menu_options', 'cp_custom_menu_filter' );
function cp_custom_menu_filter( $options = array() ) {
global $post;
if ( 'primary' == $options['location'] ) {
if(is_page( 35 )) { //if page id 35
@thecodepoetry
thecodepoetry / functions.php
Last active August 29, 2015 14:12
Add sidebar in category archive page, Th7e.2, Armada
add_action( 'get_header', 'dt_archive_sidebar', 10 );
function dt_archive_sidebar() {
$config = Presscore_Config::get_instance();
if(is_archive() || is_category() ){
$config->set( 'sidebar_position', 'right' );
$config->set( 'sidebar_widgetarea_id', 'sidebar_1' );
}
@thecodepoetry
thecodepoetry / functions.php
Created January 6, 2015 14:26
Disable sidebar globally
add_action( 'get_header', 'dt_disable_sidebar', 10 );
function dt_disable_sidebar() {
$config = Presscore_Config::get_instance();
$config->set( 'sidebar_position', 'disabled' );
}
@thecodepoetry
thecodepoetry / functions.php
Created January 8, 2015 08:44
Remove link from date The7.2
function presscore_get_post_data( $html = '' ) {
$href = 'javascript: void(0);';
if ( 'post' == get_post_type() ) {
// remove link if in date archive
if ( !(is_day() && is_month() && is_year()) ) {
$href = presscore_get_post_day_link();
@thecodepoetry
thecodepoetry / functions.php
Created January 13, 2015 08:54
Remove site name from title
function presscore_blog_title() {
$wp_title = wp_title('', false);
return $wp_title;
}
@thecodepoetry
thecodepoetry / ultimate.php
Created January 19, 2015 09:43
Hide ultimate addon notice
add_action('admin_head', 'my_custom_css');
function my_custom_css() {
echo '<style>
.ult_activate {
display: none;
}
</style>';
}
@thecodepoetry
thecodepoetry / funtion.php
Last active August 29, 2015 14:15
remove benefits from search results
function remove_benefits_search() {
global $wp_post_types;
$wp_post_types['dt_benefits']->exclude_from_search = true;
}
add_filter('pre_get_posts','remove_benefits_search');