<?php | |
/* Template Name: Genesis and SearchWP integration with pagination */ | |
function prefix_searchwp_form( $query ) { | |
echo '<form class="searchwp-form" action="" method="get">'; | |
echo '<input type="text" id="searchwpquery" name="searchwpquery" value="' . esc_attr( $query ) . '" />'; | |
echo '<button type="submit">' . __( 'Search', 'text-domain' ) . '</button>'; | |
echo '</form>'; | |
} |
<?php | |
/** | |
* Generate slideshow from ACF gallery field. | |
* | |
* A Flexslider (Soliloquy) slider will be created from from images assigned | |
* via the ACF gallery field type. | |
* | |
* The following plugins are needed: | |
* - Soliloquy | |
* - Soliloquy Dyanmic Addon |
add_action("gform_after_submission_1", "acf_post_submission", 10, 2); | |
function acf_post_submission ($entry, $form) | |
{ | |
$post_id = $entry["post_id"]; | |
update_field('address1', $entry['29.1'], $post_id); | |
update_field('address2', $entry['29.2'], $post_id); | |
update_field('address3', $entry['29.3'], $post_id); | |
} |
This is a WORK IN PROGRESS intended for fleshing out and feedback
It's very common for people to be unhappy with how a WordPress plugin adds front end resources to their site. If a plugin needs CSS, the plugin will add a <link>
element to that CSS. If the plugin needs JavaScript, it will add a <script>
to that JavaScript.
Plugins do this because it works. It's damn important for a WordPress plugin to work, even in adverse conditions. They rightfully want good ratings and little customer support.
But this comes at the cost of additional HTTP requests. In optimizing front end performance of a site, reducing the number of HTTP requests is a huge thing. Front end developers want to decide and control how front end resources are being handled, and WordPress plugins don't typically make this easy on them.
<?php | |
// Do NOT include the opening php tag above | |
add_action( 'genesis_entry_content', 'jmw_add_envira_gallery_after_content', 15 ); | |
/* | |
* Add the gallery after the end of the content | |
*/ | |
function jmw_add_envira_gallery_after_content() { | |
$gallery = get_post_meta( get_the_ID(), 'gallery' ); // 'gallery' is name of my ACF gallery field |
<?php | |
/** | |
* -------------------------------------------------------------------- | |
* STOP! There's a better way to do this now: | |
* https://gravitywiz.com/edit-gravity-forms-entries-on-the-front-end/ | |
* -------------------------------------------------------------------- | |
* | |
* Gravity Wiz // Gravity Forms // Edit Entries | |
* | |
* Automatically populate a form with data based on an entry ID and update that entry on submission. |
<?php | |
if ( isset( $_GET['s'] ) && 0 == strlen( trim( $_GET['s'] ) ) ) { | |
add_filter( 'searchwp_short_circuit', '__return_true' ); | |
} |
<?php | |
// Published under GPL | |
// tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/ | |
class Developer_Import { | |
public function __construct() { | |
add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) ); |