Skip to content

Instantly share code, notes, and snippets.

View melissajclark's full-sized avatar

Melissa Jean Clark melissajclark

View GitHub Profile
I AM A GIST!!!!
(thanks for the advice Asaf!!!!!)
@melissajclark
melissajclark / pagination.php
Created August 31, 2015 18:25
Single project pagination
<nav class="pagination clearfix singleProjectPagination">
<div class="paginationPreviousProject"><?php previous_post_link( '%link', __( 'Previous Project', 'theme-name' ) ); ?></div>
<?php if ( get_field('projects_page_link', 'options') ) : ?>
<div class="paginationAllProjects">
<a href="<?php the_field('projects_page_link', 'options'); ?>"><?php _e('Back to Projects', 'theme-name'); ?></a>
</div>
<?php endif; ?>
<div class="paginationNextProject"><?php next_post_link( '%link', __( 'Next Project', 'theme-name' ) ); ?></div>
</nav><!-- .pagination -->
<?php
/**
* Controlling the class on an article in the WordPress loop
* Notes:
*
* <?php post_class(); ?> - this outputs the WordPress generated class for categories
* You can add classes by adding them inside this function. It will still output the WordPress classes
*
*/
?>
@melissajclark
melissajclark / style.css
Created April 13, 2016 13:45
CSS for Simply Nicole's website
/* This will style the default page titles just like the category page titles */
.page .entry-title {
font-size: 13px;
letter-spacing: 1px;
color: #ffffff;
background-color: #000000;
margin-bottom: 0px;
padding: 5px 0px;
text-align: center;
@melissajclark
melissajclark / hero.php
Last active May 12, 2016 14:59
Random Hero Image Example
<?php
$images = get_field('hero_home_images');
if( $images ):
shuffle($images); // randomizes the image array
$max = 1; // set the max here;
$count = 0; // current count
?>
<?php
foreach( $images as $image ):
$count++; // increment count
@melissajclark
melissajclark / header.php
Last active June 14, 2016 17:41
Example - different header for pages.
<?php // Reference: https://codex.wordpress.org/Conditional_Tags
// Use conditional PHP tags to ouput different content based on the template in use?>
<?php if ( is_page ) ) : // check if we are on a page ?>
<?php // code here for display on pages ?>
<?php else : // code below runs if we are NOT on a page ?>
<?php // code here displays on anything that is NOT a page ?>
@melissajclark
melissajclark / woocommerce.php
Created April 3, 2017 15:57
woocommerce page with sections for product categories
<?php
/**
* The WooCommerce Template
*
* This is the template that displays all WooCommerce pages by default.
*
* @package THEMENAME
*/
get_header(); ?>
@melissajclark
melissajclark / custom taxonomy
Created April 20, 2017 15:21
taxonomy example
/**
*
* Register Line Sizes Taxonomy
*
**/
function trends_line_sizes_taxonomy() {
$labels = array(
"name" => __( 'Line Sizes', 'trends'),
@melissajclark
melissajclark / remodal.php
Last active July 11, 2017 14:28
Remodal example
<?php $modalID = basename(get_permalink()); ?>
<div class="teamMember">
<?php the_post_thumbnail('teamMember'); ?>
<h4><?php the_title(); ?></h4>
<a href="#<?php echo $modalID;?>"><?php _e('Read Bio', 'wp-theme-name'); ?></a>
<div class="remodal teamMemberBio" data-remodal-id="<?php echo $modalID;?>">
<button data-remodal-action="close" class="remodal-close"></button>
@melissajclark
melissajclark / woocommerce.php
Last active May 26, 2019 16:34
Customize WooCommerce email to show membership card
<?php
/**
*
* Template: customer-completed-order.php
*
* Customize the email to include a member card.
*
* @link https://businessbloomer.com/woocommerce-check-product-id-order/
*
*/