Skip to content

Instantly share code, notes, and snippets.

View askwpgirl's full-sized avatar

Angela Bowman askwpgirl

View GitHub Profile
@askwpgirl
askwpgirl / style.css
Last active July 12, 2023 18:47
Elementor - Custom Category Background Colors on Post Grid
/* See https://www.loom.com/share/eb7a5707d8b44038bde7886e3902ec11?sid=383b1a08-b755-4544-b372-446303907c48 for demo
See screeshot for HTML markup exmaple. This demo uses a custom loop.
https://www.evernote.com/shard/s20/sh/58ecb810-ad20-4b7c-84ac-17bb1dc94131/nliYiy0GKhDSkf-C-qOJUtYEymkTimGaVNc1PG_qaDajEPBuQPKBVSZGsA
*/
/* You can place this code under Appearance > Customize or in your child theme's style.css file */
/* category-blue, category-red, category-green are the names of the categories.
If your category name is "breakfast" then you would use category-breakfast instead.
@askwpgirl
askwpgirl / style.css
Last active March 17, 2022 19:07
Global Styles for The Events Calendar to Override Elementor Site Settings for hyperlinks and buttons
/* Global TEC Styles to override Elementor global button and hyperlink styles */
.tribe-events button,
.tribe-events-page-template button {
background-color: transparent !important;
color: #141827 !important; /* Change color to match your theme */
border: none !important;
}
.tribe-events a,
@askwpgirl
askwpgirl / functions.php
Last active December 14, 2021 18:31
Elementor Custom Query for Relationship
<?php
// Extends the Elementor Post Wiget query. Must set the widget query to get Property posts.
// This will get property posts that match the ID of the agent in the Property's ACF relational field.
// This only works on the agent's single post template
add_action( 'elementor/query/agent_related_properties', function( $query ) {
// Get the agent's ID from the main query.
global $post;
@askwpgirl
askwpgirl / style.css
Last active March 5, 2024 05:56
Elementor Custom CSS for Every Site
/* Spacing for lists */
.elementor-widget-text-editor ul,
.elementor-widget-text-editor ol {
padding: 0 0 0 20px; /* Change this number to match the size of your body font */
margin: 0;
}
.elementor-widget-text-editor ul li,
.elementor-widget-text-editor ol li {
@askwpgirl
askwpgirl / style.css
Created August 21, 2021 16:19
Align Elementor icons in Icon List Widget to the top rather than center of the text
/* In your Icon List, go to Advanced tab and add the following Custom CSS class:
my-icon-list
Then, in the Custom CSS area, add this CSS: */
.elementor-widget.my-icon-list .elementor-icon-list-item, .elementor-widget.my-icon-list .elementor-icon-list-item a{
-webkit-box-align: start;
-ms-flex-align: start;
align-items: start;
}
@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 ) {
@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 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 / 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 / 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() {