This file contains 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
//Psudo Code Description | |
$url = LOAD Tumblr Posts from API | |
$xml = CREATE ARRAY from $url | |
$i = 0 //create a counter | |
foreach( $xml->ONEPOST as $post ){ //create loop to process individual posts | |
if ( $i LESS THAN 1 ) { |
This file contains 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 | |
$url = 'http://thebrooklynink.tumblr.com/api/read/'; //where you can find the posts | |
$xml = simplexml_load_file($url); //parse the tumblr API to get an object containing all of your posts | |
$i = 0; //create a counter | |
foreach( $xml->posts->post as $post ){ //create loop to process individual posts | |
if ( $i < 1 ) { //check that the loop hasn't run before |
This file contains 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 | |
// Adapted from the first example on: | |
// http://codex.wordpress.org/Function_Reference/get_posts | |
global $post; | |
$args = array( 'numberposts' => 1, 'category' => 17 ); | |
$video_posts = get_posts( $args ); | |
foreach( $video_posts as $post ) : setup_postdata($post); ?> | |
<?php the_content(); ?> | |
<?php endforeach; ?> |
This file contains 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 | |
/* | |
Plugin Name: Brooklyn Ink Tumblr Widget | |
Plugin URI: http://thebrooklynink.com | |
Description: A simple widget for displaying posts from a tumblr widget. | |
Author: Sam Guzik | |
Version: 1.0 | |
Author URI: http://samguzik.com | |
*/ |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Index page</title> | |
<meta name="description" content=""> | |
<link rel="stylesheet" href="http://samguzik.com/wp_lesson/wp-content/themes/basicTheme/style.css"> | |
<link rel="stylesheet" href="http://samguzik.com/wp_lesson/wp-content/themes/basicTheme/custom.css"> |
This file contains 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
<!doctype html> | |
<html lang="en-us"> | |
<head> | |
<meta charset="utf-8"> | |
<title>My Site</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains 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 | |
if ( has_post_thumbnail() ) { | |
the_post_thumbnail(); | |
} | |
?> |
This file contains 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
/* | |
Theme Name: THEME_NAME_GOES_HERE | |
Theme URI: WHERE_DOES_THE_THE_THEME_LIVE | |
Description: DESCRIBE_THE_THEME | |
Author: YOUR_NAME_SCREENAME_WORDPRESS_USERNAME_OR_SOMETHING_ELSE | |
Author URI: YOUR_URL | |
Version: VERSION | |
Tags: DESCRIPTIVE TAGS | |
License: |
This file contains 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
/* The loop starts here: | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
/* and ends here: | |
<?php endwhile; else: ?> | |
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p> | |
<?php endif; ?> |
This file contains 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
<!-- Start the Loop. --> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<!-- This gives a DIV that will go around the post. --> | |
<!-- We're giving it a specific id and classes so you can style everything. --> | |
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?> > | |
<!-- Display the Title as a link to the Post's permalink. --> | |
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> |
OlderNewer