Skip to content

Instantly share code, notes, and snippets.

@awakekat
awakekat / custom-search-form.php
Created April 3, 2017 04:13
Wordpress Custom Search Form
custom-search-form.php
============================================
<div class="content-search">
<form role="search" method="get" id="searchform" class="searchform" action="<?php echo get_site_url(); ?>">
<div>
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<?php wp_dropdown_categories( array(
@awakekat
awakekat / wp_remove_version.txt
Created March 5, 2017 03:54
Remove Version Numbers from WP
// Remove Version Numbers for everything!
remove_action('wp_head', 'wp_generator');
function sdt_remove_ver_css_js( $src, $handle )
{
$handles_with_version = [ 'style' ]; // <-- Adjust to your needs!
if ( strpos( $src, 'ver=' ) && ! in_array( $handle, $handles_with_version, true ) )
$src = remove_query_arg( 'ver', $src );
@awakekat
awakekat / body.html
Last active January 17, 2017 21:10
another parallax script but for Bootstrap
<nav class="navbar navbar-default navbar-fixed-top">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Title</a>
</div>
@awakekat
awakekat / acf-nest-repeat.txt
Created September 19, 2016 02:20
Advanced Custom Fields - Nested Repeater
<?php if( have_rows('grade_repeat') ): ?>
<?php while ( have_rows('grade_repeat') ) : the_row(); ?>
<h3><?php the_sub_field('class_level'); ?></h3>
<?php if( have_rows('class_repeater') ): ?>
<?php while( have_rows('class_repeater') ): the_row(); ?>
.parallax-background {
background-color: #0078A0;
height: 620px;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: fixed;
width: 100%;
/* Tint */
.tinted-image {
background:
/* top, transparent red, faked with gradient */
linear-gradient(
rgba(255, 0, 0, 0.45),
rgba(255, 0, 0, 0.45)
),
/* bottom image */
url(image.jpg);
<html>
<head>
<title>Tabs with only CSS</title>
<style>
.container {
width:1080px;
margin: 0 auto;
}
.tab-container input{
display:none;
@awakekat
awakekat / wpclasses.txt
Created August 13, 2016 14:17
Wordpress Style Classes
# Body Styles
.rtl {}
.home {}
.blog {}
.archive {}
.date {}
.search {}
.paged {}
.attachment {}
.error404 {}
@awakekat
awakekat / function.php
Created August 1, 2016 21:39
Register Menu in functions.php
<?php
/*
* Register Menu in functions.php
*/
add_action( 'after_setup_theme', 'register_my_menu' );
function register_my_menu() {
register_nav_menu( 'primary', __( 'Primary Menu', 'theme-slug' ) );
}