Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package WPCharming
*/
global $wpc_option;
?><!DOCTYPE html>
{
"application_context": {
"brand_name": "HFTSY",
"cancel_url": "https://tvcreativemedia.com/api/checkout/pre/e07d628635d640978c5c3c566cac863a/provider-confirmed.json?is_cancel=true&x_system_id=676890125lpjljjpl",
"landing_page": "LOGIN",
"locale": "en-US",
"payment_method": {
"payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED",
"payer_selected": "PAYPAL"
},
@congthien
congthien / POST v1 payment_intents.txt
Last active July 30, 2023 12:39
stripe event from woo
{
"id": "pi_3NXqHtGw8WZ4Yvq01fmfTBYy",
"object": "payment_intent",
"amount": 8794,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 0,
@congthien
congthien / payment_intents
Created July 21, 2023 02:26
POST /v1/payment_intents
{
"id": "pi_3N5iWIHwAXz8vixA0KCXvZ1U",
"object": "payment_intent",
"amount": 10890,
"amount_capturable": 10890,
"amount_details": {
"tip": {
}
},
"amount_received": 0,
@congthien
congthien / construction wpc.php
Created July 6, 2022 04:42
fix portfolio sidebar in Construction theme issue
function wpcharming_get_sidebar() {
global $post;
global $woocommerce;
$post_type = get_post_type($post);
$archive_layout_setting = wpcharming_option('archive_layout');
$page_layout_admin = wpcharming_option('page_layout');
$blog_layout_admin = wpcharming_option('blog_layout');
$single_shop_layout = wpcharming_option('single_shop_layout');
$single_project_layout = wpcharming_option('project_layout');
@congthien
congthien / template-tags.php
Created June 7, 2022 03:33
replace wpcharming_header_default() function
function wpcharming_header_default() {
global $wpc_option;
?>
<header id="masthead" class="site-header <?php if ( wpcharming_option('header_fixed') ) echo 'fixed-on' ?>" role="banner">
<div class="header-wrap">
<div class="container-fluid">
<div class="site-branding">
<?php if ( wpcharming_option('site_logo', false, 'url') !== '' ) { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php echo wpcharming_logo_render(); ?>" alt="<?php get_bloginfo( 'name' ) ?>" />
<div class="offering-section">
<?php
$contentElementor = "";
if (class_exists("\\Elementor\\Plugin")) {
$post_ID = 9692;
$pluginElementor = \Elementor\Plugin::instance();
$contentElementor = $pluginElementor->frontend->get_builder_content($post_ID);
}
<?php
namespace WPCharming\Widgets;
use Elementor\Widget_Base ;
use Elementor\Controls_Manager ;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class WPC_Element_Testimonial_Carousel extends Widget_Base {
public function get_name() {
<?php
class Wpc_Posts extends WP_Widget {
public function __construct() {
// Widget actual processes
// parent::__construct(
// 'wpc_posts', // Base ID
// __('WPC Posts','wpcharming'), // Name