Skip to content

Instantly share code, notes, and snippets.

@bradfranklin
bradfranklin / flexbox-menu.css
Last active August 18, 2019 11:02
Wp nav menu added via function - styling with flexbox
/* Objective: Center and style a wp nav menu added
via function hook into a row using flexbox
I don't know how to code in my own classes into a function
but wp was nice enough to add their own
*/
/* Code in child theme's function.php */
@bradfranklin
bradfranklin / add-nav-to-cpt-only.php
Created August 16, 2019 19:18
Add a menu conditionally to a specific wordpress custom post type only
// Adding a menu conditionally only to a CPT to be centered below the header (for now)
//
// https://codex.wordpress.org/Function_Reference/is_post_type_archive
//
// https://www.wpbeginner.com/wp-themes/how-to-add-custom-navigation-menus-in-wordpress-3-0-themes/
function j66_menu_output_cpt_ambassador() {
$menu_cpt_ambassador .= wp_nav_menu( array(
@bradfranklin
bradfranklin / index.html
Last active May 12, 2019 22:18
Responsive post grid with a grow effect
<div class="container">
<div class="grid-row">
<div class="grid-item">
<a class="wrapping-link" href="https://thecodeteam.com/projects/rex-ray/"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top rex-ray">
<span class="centered project-image-bg rex-ray-image"></span>
</div>
<div class="grid-item-content">
@bradfranklin
bradfranklin / ios_webapp_fullscreen.php
Created February 14, 2018 07:31
Wp head - iOS - view site in full screen mode
// Wrote this a couple of weeks ago. Thought I'd share.
// Code adds "add to home screen" full screen functionality. (iOS). Not sure about android. Test project currently
// Adding meta tags, media queries via wp_head action hook
add_action( 'wp_head' , 'j66labs_addMeta' );
function j66labs_addMeta() {
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0 minimal-ui"/>';
echo '<meta name="apple-mobile-web-app-capable" content="yes"/>';
@bradfranklin
bradfranklin / template-test-results-support
Created June 20, 2017 19:11
Troubleshooting code - facetwp RESULTS page issue
<?php
/*
Template Name: Page - Test Results Support
*/
?>
<?php
global $detect;
@bradfranklin
bradfranklin / template-test-search-support
Created June 20, 2017 19:08
troubleshooting code - facetwp search page issue
<?php
/*
Template Name: Page - Test Search Support
*/
?>
<?php get_header(); ?>
<script>
function s66_fwp_redirect_test() {