Skip to content

Instantly share code, notes, and snippets.

View Alipio123's full-sized avatar

Alipio Gabriel Alipio123

View GitHub Profile
/*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;
@Alipio123
Alipio123 / additionaljs_theme.php
Created April 12, 2020 08:01
Add Additional Javascript on any Theme. Located under Theme Customization
<?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' ) );
@Alipio123
Alipio123 / wordpress-remote-image-upload.php
Created January 7, 2020 10:04
Upload image in Wordpress media using Wordpress API REST using wp_remote_post.
<?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(
@Alipio123
Alipio123 / parent_terms.php
Created October 20, 2019 14:36
Getting parent category and showing it through wordpress shortcode paste this code in functions.php
/**
* 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
@Alipio123
Alipio123 / functions.php
Created September 28, 2019 07:30
Elementor heading line height will inherit the theme astra customizer. Paste the code under functions.php
<?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 = "";
@Alipio123
Alipio123 / elementor-font
Created September 28, 2019 07:30
Elementor heading line height will inherit the theme astra customizer.
<?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 = "";