Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
schalkjoubert / Storefront Post Meta - Posted On
Created Sep 28, 2016
Move the Storefront Posted On date inside the Post Meta
View Storefront Post Meta - Posted On
if ( ! function_exists( 'storefront_post_meta' ) ) {
* Display the post meta
* @since 1.0.0
View Top Level Plugin
* Plugin Name: Home Page CPT
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
add_menu_page( 'My Top Level Menu Example', 'Top Level Menu', 'manage_options', 'example.php', 'myplguin_admin_page', 'dashicons-tickets', 6 );
schalkjoubert / Use ACF field to populate Title AND update slug
Last active Oct 6, 2017
Use ACF field to populate Title AND update slug
View Use ACF field to populate Title AND update slug
//Auto add and update Title field:
function my_post_title_updater( $post_id ) {
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_name'] = '';
$posttypes = array( 'accommodation', 'destination' );
$currentposttype = get_post_type($post_id);
if ( in_array( $currentposttype, $posttypes ) ) {
schalkjoubert / custom-post-type-description
Last active Oct 6, 2017
Custom Post Type Archive Description Field
View custom-post-type-description
add_action( 'admin_menu', 'tsumtour_add_admin_menu' );
add_action( 'admin_init', 'tsumtour_settings_init' );
function tsumtour_add_admin_menu( ) {
add_submenu_page( 'edit.php?post_type=tour', 'Tour', 'Intro', 'manage_options', 'tour', 'tsumtour_options_page' );
function tsumtour_settings_init( ) {
register_setting( 'pluginPage', 'tsumtour_settings' );
View change-post-type-upload-path
if(!empty( $_REQUEST["post_id"]) ) {
add_filter('upload_dir', 'tsum_upload_dir');
$upload = wp_upload_dir();
// remove_filter('upload_dir', 'tsum_upload_dir');
function tsum_upload_dir( $upload ) {
$id = $_REQUEST['post_id'];
$parent = get_post( $id )->post_parent;
// Check the post-type of the current post
if( "post-type-name-ie-product" == get_post_type( $id ) || "post-type-name-ie-product" == get_post_type( $parent ) )
schalkjoubert / acf-export-2018-02-05.json
Last active Feb 5, 2018
ACF Fields to move to Sub Field of Repeater Field
View acf-export-2018-02-05.json
"key": "group_5a7741d53f5b5",
"title": "Sales Catalogue",
"fields": [
"key": "field_5a77425967079",
"label": "Sale Catalogue Entry",
"name": "sale_catalogue_entry",
"type": "repeater",
View opensslerror.txt
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /app/public/wp-content/themes/storechild-master/content-single-auction.php on line 175 Warning: file_get_contents(): Failed to enable crypto in /app/public/wp-content/themes/storechild-master/content-single-auction.php on line 175 Warning: file_get_contents(,-74.0059731&key=AIzaSyCM1fCTYKPhk6tDCqsVNhcXto6aqjUc0yY): failed to open stream: operation failed in /app/public/wp-content/themes/storechild-master/content-single-auction.php on line 175 Fatal error: Uncaught Exception: String could not be parsed as XML in /app/public/wp-content/themes/storechild-master/content-single-auction.php:176 Stack trace: #0 /app/public/wp-content/themes/storechild-master/content-single-auction.php(176): SimpleXMLElement->__construct('') #1 /app/public/wp-includes/template.php(690): require
schalkjoubert / content-auction.php
Created Feb 7, 2018
Testing for elevation from Google Map
View content-auction.php
* Template used to display post content.
* @package storefront
<!-- -->
schalkjoubert / archive-product.php
Created Jan 25, 2018
FacetWP in Woocommerce Archive
View archive-product.php
* The Template for displaying product archives, including the main shop page which is a post type archive
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
You can’t perform that action at this time.