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
/(<!--WPRM Recipe (\d+)-->.*<!--End WPRM Recipe-->)(?!.*<!-- \/wp:wp-recipe-maker\/recipe -->)/s |
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
<!-- wp:group {"style":{"color":{"background":"#f4f4f4"},"spacing":{"padding":{"top":"2rem","bottom":"2rem","left":"2rem","right":"2rem"}}},"layout":{"type":"constrained"}} --> | |
<div class="wp-block-group has-background" style="background-color:#f4f4f4;padding-top:2rem;padding-right:2rem;padding-bottom:2rem;padding-left:2rem"><!-- wp:heading --> | |
<h2 class="wp-block-heading">Email me this recipe</h2> | |
<!-- /wp:heading --> | |
<!-- wp:paragraph --> | |
<p>Thinking about making this recipe? Save it for later by emailing yourself a copy.</p> | |
<!-- /wp:paragraph --> | |
<!-- wp:group {"backgroundColor":"base-2","layout":{"type":"flex","flexWrap":"nowrap","orientation":"horizontal","justifyContent":"space-between"}} --> |
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
/** | |
* Register the Smart Tag so it will be available to select in the form builder. | |
* | |
*/ | |
add_filter( 'wpforms_smart_tags', 'oc_register_smarttag', 10, 1 ); | |
function oc_register_smarttag( $tags ) { | |
$tags[ 'recipe' ] = 'Recipe'; | |
return $tags; |
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( 'tasty_recipes_recipe_template_vars', __NAMESPACE__ . '\replace_tasty_image_size', 10, 2 ); | |
function replace_tasty_image_size( $template_vars, $recipe ) { | |
$recipe_json = $recipe->to_json(); | |
$template_vars['recipe_image'] = ! empty( $recipe_json['image_sizes']['placement-recipe'] ) ? $recipe_json['image_sizes']['placement-recipe']['html'] : ''; | |
return $template_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
/* Support column layouts. */ | |
.wp-block-columns .wp-block-column { | |
margin-left: 12px; | |
} | |
.has-2-columns .wp-block-column:nth-of-type(2n+1), | |
.has-3-columns .wp-block-column:nth-of-type(3n+1), | |
.has-4-columns .wp-block-column:nth-of-type(4n+1), | |
.has-5-columns .wp-block-column:nth-of-type(5n+1), | |
.has-6-columns .wp-block-column:nth-of-type(6n+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 | |
/** | |
* When using thumbnails, anything using the chosen | |
* thumbnail size should adjust their srcset sizes to | |
* match. This assumes image sizes are always precise and | |
* used in the same layouts/collapse. | |
* | |
* In this case, the chosen image is 222px wide on larger | |
* screens and about 29-31% of the viewport on smaller. |
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
# @see https://really-simple-ssl.com/knowledge-base/manually-insert-htaccess-redirect-http-to-https/ | |
# BEGIN Redirect to HTTPS | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
# END Redirect to HTTPS |
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 // Do not include this line | |
add_action( 'init', 'oc_force_post_update' ); | |
function oc_force_post_update() { | |
$my_posts = get_posts( | |
array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'posts_per_page' => 10, | |
'offset' => 0, |
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 // do not include this line | |
add_action( 'genesis_entry_content', 'oc_snippet_do_disclosure', 1 ); | |
function oc_snippet_do_disclosure() { | |
if ( is_singular( 'post' ) ) { | |
echo '<p><strong>Disclosure: </strong>This post may contain affiliate links. I receive a small commission at no cost to you when you make a purchase using my link.</p>'; | |
} | |
} |
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 | |
$recipes = WPRM_Recipe_Manager::get_recipes(); | |
foreach ( $recipes as $recipe_id => $options ) { | |
$recipe = WPRM_Recipe_Manager::get_recipe( $recipe_id ); | |
if ( ! $recipe->servings() ) { | |
$import_source = get_post_meta( $recipe_id, 'wprm_import_source', true ); |
NewerOlder