Skip to content

Instantly share code, notes, and snippets.

View sophiawzey's full-sized avatar

Sophia Zey sophiawzey

View GitHub Profile
@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 / 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 / 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 / custom-post-type.php
Created December 4, 2018 16:23
[CPT Jobs] #wordpress
// Register Custom Post Type
function careers_job_detail() {
$labels = array(
'name' => _x( 'Jobs', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Job', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Jobs', 'text_domain' ),
'name_admin_bar' => __( 'Job', 'text_domain' ),
'archives' => __( 'Job Archives', 'text_domain' ),
'attributes' => __( 'Job Attributes', 'text_domain' ),
@sophiawzey
sophiawzey / wp-config.php
Created December 12, 2018 18:18
[Getting Started: Wordpress] #wordpress
// make sure to add this line to disable the editor
define( 'DISALLOW_FILE_EDIT', true );
@sophiawzey
sophiawzey / theme-options.php
Created December 14, 2018 17:26
[ACF Theme Options] #wordpress #acf
<?php
//ACF Admin Options
if( function_exists('acf_add_options_page') ) {
acf_add_options_page([
'page_title' => 'Theme Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-settings',
'capability' => 'edit_posts',
@sophiawzey
sophiawzey / bullets.scss
Created December 18, 2018 19:25
[Font Awesome Bullet Points] #font-awesome #scss
.content li:before {
font-family: "Font Awesome 5 Pro";
content: "\f00c";
margin: 0 7px 0 -26px;
color: #9a7ba3;
}
@sophiawzey
sophiawzey / breadcrumbs.php
Created January 22, 2019 21:00
[breadcrumbs] #php #wordpress #needswork
<?php
// Breadcrumbs
function custom_breadcrumbs() {
// Settings
$separator = '|';
$breadcrums_id = 'breadcrumbs';
$breadcrums_class = 'breadcrumbs';
@sophiawzey
sophiawzey / share-buttons.php
Last active February 27, 2020 18:47
[social share]
<?php
/**
* Social Share buttons
*/
$actual_link = urlencode( (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
$title = get_the_title();
?>
<div class="share-buttons">
@sophiawzey
sophiawzey / lozad.php
Last active August 16, 2019 15:03
[lozad stuff]
<?php
$image = get_field( 'image' );
if ( ! empty( $image ) ) {
// thumbnail
$size = 'medium';
$thumb = $image['sizes'][ $size ];
} else {
$thumb = '/wp-content/themes/topfloor-parcel/assets/images/placeholder.png';
} ?>