Table of Contents
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
window.addEventListener( 'DOMContentLoaded', function() { | |
var $map = $( '.jet-map-listing' ); | |
if ( ! $map.length ) { | |
return; | |
} | |
$map.on( 'jet-filter-custom-content-render', function( event, response ) { |
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_action('rest_api_init', 'getawayRegisterRoute'); | |
function getawayRegisterRoute() { | |
register_rest_route( 'getaway/v1', 'data', array( | |
'methods' => WP_REST_SERVER::READABLE, | |
'callback' => 'getawayDataResults' | |
)); | |
} |
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
#!/usr/bin/env python3 | |
# !! NOTE - this script is no longer maintained... please see the repo for further | |
# updates: https://github.com/jheddings/notes2notion | |
# this script attempts to migrate from Apple Notes to Notion while retaining as | |
# much information and formatting as possible. there are limitations to the | |
# export data from Notes, so we try to preserve the intent of the original note. | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
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
/* I'll put here different examples of dynamic query for Oxygen repeater : | |
* - Use one of the following repeater_dynamic_query definitions | |
* in code block just BEFORE the repeater | |
* - Set the repeater custom query settings : post type, number of posts, order... | |
* - Add the remove_action in a code block AFTER the repeater | |
*/ | |
/**************************************************************************************************** | |
* Display related posts for any CPT with 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_action( 'astra_content_loop', 'custom_post_type_loop_callback' ); | |
function custom_post_type_loop_callback(){ | |
if( "movies" == get_post_type() ) { | |
remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_default' ) ); | |
remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_post' ) ); | |
if ( is_singular( "movies" ) ) { | |
add_filter( 'astra_post_link', '__return_false' ); | |
} |
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 | |
function example_ajax_enqueue() { | |
// Enqueue javascript on the frontend. | |
wp_enqueue_script( | |
'example-ajax-script', | |
get_template_directory_uri() . '/js/simple-ajax-example.js', | |
array( 'jquery' ) | |
); |
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
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] | |
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] | |
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] |
As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
NewerOlder