Skip to content

Instantly share code, notes, and snippets.

David Wang blogjunkie

Block or report user

Report or block blogjunkie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View archive-knowledgebase.php
<?php
/**
* Template for ClickWP knowledgebase post type
* @since 3.0.5
*/
/**
* TODO
* 1. Popular posts section - KB articles tagged 'popular'
@blogjunkie
blogjunkie / functions.php
Last active Apr 19, 2019
Force a page layout for post type in Astra theme
View functions.php
<?php
add_filter( 'astra_get_content_layout', 'child_astra_post_type_content_layout');
/**
* Force the container layout for post type in Astra theme
*/
function child_astra_post_type_content_layout ( $layout ){
// Apply only to specific post types
if ( is_singular( array( 'fl-builder-template' ) ) ) {
@blogjunkie
blogjunkie / functions.php.php
Created Apr 19, 2019
Disabled featured image on certain post types for Astra theme
View functions.php.php
<?php
add_action( 'wp', 'child_disable_astra_featured_image' );
/**
* Disable Featured image on certain post types.
*/
function child_disable_astra_featured_image() {
$post_types = array( 'page', 'tribe_events' );
// return early if the current post type if not the one we want to customize.
@blogjunkie
blogjunkie / index.html
Created Aug 25, 2018
clickwp-faqs beacon
View index.html
<!doctype HTML>
<html>
<head>
<title></title>
<style></style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.js"></script>
</head>
<body>
<a class="beacon-toggle" href="">Contact us</a>
@blogjunkie
blogjunkie / screen.js
Created Aug 9, 2018
Track clicks as GA events on all links with 'ga_event_click' CSS class
View screen.js
<script type="text/javascript">
jQuery(function($) {
/*
Track clicks as GA events on all links with 'ga_event_click' CSS class
Use data attributes to identify event fields. Example use:
<a href="http://example.com" class="ga_event_click" data-category="Button" data-action="play video" data-label="Play Button" data-value="0">Click me</a>
data-category will default to 'click' if no value is provided
data-action will default to the URL if no value is provided
@blogjunkie
blogjunkie / lessons-programs.php
Created Jun 19, 2018
Adds Lessons post type and Programs taxonomies. For Genesis child themes, the Primary sidebar will be replaced with a Lessons sidebar.
View lessons-programs.php
<?php
/*
Plugin Name: Lessons & Programs
Plugin URI:
Description: Adds Lessons post type and Programs taxonomies. For Genesis child themes, the Primary sidebar will be replaced with a Lessons sidebar.
Version: 1.0
Author: ClickWP
Author URI: https://clickwp.com
Text Domain: lessons-programs
Domain Path: /languages
@blogjunkie
blogjunkie / remove-beaver-builder-from-admin-woocommerce.php
Created Jan 5, 2018 — forked from carasmo/remove-beaver-builder-from-admin-woocommerce.php
Remove Beaver Builder link and tab in Admin for WooCommerce pages
View remove-beaver-builder-from-admin-woocommerce.php
<?php
//* DON'T ADD ABOVE
/*
*
* READ ME:
* I'm using Beaver Builder for page post types and I don't want that option on
* WooCommerce store, cart, checkout, and my account pages. I don't want the client to ask why she can't change
@blogjunkie
blogjunkie / functions.php
Last active Mar 10, 2018
Define defaults for Beaver Builder button module Link: http://www.wpbeaverworld.com/add-default-colors-button-module/
View functions.php
<?php
add_filter( 'fl_builder_settings_form_defaults', 'click_bb_button_default_colors', 20, 2 );
function click_bb_button_default_colors( $defaults, $type )
{
if( $type == "button-module" )
{
$defaults->bg_color = "d43c67";
$defaults->bg_hover_color = "000000";
$defaults->text_color = "ffffff";
@blogjunkie
blogjunkie / function.php
Last active Aug 30, 2017
Serve minified stylesheet when SCRIPT_DEBUG or WP_DEBUG is defined
View function.php
<?php
/*
* Manage loading of theme styles
*/
add_action( 'after_setup_theme', 'child_load_stylesheet' );
function child_load_stylesheet() {
// First, remove the stylesheet
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
View functions.php
add_shortcode( 'post_category', 'sk_post_category_shortcode' );
/**
* Produces the first category link.
*
* Supported shortcode attributes are:
* after (output after link, default is empty string),
* before (output before link, default is 'Tagged With: '),
* sep (separator string between tags, default is ', ').
*
* Output passes through 'genesis_post_categories_shortcode' filter before returning.
You can’t perform that action at this time.