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
# Redirect WordPress local development uploads, to dev/prod server. | |
RedirectMatch 301 ^/wp-content/uploads/(.*) https://mywebsite.wpenginepowered.com/wp-content/uploads/$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
1 Base/Default Styles - root of theme.json styles section | |
2 Element styles - default styles for elements such as links and buttons (styles.elements) | |
3 Block styles - default styles for blocks (styles.blocks) | |
4 Block Type Style Variations - variations of blocks styled the same accross different pages such as border button | |
5 Section Style - when you want part of a page to look different | |
6 Template styles |
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
$ vendor/bin/phpcbf {filename} | |
$ vendor/bin/phpcs {filename} |
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 | |
/** | |
* Retrieve the URL of the page using a template. | |
* | |
* @author Lauren Levin (Pittenger) | |
* | |
* @param string $template_name The name of the page template, ex. 'page-templates/countries.php'. | |
*/ | |
function get_link_by_page_template_name( $template_name ) { | |
$url = null; |
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
# Redirect WordPress uploads requests, to dev/prod server | |
RedirectMatch 301 ^/wp-content/uploads/(.*) https://mywebsite.com/wp-content/uploads/$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
<!-- wp:group {"backgroundColor":"vivid-red","textColor":"white","layout":{"type":"constrained"}} --> | |
<div class="wp-block-group has-white-color has-vivid-red-background-color has-text-color has-background"><!-- wp:paragraph --> | |
<p><strong>Each block type is on a separate page.</strong> </p> | |
<!-- /wp:paragraph --> | |
<!-- wp:paragraph {"fontSize":"small"} --> | |
<p class="has-small-font-size">Use the links at the bottom of this page to navigate between pages.</p> | |
<!-- /wp:paragraph --></div> | |
<!-- /wp:group --> |
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
$order = ''; | |
if ( sort_group = 1 ) { | |
$order = 'ASC'; | |
} | |
if ( sort_group = 1 ) { | |
$order = 'DESC'; | |
} |
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 | |
/** | |
* | |
* Loop through some custom post types and group them by taxonomy term, | |
* outputting the taxonomy term names before the set of posts | |
* | |
*/ | |
// get all of the custom taxonomy terms | |
$taxonomy = 'my_custom_taxonomy'; |
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 | |
/** | |
* | |
* Display a YouTube video thumbnail based on a URL in a template | |
* | |
*/ | |
$video_link = 'https://www.youtube.com/watch?v=B9duuy7lr08'; |
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 | |
//* Template Name: Blog | |
//* Remove the blog heading which caused duplicate page title with the below standard loop | |
remove_action( 'genesis_before_loop', 'genesis_do_blog_template_heading' ); | |
//* Show page content above posts | |
add_action( 'genesis_loop', 'genesis_standard_loop', 5 ); | |
genesis(); |
NewerOlder