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 | |
// square cropping logic on lines 56-70 | |
// header has the authentication, DB connection and doctype! | |
require('admin-header.php'); | |
//begin upload parser | |
if($_POST['did_upload']){ | |
//the folder where uploads will be saved | |
$upload_directory = '../uploads'; |
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
function debug_to_console( $data ) { | |
if ( is_array( $data ) ) | |
$output = "<script>console.log( 'Debug Objects: " . implode( ',', $data) . "' );</script>"; | |
else | |
$output = "<script>console.log( 'Debug Objects: " . $data . "' );</script>"; | |
echo $output; | |
} |
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: Media Upload Widget | |
* Plugin URI: http://wordpress.melissacabral.com | |
* Description: A widget that allows you to upload media from a widget | |
* Version: 1.0 | |
* Author: Melissa Cabral | |
* Author URI: http://wordpress.melissacabral.com | |
* License: GPLv3 | |
*/ |
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 | |
$page_for_posts = get_option('page_for_posts'); | |
if( is_home() && $page_for_posts ) : | |
echo get_the_post_thumbnail($page_for_posts, 'medium'); | |
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
<?php | |
function rad_register_widget(){ | |
register_widget('Rad_Simple_Widget'); | |
} | |
add_action('widgets_init', 'rad_register_widget'); | |
//our new widget is a copy of the WP_Widget object class | |
class Rad_Simple_Widget extends WP_Widget{ | |
function __construct(){ |
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 | |
add_action( 'wp_enqueue_scripts', 'mytheme_scripts' ); | |
/** | |
* Enqueue Dashicons style for frontend use | |
*/ | |
function mytheme_scripts() { | |
wp_enqueue_style( 'dashicons' ); | |
} |
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
@charset "utf-8"; | |
/* CSS Document */ | |
#rad-slider { | |
position: relative; | |
list-style: none; | |
overflow: hidden; | |
width: 100%; | |
padding: 0; | |
margin: 0; | |
max-width:1120px; |
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
<aside id="complementary"> | |
<?php | |
//get the titles of the most popular (by number of comments) 5 published posts | |
$query_popular = 'SELECT posts.title, posts.post_id, COUNT(*) AS numcomments | |
FROM posts, comments | |
WHERE posts.is_published = 1 | |
AND posts.post_id = comments.post_id | |
GROUP BY posts.post_id | |
ORDER BY numcomments DESC |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>Pure CSS Dropdowns</title> | |
<link href="css/reset.css" rel="stylesheet" type="text/css"> | |
<link href="css/style.css" rel="stylesheet" type="text/css"> | |
</head> | |
<body> |
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 | |
/* | |
Template Name: Automagic Sitemap | |
Will automatically generate a sitemap from the wordpress database of posts, pages, and categories. | |
*/ | |
?> | |
<?php get_header(); ?> | |
<div id="content"> |