Skip to content

Instantly share code, notes, and snippets.

View cesgarma's full-sized avatar

cesgarma

View GitHub Profile
@cesgarma
cesgarma / functions.php
Created August 24, 2020 21:48
Integration with sendinblue.com from contact form 7.
<?php
/**
*
* SendInBlue integration with Contact Form 7
*
*/
// SendInBlue API KEY
@cesgarma
cesgarma / script.html
Created August 17, 2020 21:35
To add a Divi popup use the plugin: https://wordpress.org/plugins/popups-for-divi/ If you want to enable to pop up to auto trigger after a certain amount of time add this to a "Code" module inside the pop-up. The #get-newsletter is the ID of the po
<script>
window.setTimeout(function(){
DiviArea.show('get-newsletter')
}, 3000);
</script>
.img-class {
width: 200px;
height: 230px;
object-fit: cover;
object-position: top;
}
@cesgarma
cesgarma / styles.css
Last active August 12, 2020 00:12
Replace regular bullet points in lists with an icon. This example uses WordPress 'dashicons' font. Make sure you have it loaded on your website. All the icons are here: [https://developer.wordpress.org/resource/dashicons/#yes](url) 1. Put a custom-
.custom-class-name ul
{
list-style-type: none;
}
.custom-class-name ul li
{
text-indent: -1.4em;
margin-bottom: 10px;
}
@cesgarma
cesgarma / functions.php
Created June 29, 2020 18:25
Adding Schema to web pages.
/* Add Schema to HTML head on DIVI Theme only!!! */
add_action('et_head_meta', 'custom_schema_json');
function custom_schema_json () {
$schema = get_post_meta(get_the_ID(), 'schema_field', true);
if(!empty($schema)) {
echo $schema;
}
}
@cesgarma
cesgarma / functions.php
Created April 21, 2020 04:38
https://elizabethfreemanweb.com/how-to-add-google-structured-data-to-wordpress-menus/ Wanted result in HTML <span itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> <ul id="menu-main" class="nav"> <li class="menu-main"
<?php
/* Add the following to the Theme header.php (typically) */
<nav itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement" role="navigation">
wp_nav_menu(['theme_location' => 'primary_navigation', 'walker' => MyNavWalker(), 'menu_class' => 'nav']);
</nav
/* Add this to the functions.php . This adds the 'url' attribute to every <a> link in the menu */
function add_menu_attributes( $atts, $item, $args ) {
$atts['itemprop'] = 'url';
@cesgarma
cesgarma / receipt.css
Last active December 2, 2022 16:53
The OpenPOS topbeer.mx Receipt template. Store here just in case.
h1{
font-size: 1.5em;
color: #000;
}
h2{font-size: .9em;}
h3{
font-size: 1.2em;
font-weight: 300;
line-height: 2em;
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'Divi-style', get_template_directory_uri() . '/style.css' );
}
@cesgarma
cesgarma / menu_cta.css
Created October 12, 2018 22:41
Make a Divi menu item a Call to action button instead. The CSS assumes that the menu element is a "link" and the CSS ID is "join"
/*-----------------[CTA Menu Item]----------------*/
/* style the get started cta button */
.join {
border-radius: 0px;
}
.join a {
color: #fff!important;
}
@cesgarma
cesgarma / logo.css
Created October 12, 2018 22:41
Enlarge the Logo on top of secondary menu and even below to the content.
/* Resizing Logo and modifying z-index to be rendered on top of everything else */
#top-header {z-index: 99999;}
@media only screen and (max-width: 980px) {
#logo {
min-height: 100px;
}
}
@media only screen and (min-width: 981px) {
#logo {
min-height: 120px;