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 | |
/** | |
* Custom Style that is base from the theme/ | |
* Cons: Doesnt show real time edit in the customizer | |
*/ | |
add_action('wp_head', 'custom_style_base_theme' ); | |
function custom_style_base_theme() { | |
ob_start(); | |
$output = ""; |
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 | |
/** | |
* Custom Style that is base from the theme/ | |
* Cons: Doesnt show real time edit in the customizer | |
*/ | |
add_action('wp_head', 'custom_style_base_theme' ); | |
function custom_style_base_theme() { | |
ob_start(); | |
$output = ""; |
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
/** | |
* Create [parent_category] shortcode | |
* Shortcode can have this attribute | |
* taxonomy //string | |
*/ | |
add_shortcode( 'parent_category', 'get_parent_category' ); | |
function get_parent_category( $atts ) { | |
$arg = shortcode_atts( array( | |
'taxonomy' => 'category', //default taxonomy |
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 | |
//Add this to your function.php | |
function upload_image( $imageID, $login ) { | |
$request_url = 'https://DOMAINNAME.com/wp-json/wp/v2/media'; //change the domainname | |
$image_file_path = get_attached_file($imageID); //change this to your file meda path if your not throwing media file to other server | |
$image = file_get_contents( $image_file_path ); | |
$mime = mime_content_type( $image_file_path ); | |
$api_media_response = wp_remote_post( $request_url, array( | |
'headers' => array( |
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 | |
// File Security Check | |
if ( ! defined( 'ABSPATH' ) ) { exit; } | |
add_action( 'customize_register' , array( 'AdditionalJS_Customize' , 'register' ) ); | |
//echoing the scripts. | |
add_action( 'wp_head' , array( 'AdditionalJS_Customize' , 'header_output' ) ); | |
add_action( 'wp_body_open' , array( 'AdditionalJS_Customize' , 'bodyopen_output' ) ); | |
add_action( 'wp_footer' , array( 'AdditionalJS_Customize' , 'footer_output' ) ); |
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
/*woo basic style*/ | |
table caption+thead tr:first-child td, table caption+thead tr:first-child th, table colgroup+thead tr:first-child td, table colgroup+thead tr:first-child th, table thead:first-child tr:first-child td, table thead:first-child tr:first-child th { | |
border: 0; | |
} | |
.woocommerce table.shop_table { | |
border: 0; | |
margin: 0 -1px 24px 0; | |
text-align: left; |