###Custom Post Types
function codex_custom_init() {
$labels = array(
'name' => 'Books',
'singular_name' => 'Book',
'add_new' => 'Add New',
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
/** | |
* Display category image on category archive | |
*/ | |
add_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 ); | |
function woocommerce_category_image() { | |
if ( is_product_category() ){ | |
global $wp_query; | |
$cat = $wp_query->get_queried_object(); | |
$thumbnail_id = get_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
$image = wp_get_attachment_url( $thumbnail_id ); |
/* To use this example: | |
1. Download this html file | |
2. Replace the form action url with your own from the MailChimp supplied embed code | |
3. Within the action url, replace "subscribe/post" with "subscribe/post-json" | |
4. Be sure the action url starts with http://. If it doesn't, the form will hang when testing the html as a local file in your browser. | |
5. Open this file in a browser on your local machine | |
*/ | |
<?php | |
// add the below to your functions file | |
// then visit the page that you want to see | |
// the enqueued scripts and stylesheets for | |
function se_inspect_styles() { | |
global $wp_styles; | |
echo "<h2>Enqueued CSS Stylesheets</h2><ul>"; | |
foreach( $wp_styles->queue as $handle ) : | |
echo "<li>" . $handle . "</li>"; |
// Load the theme stylesheets | |
function theme_styles() | |
{ | |
// Example of loading a jQuery slideshow plugin just on the homepage | |
wp_register_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' ); | |
// Load all of the styles that need to appear on all pages | |
wp_enqueue_style( 'main', get_template_directory_uri() . '/style.css' ); |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Mautic Form Test</title> | |
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
@media screen and (min-width: 768px) { | |
.site-header .site-branding, .site-header .site-logo-anchor, .site-header .site-logo-link, .site-header .custom-logo-link { | |
width: 21%; /* Adjust this percentage up or down to make the logo larger or smaller. */ | |
} | |
} |
$wp_customize->add_setting( 'core_color_setting_id', array( | |
'sanitize_callback' => 'themeslug_sanitize_hex_color', | |
) ); | |
$wp_customize->add_control( | |
new WP_Customize_Color_Control( $wp_customize, 'core_color_setting_id', | |
array( | |
'label' => __( 'Core Color Setting' ), | |
'description' => __( 'Select a color for something' ), | |
'section' => 'custom_section', // Add a default or your own section |
###Custom Post Types
function codex_custom_init() {
$labels = array(
'name' => 'Books',
'singular_name' => 'Book',
'add_new' => 'Add New',
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0-modified | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |