View php-pdo-mysql-crud.md

Basic CRUD operations with PDO

CRUD = Create, Read, Update, Delete

Open a database connection

$host = '127.0.0.1';
$dbname = 'test';
$username = 'root';
View functions.php
//Forged Settings
function forged_settings_add_options(){
add_options_page( 'Forged Settings', 'Forged Settings', 'manage_options', 'forged-settings', 'forged_settings_page');
}
add_action( 'admin_menu', 'forged_settings_add_options');
//Create Forged Settings Submenu
function forged_settings_page(){ ?>
<div class = "wrap">
<h1>Forged Theme Settings</h1>
View osx_setup.md

Mac OSX Bootstrap

Upgrade to Mavericks

  1. Install Mavericks via the App Store.

Secure The Machine

View page.php
<?php get_header(); ?>
<?php
$args = array(
'post_type' => 'your_post',
);
$your_loop = new WP_Query( $args ); if ( $your_loop->have_posts() ) : while ( $your_loop->have_posts() ) : $your_loop->the_post();
$meta = get_post_meta( $post->ID, 'your_fields', true ); ?>
View functions.php
<?php
function create_post_your_post() {
register_post_type( 'your_post',
array(
'labels' => array(
'name' => __( 'Your Post' ),
),
'public' => true,
'hierarchical' => true,
View escape-html.php
<?php
// Escape HTML in <code> or <pre><code> tags.
function escapeHTML($arr) {
if (version_compare(PHP_VERSION, '5.2.3') >= 0) {
$output = htmlspecialchars($arr[2], ENT_NOQUOTES, get_bloginfo('charset'), false);
}
else {
$specialChars = array(
View example.scss
// Variables
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
View dan.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Instafeed</title>
<style>
body {
margin: 0;
padding: 0;
View inline-mixin.scss
@mixin inline-block-lr($container,$left,$right){
#{$container}{
text-align: justify;
&:after{
content: '';
display: inline-block;
width: 100%;
height: 0;
font-size:0;
View active-scroll.js
$(document).ready(function () {
$(document).on("scroll", onScroll);
// Smooth scroll
$('a[href^="#"]').on('click', function (e) {
e.preventDefault();
$(document).off("scroll");
$('a').each(function () {
$(this).removeClass('active');
})