Skip to content

Instantly share code, notes, and snippets.

@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');
@thecodepoetry
thecodepoetry / functions.php
Last active August 29, 2015 14:15 — forked from imemohit/functions.php
Product sidebar global edit
add_action( 'get_header', 'dt_product_sidebar', 10 );
function dt_product_sidebar() {
$config = Presscore_Config::get_instance();
if(is_product() ){
$config->set( 'sidebar_position', 'right' );
$config->set( 'footer_widgetarea_id', 'sidebar_1' );
}
@thecodepoetry
thecodepoetry / functions.php
Last active August 29, 2015 14:16
bbpress fix
function dt_buddypress_template_config() {
if( bbp_is_single_user() ){
$pagid = 35215; //sidebar, footer settings of the page id given will be applied to user profiles
$config = presscore_get_config( );
presscore_config_base_init( $pagid );
}
}
add_action( 'get_header', 'dt_buddypress_template_config', 10 );
@thecodepoetry
thecodepoetry / function.php
Created March 31, 2015 12:43
Load main.js from child theme
function custom_enq_childminjs() {
wp_dequeue_script( 'dt-main', get_template_directory_uri() . '/js/main.js', array( 'jquery' ), false, true );
wp_register_script('dt-main', get_stylesheet_directory_uri() . '/js/main.js', array('jquery'),false, true);
wp_enqueue_script('dt-main');
}
add_action( 'wp_enqueue_scripts', 'custom_enq_childminjs' );
@thecodepoetry
thecodepoetry / 1.php
Created April 7, 2015 13:36
Add to cart button on shop
//add this code in functions.php
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
//and add this rule in Theme options > General > CUstom CSS
.project-list-content a.add_to_cart_button:after {
display: none;
}
function presscore_top_bar_contact_element( $element ){
$white_list = array(
'address',
'phone',
'email',
'skype',
'clock'
);
if ( in_array($element, $white_list) ) {
@thecodepoetry
thecodepoetry / gist:6c93d2f988c6a8c56b52
Created April 27, 2015 10:16
variable-product-icons
.product_type_variable:after {
background-image: url("data:image/svg+xml,%3Csvg%20version=%221.1%22%20xmlns=%22http://www.w3.org/2000/svg%22%20xmlns:xlink=%22http://www.w3.org/1999/xlink%22%20x=%220px%22%20y=%220px%22%20width=%2224px%22%20height=%2224px%22%20viewBox=%220%200%2024%2024%22%20enable-background=%22new%200%200%2024%2024%22%20fill=%22white%22%20xml:space=%22preserve%22%3E%3Cpath%20d=%22M2.053,13.145h5.746v3.332H5.892v4.506H3.96v-4.506H2.053V13.145z%20M9.152,11.577h1.907v9.405h1.931v-9.405h1.908V8.245H9.152V11.577z%20M12.989,3.018h-1.931v3.778h1.931V3.018z%20M21.947,13.154h-5.744v3.332h1.906v4.496h1.932v-4.496h1.906V13.154z%20M5.892,3.018H3.96v8.677h1.932V3.018z%20M20.041,3.018h-1.932v8.677h1.932V3.018z%22/%3E%3C/svg%3E");
}