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 dashboard widget that lists out pages in a heirarchy | |
* Add this to the end of your "Functions.php" file in your theme directory | |
* | |
* This function is hooked into the 'wp_dashboard_setup' action below. | |
*/ | |
function site_map_edit() { | |
wp_add_dashboard_widget( | |
'site_map_edit', // Widget slug. |
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 | |
// Assign the custom field to a variable | |
$her_final_word = get_post_meta($post->ID, 'her_final_word', true); | |
// Check if variable is not empty | |
if($her_final_word !='') { | |
// True: Print the variable | |
?><p><?php echo $her_final_word; ?></p><?php | |
} | |
else { | |
// Default text that will appear |
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 | |
/** | |
* The template used for displaying page content in page.php | |
* | |
* @package doc | |
*/ | |
?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<header class="entry-header"> |
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
<!-- This is called in the head of this file --> | |
<?php require('./blog/wp-blog-header.php'); ?> | |
<!-- way down the page --> | |
<div class="feature_blog"> | |
<div class="feature_blog_content"> | |
<h4>The Distance Lens Blog</h4> | |
<?php | |
$args = array( 'numberposts' => '1', 'category' => '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 | |
/** | |
* I am creating a function here because I am calling it in my template | |
* using custom_header_template(); | |
* but you do not need to do this | |
* Additionally, I have a lot of fields that I need to pull in, so I am assigning each one as a variable | |
* One of those fields is an image and I need the URL so I use the pods_image_url filter | |
* Additionally, I have a WYSYWIG that has custom shortcodes in it, so I have to use do_shortcode(); to call that field for the shortcode to be executed | |
*/ |
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 paremeters of Pods | |
// Limiting by 4, and looping through the category slug called "for-parents" | |
$params = array( | |
'limit' => 4, | |
'where' => "category.slug = 'for-parents'" | |
); | |
// Create a variable called $links and assign that my pod called "link" pulling in the parameters from above | |
$links = pods('link', $params ); | |
// If there are more than 0 links, let's display them! |
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
<html> | |
<head> | |
<title>Looping through json object</title> | |
<script type="text/javascript"> | |
/* | |
Looping through your custom post type data using Wordpress rest API | |
You'll need this plugin as of 1/15/2015. http://wp-api.org/ | |
Eventually this will be included in the WP Core. Supposed to be with 4.1, but that didn't happen. | |
*/ | |
</script> |
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
[{"screenshotId":"95ee50ce-d030-49ff-9f4c-acb9d80cc80e","resolutionHeight":1080,"resolutionWidth":1920,"state":"Published","dateTaken":"2015-04-12 20:55:20","lastModified":"2015-04-12 20:55:36","userCaption":"","type":"UserGenerated","scid":"28360100-1f6f-4a8d-b425-4dbd7ffe16e1","titleId":2147358433,"rating":0,"ratingCount":0,"views":0,"titleData":"","systemProperties":"878353f4-d619-44d9-8d9d-161e81c17a83;","savedByUser":false,"achievementId":"","greatestMomentId":"","thumbnails":[{"uri":"http:\/\/screenshotscontent-t5001.xboxlive.com\/00090000004fa942-95ee50ce-d030-49ff-9f4c-acb9d80cc80e\/Thumbnail_Small.PNG","fileSize":80252,"thumbnailType":"Small"},{"uri":"http:\/\/screenshotscontent-t5001.xboxlive.com\/00090000004fa942-95ee50ce-d030-49ff-9f4c-acb9d80cc80e\/Thumbnail_Large.PNG","fileSize":258104,"thumbnailType":"Large"}],"screenshotUris":[{"uri":"http:\/\/screenshotscontent-t5001.xboxlive.com\/00090000004fa942-95ee50ce-d030-49ff-9f4c-acb9d80cc80e\/Screenshot-Original.png?sv=2013-08-15&sr=c&sig=Av3Oz549hie |
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
<html> | |
<head> | |
<title>Screenshots!</title> | |
</head> | |
<body> | |
<h1>Screenshots!</h1> | |
<div id="container"> | |
</div> | |
</body> |
OlderNewer