Skip to content

Instantly share code, notes, and snippets.

View askwpgirl's full-sized avatar

Angela Bowman askwpgirl

View GitHub Profile
@askwpgirl
askwpgirl / nggallery.css
Created May 5, 2016 00:14
NextGEN Gallery - Single Image Gallery Linked to Lightbox
/*
CSS Name: Default Styles
Description: NextGEN Default Gallery Stylesheet
Author: Photocrati Media
Version: 2.12
This stylesheet is provided to allow users the ability of overriding the default styles for all display types
*/
/* For NextGen Gallery. Displays thumbnails on a page, and when you click each thumbnail opens it's own
@askwpgirl
askwpgirl / functions.php
Created March 19, 2019 22:24
Gutenberg Color Palette
<?php
/*-------------------------------------------------------*/
/* Gutenberg Color Palette Support
/* https://studiopress.blog/theme-color-palette/
/*-------------------------------------------------------*/
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Gold', 'askwpgirl-sample' ),
@askwpgirl
askwpgirl / style.css
Created March 19, 2019 22:26
Gutenberg Front-End Styles
/**
* Gutenberg custom color palette.
* Use in conjunction with function.
*/
.has-light-gold-color {
color: #c0a756;
}
.has-white {
@askwpgirl
askwpgirl / functions.php
Created December 7, 2019 02:59
Sample function with ACF field loaded into WooCommerce single product hook
<?php
//Paste the content below into your your child theme's functions.php file
//Do not past the <?php above
//This is your function name
function my_woo_custom_fields() {
//this stops PHP, so we can work in HTML
//replace text_field with your field
?>
@askwpgirl
askwpgirl / gist:618f982d4a91f99f74f3be1c53f49f34
Last active January 29, 2021 03:13
ACF Query for Posts with Specific Relational Field
<?php
/*
* Query posts for a relationship value.
* This method uses the meta_query LIKE to match the string "123" to the database value a:1:{i:0;s:3:"123";} (serialized array)
*/
$args = array(
'post_type' => 'doctor',
'posts_per_page' => 10,
@askwpgirl
askwpgirl / functins.php
Last active February 12, 2021 03:12
Shortcode for Loop Posts Navigation Links
<?php
// copy below to child theme's functions.php or Code Snippets plugin. Do not need leading <?php above
/*-------------------------------------------------------*/
/* Creating Shortcode for Navigation Loop
/* Requires https://wordpress.org/plugins/loop-post-navigation-links/
/* Place [loop_post_nav] shortcode in Shortcode widget in Elementor Single Post Template
/*-------------------------------------------------------*/
function loop_nav() {
@askwpgirl
askwpgirl / functions.php
Created February 15, 2021 20:00
Show Elementor Posts after today's date for events using ACF date field
<?php
//Info about custom query filters:
//https://developers.elementor.com/custom-query-filter/ combined with
// https://www.advancedcustomfields.com/resources/date-time-picker/
// The query ID goes in the Elementor Query under the Query area of the post list widget (see screenshot).
@askwpgirl
askwpgirl / functions.php
Last active May 17, 2021 21:01
Get taxonomy ACF image field in a loop for all the taxonomy terms
<?php
// Set your ACF Image field output to array in ACF Field Group
function my_tax_grid() {
$terms = get_terms( array(
'taxonomy' => 'my_taxonomy', // Swap in your custom taxonomy name
'hide_empty' => true,
'orderby' => 'name',
'order' => 'DESC'
));
@askwpgirl
askwpgirl / frontend.css
Last active August 6, 2021 16:24
Elementor Pro 3.3.1 grid styles
/* Add to Appearance > Customize > Custom CSS or your child theme's style.css file to bring back the Elementor WooCommerce product grid layouts
These were removed in Elementor Pro 3.3.3. Is fixed in Elementor Pro 3.3.4. */
@media (min-width: 1025px) {
.elementor-element.elementor-products-grid ul.products.columns-2 {
grid-template-columns: repeat(2, 1fr); }
.elementor-element.elementor-products-grid .woocommerce.columns-2 ul.products {
grid-template-columns: repeat(2, 1fr); }
.elementor-element.elementor-products-grid ul.products.columns-3 {
grid-template-columns: repeat(3, 1fr); }
@askwpgirl
askwpgirl / functions.php
Last active August 21, 2021 16:20
Sort Elementor Posts Widget posts by ACF Date Field
<?php
// Don't copy the php start code above. Copy from below.
// This uses the Elementor Custom Query Documentation for extending a post query:
// https://developers.elementor.com/custom-query-filter/
// This sorts the Elementor posts widget by an ACF date field.
// Replace my_acf_date_field with your date field.
// Put event_filter in the Query ID field of the Elementor Post widget.
add_action( 'elementor/query/event_filter', function( $query ) {