Skip to content

Instantly share code, notes, and snippets.

View themepaint's full-sized avatar

Shariful Islam themepaint

View GitHub Profile
@themepaint
themepaint / Register Custom Post Type
Last active August 29, 2015 14:18
Register Custom Post Type
<?php
/*Register Custom Post Type*/
function tp_custom_portfolio(){
$labels=array(
'name'=>__('Portfolios'),
'singular_name'=>__('Portfolio'),
'add_new'=>__('Add New Portfolio'),
'edit_items'=>__('Edit Portfolio'),
'new_item'=>__('New Portfolio'),
'new_item' => __( 'New Portfolio', 'tp_portfolio_tx' ),
@themepaint
themepaint / Custom Taxonomies
Created August 6, 2015 07:45
Custom Taxonomies in Custom Post
function team_taxonomies() {
$args = array(
'hierarchical' => true,
'labels' => array(
'name' => 'Team Members Type',
'singular_name' => 'Member Type',
'search_items' => __( 'Search Member' ),
'all_items' => __( 'All Member' ),
'parent_item' => __( 'Parent Member' ),
@themepaint
themepaint / Tags List in Shortcode
Last active August 29, 2015 14:27
Tags List in Shortcode Final
add_shortcode('footer_tags',function(){
$html ='<div class="tagcloud">';
$tags = get_tags();
foreach ( $tags as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
$html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug} tag-link-29' style='font-size: 8pt;'>";
$html .= "{$tag->name}</a>";
}
@themepaint
themepaint / YITH Wishlist Icon Filtering
Created October 12, 2015 03:49
YITH Wishlist Icon Filtering
function iconWishlist($value){
return '<i class="fa fa-heart"></i><span>Add to wishlist</span>';
}
function iconWishlistAdd(){
return '<i class="fa fa-check"></i><span>View wishlist</span>';
}
add_filter( 'yith_wcwl_button_label','iconWishlist');
@themepaint
themepaint / All type Shortcode
Created October 14, 2015 05:24
All type Shortcode
=================== Type 1 Popular ==============
/*Latest Post Shortcode*/
function cruise_latest_post($atts, $content = null ) {
// Attributes
extract( shortcode_atts(
array(
'title' => 'Search For Courses',
), $atts )
);
@themepaint
themepaint / Get Time Format from Dashboard format
Last active December 22, 2015 15:06
Get Time Format from Dashboard format
//For Time From Dashboard
<?php the_time(get_option( 'date_format' ) )?>
@themepaint
themepaint / Woocommerce Get URl
Created January 4, 2016 05:49
Woocommerce Get URL some Functions.
//Shop Page URL
$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
//My Account URL
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
if ( $myaccount_page_id ) {
$myaccount_page_url = get_permalink( $myaccount_page_id );
}
//Cart URL
<?php
/*Product DIscount Calculation*/
//put it on Function
function discount_product(){
global $product;
$discount = $product->sale_price ;
if ($discount) {
$percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 );
$wc_percent = $price .' <span class="product-discount">'. sprintf( __('%s', 'cruise' ), $percentage . '% OFF</span>' );
}
@themepaint
themepaint / Woocommerce Price Filter CSS
Created February 2, 2016 08:20
Woocommerce Price Filter CSS
.price_slider{
margin-bottom: 1em;
}
.price_slider_amount {
text-align: right;
line-height: 2.4em;
font-size: 0.8751em;
}