Skip to content

Instantly share code, notes, and snippets.

View bonjmartn's full-sized avatar
🏠
Working from home

Bonnie Martin bonjmartn

🏠
Working from home
View GitHub Profile
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
</div>
function theme_styles() {
wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/css/bootstrap-3.3.7.css' );
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'theme_styles');
function theme_js() {
function theme_styles() {
wp_enqueue_style( 'bootstrap_css', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css' );
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'theme_styles');
function theme_js() {
function theme_styles() {
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'theme_styles');
function theme_js() {
global $wp_scripts;
/* THIS IS THE CLASS THAT IS APPLIED TO THE UNORDERED LIST AND ACTS AS THE FLEX CONTAINER */
.grid-wrap {
display: flex; /* THIS MAKES IT A FLEX CONTAINER */
flex-flow: row wrap; /* THIS MAKES EACH BLOG POST LINE UP HORIZONTALLY AND WRAP TO THE NEXT LINE */
align-items: center; /* YOU CAN CHOOSE DIFFERENT VALUES HERE */
justify-content: center; /* YOU CAN CHOOSE DIFFERENT VALUES HERE */
list-style: none; /* THIS REMOVES THE BULLET POINT FOR EACH LIST ITEM */
}
<!-- START OF THE FLEX CONTAINER, THE UNORDERED LIST -->
<ul class="grid-wrap">
<!-- WP LOOP STARTS HERE -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- LIST ITEM FOR EACH POST -->
<li class="grid-item">
<!-- FEATURED IMAGE FOR THE POST -->
@bonjmartn
bonjmartn / recipe-functions.php
Created June 18, 2016 23:48
Recipe Functions
// Create Recipe Post Type
add_action('init', 'my_post_type_maker');
function my_post_type_maker() {
$args = array(
/*your custom post type arguments here*/
'labels' => array(
'name' => __( 'Recipes' ),
'singular_name' => __( 'Recipe' )
),
'public' => true,
@bonjmartn
bonjmartn / carousel-html-wp.html
Created June 18, 2016 23:14
Bootstrap Carousel with WP Customizer Choices
@bonjmartn
bonjmartn / slide1.php
Created June 18, 2016 23:12
WordPress Customizer Code for Slide 1
// Slide 1 Image
$wp_customize->add_section( 'slide_1' , array(
'title' => __('Slide 1','manly-recipes'),
'panel' => 'carousel_settings',
'priority' => 20
) );
$wp_customize->add_setting(
'slide_1_img',
@bonjmartn
bonjmartn / gist:7f72c52904cad68e20950821311d0a1d
Created June 18, 2016 23:04
Basic Bootstrap Carousel HTML
<!-- Carousel
================================================== -->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">