/core/install.php
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
// example: https://vimeo.com/api/oembed.json?url=https://vimeo.com/387724556 | |
<?php | |
$vimeo_url = 'https://vimeo.com/387724556'; | |
$data = json_decode(file_get_contents('http://vimeo.com/api/oembed.json?url=' . $vimeo_url)); | |
echo '<img class="vimeo-video" src="' . $data->thumbnail_url . '" alt="Video: ' . $data->title . '">'; | |
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
PATH="/usr/local/bin:/usr/local/sbin:$PATH" | |
PATH="/Applications/MAMP/bin/php/php7.x.x/bin:$PATH" | |
PATH="/Applications/MAMP/Library/bin:$PATH" | |
PATH="/usr/local/share:$PATH" | |
PATH="$HOME/.composer/vendor/bin:$PATH" | |
export PATH |
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 | |
// https://wordpress.org/support/topic/how-to-add-custom-taxonomy-in-custom-post-type-permalink | |
// Create Asset Custom Post Type | |
function create_the_asset_posttype() { | |
$labels = array( | |
... | |
'name' => __( 'Asset' ), | |
); | |
$args = array( |
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 | |
// https://wpza.net/how-to-paginate-a-custom-post-type-in-wordpress | |
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
$args = array( | |
'post_type' => 'custom_post_type_name', | |
'posts_per_page' => 10, | |
'paged' => $paged | |
); | |
$loop = new WP_Query( $args ); |
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 | |
/** | |
* Enabe excerpts for pages | |
*/ | |
function THEME_enable_page_excerpt() { | |
add_post_type_support('page', array('excerpt')); | |
} | |
add_action('init', 'THEME_enable_page_excerpt'); |
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 printf( __( 'The post type is: %s', 'textdomain' ), get_post_type( get_the_ID() ) ); ?> |
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 | |
// project_tag is the term parent | |
<?php if (has_term($post->ID, 'project_tag')): ?> | |
<div class="blog-focus-areas"> | |
<h3>Related Focus Areas</h3> | |
<?php echo get_the_term_list($post->ID, 'project_tag', '<ul><li>', ',</li><li>', '</li></ul>'); ?> | |
</div> | |
<?php endif; ?> |
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
https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/ | |
<?php $featured_img_url = get_the_post_thumbnail_url(get_the_ID(), 'full'); ?> | |
<?php if (has_post_thumbnail( $post->ID ) ): ?> | |
<?php echo esc_url($featured_img_url); ?> | |
<?php endif; ?> | |