This file contains hidden or 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 "Read More" link to automatic excerpts | |
add_filter('the_content_more_link', 'wpm_get_read_more_link'); | |
add_filter('get_the_content_more_link', 'wpm_get_read_more_link'); // Genesis Framework only | |
add_filter('excerpt_more', 'wpm_get_read_more_link'); | |
function wpm_get_read_more_link() { | |
global $post; | |
return '… <a href="' . get_permalink($post->ID) . '">[Continue reading] <span class="screen-reader-text">' . get_the_title() . '</span></a>'; | |
} |
This file contains hidden or 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
<a href="http://www.example.com/page.php?key1=value&key2=value">link</a> |
This file contains hidden or 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 | |
if ( isset($_GET['key']) ) { | |
echo $_GET['key']; | |
} else { | |
// Fallback behaviour here | |
} |
This file contains hidden or 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
<div class="tier1"> | |
<h2>Lackey</h2> | |
// ... | |
// ... Tier 1 description here | |
// ... | |
<a href="enquiry-form.php?tier=lackey">Join now</a> | |
This file contains hidden or 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 | |
// Declare custom URL parameters | |
add_filter( 'query_vars', 'wpm_add_query_vars_filter' ); | |
function wpm_add_query_vars_filter( $vars ) { | |
$vars[] = "tier"; | |
$vars[] = "second-param"; | |
$vars[] = "third-param"; // etc. | |
return $vars; | |
} |
This file contains hidden or 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_filter( 'ninja_forms_field', 'wpm_handle_http_query_string' ); | |
function wpm_handle_http_query_string( $data ) { | |
if($data['label']=='Tier' && get_query_var('tier')) { | |
foreach ($data['list']['options'] as $key => $value) { | |
if($value['value'] == get_query_var('tier')) { | |
$data['list']['options'][$key]['selected'] = 1; | |
} |
This file contains hidden or 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_filter( 'ninja_forms_field', 'wpm_handle_http_query_string' ); | |
function wpm_handle_http_query_string( $data ) { | |
// A list field with label "Tier" | |
if($data['label']=='Tier' && get_query_var('tier')) { | |
foreach ($data['list']['options'] as $key => $value) { | |
if($value['value'] == get_query_var('tier')) { | |
$data['list']['options'][$key]['selected'] = 1; |
This file contains hidden or 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( 'init', 'wpm_product_cat_register_meta' ); | |
/** | |
* Register details product_cat meta. | |
* | |
* Register the details metabox for WooCommerce product categories. | |
* | |
*/ | |
function wpm_product_cat_register_meta() { |
This file contains hidden or 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( 'product_cat_add_form_fields', 'wpm_product_cat_add_details_meta' ); | |
/** | |
* Add a details metabox to the Add New Product Category page. | |
* | |
* For adding a details metabox to the WordPress admin when | |
* creating new product categories in WooCommerce. | |
* | |
*/ |