Skip to content

Instantly share code, notes, and snippets.

View sophiawzey's full-sized avatar

Sophia Zey sophiawzey

View GitHub Profile
@sophiawzey
sophiawzey / case-study-listing.php
Created November 30, 2018 21:55
[Case Study Listing] #wordpress
<?php
// just the listing part
$args = array(
'post_type' => 'case-study',
'posts_per_page' => - 1,
'order' => 'ASC',
'orderby' => 'menu_order'
);
@sophiawzey
sophiawzey / case-study.php
Last active December 4, 2018 16:13
[Custom Post Type: Case Study] Custom Post type #cpt
// Register Custom Post Type
function case_study() {
$labels = array(
'name' => _x( 'Case Studies', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Case Study', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Case Studies', 'text_domain' ),
'name_admin_bar' => __( 'Case Study', 'text_domain' ),
'archives' => __( 'Case Studies', 'text_domain' ),
'attributes' => __( 'Item Attributes', 'text_domain' ),
@sophiawzey
sophiawzey / banner-solid.php
Last active November 30, 2018 20:19
[Banner Solid] #wordpress
<?php
/**
* used in xyz.php
* NOTES: I might swap this out for the one using acf title and intro body copy
*/
?>
<header class="banner banner-solid">
<div class="grid-container">
<h1 class="banner__title text-center"><?php the_title(); ?></h1>
</div>
@sophiawzey
sophiawzey / custom-post-type-news.php
Last active December 4, 2018 16:12
[Custom Post TYpe custom slug] #cpt #wordpress
// Register Custom Post Type
function news_detail() {
$labels = array(
'name' => _x( 'News & Events', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'News & Events', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'News & Events', 'text_domain' ),
'name_admin_bar' => __( 'News & Events', 'text_domain' ),
@sophiawzey
sophiawzey / content-top-level-listing.php
Last active November 29, 2018 20:29
[Top Level Listing Logic] #wordpress
<?php
/**
* Template part for displaying page content in page-top-level-listing.php
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( '' ); ?> role="article" itemscope
itemtype="http://schema.org/WebPage">
<?php get_template_part('parts/breadcrumbs'); ?>
@sophiawzey
sophiawzey / addons.php
Last active December 31, 2018 17:00
[Related Children] get the related children and exclude current post #wordpress
// count for wpquery, goes here
$the_query = new WP_Query( $args );
$count = $the_query->found_posts;
// then inside of the content
if ( $count > 2 ) {
echo '<div id="np-slider-three" class="np-slider">';
} else {
echo '<div class="grid-x grid-margin-x medium-up-3">';
};
@sophiawzey
sophiawzey / news_events.php
Last active December 4, 2018 16:12
[Custom Post Type News & Events ] #wordpress #cpt
// Register Custom Post Type
function custom_news_events() {
$labels = array(
'name' => _x( 'News & Events', 'Post Type General Name', 'news_events_text_domain' ),
'singular_name' => _x( 'News/Event', 'Post Type Singular Name', 'news_events_text_domain' ),
'menu_name' => __( 'News & Events', 'news_events_text_domain' ),
'name_admin_bar' => __( 'News & Events', 'news_events_text_domain' ),
'archives' => __( 'News & Event Archives', 'news_events_text_domain' ),
@sophiawzey
sophiawzey / testimonials.php
Last active December 4, 2018 16:12
[Custom Post Type Testimonials ] #wordpress #cpt
// Register testimonials
function custom_testimonials() {
$labels = array(
'name' => _x( 'Testimonials', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Testimonial', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Testimonials', 'text_domain' ),
'name_admin_bar' => __( 'Testimonials', 'text_domain' ),
'archives' => __( 'Testimonial Archives', 'text_domain' ),
@sophiawzey
sophiawzey / styles.scss
Last active June 27, 2019 20:48
[General SCSS] styling I always use in jointswp #foundation #scss
html {
scroll-behavior: smooth;
}
section {
padding: 3rem 0;
}
.grid-container {
width: 100%;
@media (min-width: 1500px) {
@sophiawzey
sophiawzey / _slider.scss
Last active November 29, 2018 18:22
[Slick Slider] using the slick slider
/* change class to theme name initials - slider. change color to primary or secondary?
*/
.tf-slider {
display: flex;
align-items: center;
text-align: center;
&__circle-border {
border: 2px solid $primary;
border-radius: 46px;