Skip to content

Instantly share code, notes, and snippets.

View sophiawzey's full-sized avatar

Sophia Zey sophiawzey

View GitHub Profile
@sophiawzey
sophiawzey / count.php
Last active June 2, 2020 18:42
[ACF PHP] using brackets #acf
<?php $count = count( get_field( 'field-name' ) ); ?> // can be used for counting rows in a repeater. works well w/ slick slider if you only want a slider on > 2 counts
@sophiawzey
sophiawzey / _breadcrumbs.scss
Last active November 29, 2018 18:50
[Breadcrumbs] from breadcrumbnavxt plugin #wordpress
.breadcrumbs {
background: $very-light-gray; // swap this out
padding: .55rem 0 0.7rem;
margin: 0;
}
@sophiawzey
sophiawzey / _banner.scss
Created November 29, 2018 18:17
[Banner] Normal Banner #acf
.banner {
min-height: 200px;
text-align: left;
display: flex;
align-items: center;
padding: 3rem 0;
&__title, &__body {
color: #fff;
}
@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;
@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 / 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 / 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 / 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 / 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 / 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' ),