Skip to content

Instantly share code, notes, and snippets.

View TomFrearson's full-sized avatar

Tom Frearson TomFrearson

View GitHub Profile
<?php
/**
* Set blog, index, archive & post thumbnail sizes
*/
/* Blog */
function wpt_blog_thumbnail_width( $width ) {
return 150; //blog thumbnail width in pixels
}
add_filter( 'et_pb_blog_image_width', 'wpt_blog_thumbnail_width');
@TomFrearson
TomFrearson / single.php
Last active October 8, 2017 20:55
Divi single post/page file
<?php get_header(); ?>
<div id="main-content">
<div class="container">
<div id="content-area" class="clearfix">
<div id="left-area">
<?php while ( have_posts() ) : the_post(); ?>
<?php if (et_get_option('divi_integration_single_top') <> '' && et_get_option('divi_integrate_singletop_enable') == 'on') echo(et_get_option('divi_integration_single_top')); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'et_pb_post' ); ?>>
@TomFrearson
TomFrearson / divi-custom-blog-shortcode.php
Last active June 15, 2017 06:41
Shortcode to customise the size of the images for Divi's pagebuilder blog module
<?php
function remove_et_pb_blog() {
remove_shortcode( 'et_pb_blog', 'et_pb_blog' );
add_shortcode( 'et_pb_blog', 'wpt_pb_blog' );
}
add_action( 'init', 'remove_et_pb_blog' );
function wpt_pb_blog( $atts ) {
extract( shortcode_atts( array(
@TomFrearson
TomFrearson / functions.php
Last active August 29, 2015 13:57
Code to insert AWeber signup form into WooThemes' Subscribe and Connect feature from an external file. Code checks that neither the Feedburner or MailChimp URL's have been set before inserting the AWeber form.
<?php
/*-----------------------------------------------------------------------------------*/
/* Subscribe / Connect */
/*-----------------------------------------------------------------------------------*/
if (!function_exists('woo_subscribe_connect')) {
function woo_subscribe_connect($widget = 'false', $title = '', $form = '', $social = '') {
//Setup default variables, overriding them if the "Theme Options" have been saved.