This file contains 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
// verify that this is a product category page | |
if (is_product_category()){ | |
global $wp_query; | |
// get the query object | |
$cat = $wp_query->get_queried_object(); | |
// get the thumbnail id user the term_id | |
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
// get the image URL | |
$image = wp_get_attachment_url( $thumbnail_id ); | |
// print the IMG HTML |
This file contains 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
/** | |
* This is helper function will get attachment ID based on src | |
* | |
* @see http://wordpress.org/support/topic/need-to-get-attachment-id-by-image-url | |
*/ | |
function get_attachment_id_from_src( $url ) { | |
global $wpdb; | |
$id = url_to_postid( $url ); | |
if( $id == 0 ) { |
This file contains 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
<?php | |
class Test_Setting_Admin extends Genesis_Admin_Boxes { | |
/** | |
* Create an admin menu item and settings page. | |
* | |
* @since 1.0 | |
*/ | |
function __construct() { |
This file contains 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
<!-- Twitter share --> | |
<a href="http://twitter.com/?status=<?php the_title(); ?>%20<?php echo wp_get_shortlink(get_the_ID()); ?>" onclick="window.open(this.href); return false;">TWITTER</a> | |
<!-- Facebook --> | |
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" onclick="window.open(this.href); return false;">FACEBOOK</a> | |
<!-- Google plus --> | |
<a href="https://plus.google.com/share?url=<?php the_permalink();?>" onclick="javascript:window.open(this.href,'', 'menubar=no, toolbar=no, resizable=yes, scrollbars=yes,height=600,width=600');return false;">Google plus</a> | |
<!-- Pinterest --> |
This file contains 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
/** Exclude category from feed */ | |
function excludecatfeed($query) { | |
if(is_feed()) { | |
$query->set('category__not_in','-1'); | |
return $query; | |
} | |
} | |
add_filter('pre_get_posts', 'excludecatfeed'); |
NewerOlder