Skip to content

Instantly share code, notes, and snippets.

View lukecav's full-sized avatar
🪨
Words of encouragement

Luke Cavanagh lukecav

🪨
Words of encouragement
View GitHub Profile
@lukecav
lukecav / webpack.js
Created November 24, 2015 19:35 — forked from sokra/webpack.js
// webpack is a module bundler
// This means webpack takes modules with dependencies
// and emits static assets representing those modules.
// dependencies can be written in CommonJs
var commonjs = require("./commonjs");
// or in AMD
define(["amd-module", "../file"], function(amdModule, file) {
// while previous constructs are sync
// this is async
@lukecav
lukecav / gist:a8c42d9ad376d93979a2
Created December 29, 2015 19:00
H2 and H3 Centered in Specific Colors for Homepage only
/* H3 and H2 Text Centered Homepage
------------------------- */
.page-id-10 h2 {
color: #AB1F24;
text-align: center;
}
.page-id-10 h3 {
color: #585858;
text-align: center;
}
@lukecav
lukecav / gist:cc391d22659c5cfa25f0
Last active December 30, 2015 20:46
Divi Slider Left Allign
.et_pb_slide {
padding: 0!important;
}
.et_pb_slide_description, .et_pb_slider_fullwidth_off .et_pb_slide_description {
margin-left: 0px!important;
text-align: right!important;
}
@lukecav
lukecav / gist:6bbd6377620f10e49b38
Created December 28, 2015 21:48
Footer Divi Theme Child
<?php if ( 'on' == et_get_option( 'divi_back_to_top', 'false' ) ) : ?>
<span class="et_pb_scroll_top et-pb-icon"></span>
<?php endif;
if ( ! is_page_template( 'page-template-blank.php' ) ) : ?>
<footer id="main-footer">
<?php get_sidebar( 'footer' ); ?>
@lukecav
lukecav / gist:cd63c5f306b843b2beaf
Created December 28, 2015 18:37
Widget Title Color
/* Widget Title Color
------------------------- */
h4.widgettitle {
color: #AB1F24;
font-weight: bold;
}
@lukecav
lukecav / gist:5810709fbcf9e6556736
Created January 4, 2016 21:35
Divi Theme no space between sections
/* No Space Between Sections */
.et_pb_section{
padding-top: 0px !important;
}
@lukecav
lukecav / gist:e998fece1d94e00e74a0
Created December 15, 2015 22:31
Divi Theme Logo Menu Issue
.container.clearfix.et_menu_container {
height: 140px;
}
.et_fixed_nav #logo {
max-height: 150px;
}
.et-fixed-header #logo {
max-height: 45px;
}
@lukecav
lukecav / gist:f97df4f8b9df4cc060ad
Created January 5, 2016 17:51
social_icons.php
<ul class="et-social-icons">
<?php if ( 'on' === et_get_option( 'divi_show_facebook_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-facebook">
<a href="<?php echo esc_url( et_get_option( 'divi_facebook_url', '#' ) ); ?>" class="icon">
<span><?php esc_html_e( 'Facebook', 'Divi' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( 'on' === et_get_option( 'divi_show_twitter_icon', 'on' ) ) : ?>
@lukecav
lukecav / gist:31a0b9baad57af7cc248
Created January 5, 2016 18:03
No Gap Betweeen Modules
/* No Gap Between Modules
------------------------- */
.no-gap .et_pb_column_1_2 {
margin-right: 0;
width: 540px;
}
.no-gap .et_pb_column_1_3 {
margin-right: 0;
width: 360px;
}
@lukecav
lukecav / gist:c55c0ec4fb1b357eb9cb
Created January 15, 2016 22:09
CPT on Blog Module
Ok, open up includes/builder/main-modules.php, and on line 10908 replace this code
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
and replace it with
<h2 class="entry-title"><a href="<?php if ( ( $myurl = get_post_meta( get_the_ID(), 'myurl', true) ) && $myurl<> '' ){
echo $myurl;} else { the_permalink();} ?>"><?php the_title(); ?></a></h2>
Now you can use custom field with the name myurl.
This should redirect the titles of your blog items to custom URL that you can define via myurl custom link. let me know the result