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
| {# Set variable containing parent and children terms. #} | |
| {% set taxonomies %} | |
| {# Set taxonomy to be queried #} | |
| {% set taxonomy_name = 'taxonomy_name' %} | |
| {# First gather only the parent terms. #} | |
| {% set parents = post.terms( {query:{taxonomy: taxonomy_name, orderby:'name', order: 'ASC', parent:0}} ) %} | |
| {# Show parents separated by comma #} | |
| {{ parents|join(', ') }} | |
| <br><br> |
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
| // install vbguest so guest additions are updated when `vagrant up` is run (https://discoposse.com/2016/05/23/autoupdating-virtualbox-guest-additions-with-vagrant-vbguest/) | |
| vagrant plugin install vagrant-vbguest | |
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
| // Move Yoast to bottom (why is it on top, really?) | |
| function yoasttobottom() { | |
| return 'low'; | |
| } | |
| add_filter( 'wpseo_metabox_prio', 'yoasttobottom'); |
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
| {# Check if this is the front/homepage #} | |
| {% if fn('is_front_page') %} | |
| {# store our hero data #} | |
| {% set image = hero_random_img.url %} | |
| {% set title = hero_random_copy %} | |
| {% set link = hero_random_link.url %} | |
| {% set link_title = hero_random_link.title %} | |
| {% set link_target = hero_random_link.target %} | |
| {% set alignment = hero_random_alignment %} |
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
| {% if is_home %} | |
| {% set hero = post.get_field('hero') %} {# Grab custom field hero group #} | |
| {% set background = hero.background_image %} {# Grab custom field bg image #} | |
| {% else %} | |
| {% set background = post.thumbnail.src('hero') %} {# Otherwise use featured image, with the 'hero' size #} | |
| {% endif %} | |
| {% embed "@components/page-hero/page-hero.twig" with | |
| { |
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
| {# Adding color and image to single template #} | |
| {# Where 'topics'/'topic' is your taxonomy #} | |
| {% set topics = post.terms('topic') %} | |
| {% if topics %} | |
| <div class="taxonomy taxonomy--topic"> | |
| {% for term in topics %} | |
| {# User term.meta to grab associated color/bg image #} | |
| <div class="taxonomy__icon" style="background-color:{{ term.meta('color') }}; background-image:url({{ Image(term.meta('image')).src }});"></div> |
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 | |
| wp_register_style('clientNameGoogleFonts', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700,700i,800'); | |
| wp_enqueue_style( 'clientNameGoogleFonts'); | |
| wp_register_script('fontawesome', get_template_directory_uri() . '/js/lib/fontawesome-all.js', array() ); | |
| wp_enqueue_script('fontawesome'); | |
| wp_register_script('wowjs', get_template_directory_uri() . '/js/wow.js', array('jquery') ); | |
| wp_enqueue_script('wowjs'); | |
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 the default "tags" (post_tag) taxonomy with custom post types in WordPress, | |
| by default, CPTs are not included on the archive listing page. | |
| In your functions.php or custom plugin for your site, add the following to ensure all post | |
| types are included. */ | |
| // Changes 'cssgirl' with your own namespace | |
| function cssgirl_all_cpt_tags( $query ) { | |
| if ( $query->is_tag() && $query->is_main_query() ) { |
NewerOlder