Skip to content

Instantly share code, notes, and snippets.

View renventura's full-sized avatar

Ren Ventura renventura

View GitHub Profile
@renventura
renventura / jetpack-social-buttons-css
Last active October 7, 2016 21:22
Jetpack Social Share Buttons CSS
div.sharedaddy div.sd-block {
border-top: 1px solid rgba(0,0,0,0.13);
border-top-width: 1px;
border-top-style: solid;
border-top-color: rgba(0,0,0,0.13);
padding: 0;
}
.single-format-quote div.sharedaddy div.sd-block {
display: none;
@renventura
renventura / custom-fields-inside-shortcode.php
Last active October 19, 2016 13:46
Insert Custom Fields into WordPress Shortcode
<?php //* Mind this opening PHP tag
/**
* This snippet will take a custom field and add its data to a shortcode.
* In this example, we are adding a few WooCommerce products before the content of a Genesis theme.
* The code is taking the product IDs entered in the home page's edit panel and dynamically inserting
* them into a WooCommerce shortcode, which then outputs the products with those IDs.
*
* Read more about this example and the process of adding custom fields into shortcodes at EngageWP.com
* http://www.engagewp.com/how-to-insert-custom-fields-into-shortcodes
@renventura
renventura / remove-genesis-cpt-archive-content.php
Last active November 16, 2018 06:34
Remove content excerpt from custom post type archive in Genesis
<?php //* Mind this opening php tag
/**
* EngageWP.com
* Remove content excerpt from custom post type archive in Genesis
*/
//* Grab the content for each custom post type
add_action( 'genesis_before_loop', 'rv_cpt_excerpts' );
function rv_cpt_excerpts() {
@renventura
renventura / remove-divi-project-post-type.php
Last active November 27, 2022 02:07
Remove the Projects Post Type from Divi by Elegant Themes
<?php //* Mind this opening php tag
/**
* This will hide the Divi "Project" post type.
* Thanks to georgiee (https://gist.github.com/EngageWP/062edef103469b1177bc#gistcomment-1801080) for his improved solution.
*/
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 );
function mytheme_et_project_posttype_args( $args ) {
return array_merge( $args, array(
'public' => false,
<?php //* Mind this opening php tag
//* Remove Post Info, Post Meta from CPT
add_action ( 'get_header', 'rv_cpt_remove_post_info_genesis' );
function rv_cpt_remove_post_info_genesis() {
if ( 'post' !== get_post_type() ) {
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
}
}
@renventura
renventura / remove-categories-blog-index.php
Created September 10, 2014 18:01
Remove Specific Post Categories from the Blog Index
<?php //* mind this opening php tag
//* Exclude categories from blog page
add_filter('pre_get_posts', 'rv_exclude_blog_categories');
function rv_exclude_blog_categories($query) {
if ($query->is_home) {
$query->set('cat', '-1,-2,-3'); //Replace with your category numbers (keep negative signs)
}
return $query;
}
@renventura
renventura / block-admin-login-memberpress-login-form.php
Last active February 28, 2017 22:24
Prevent Administrative Admin Login from the MemberPress Login Form
<?php //* mind this opening php tag
/**
* Snippet provided by MemberPress support and modified by Ren Ventura
**/
//* Kick admins out from MemberPress login form
add_filter( 'mepr-validate-login', 'kick_out_admins' );
function kick_out_admins( $errors ) {
@renventura
renventura / reassign-admin-comments.php
Created September 10, 2014 18:18
Reassign Admin Comments to an Author
<?php //* mind this opening php tag
//* Make Admin Comments Become Author Comments
add_filter( 'preprocess_comment', 'rv_admin_comments_to_author_comments' );
function rv_admin_comments_to_author_comments( $comment_data ) {
if ( $comment_data['user_ID'] == 1 ) { // Change 1 to your admin ID
$comment_data['user_ID'] = 8; // Change 8 to your Author ID
$comment_data['comment_author'] = 'Your Name'; // Enter the name you want to appear in comments
@renventura
renventura / display-updated-post-date-genesis.php
Last active February 13, 2020 23:11
Display the Date a Post Was Updated in the Genesis Framework
<?php //* mind this opening php tag
/**
* Display Last Updated date if a post has been updated (Genesis Framework)
*/
add_filter( 'genesis_post_info', 'rv_post_info_filter' );
function rv_post_info_filter( $post_info ) {
global $post;
@renventura
renventura / list-hooked-functions.php
Last active November 6, 2022 18:23
List All Currently Hooked WordPress Functions
<?php //* mind this opening php tag
/**
* This snippet returns a list of all currently hooked functions.
* It is set up to output this data on a specific page. Do not output this data publicly.
* Use this snippet for debugging/testing/development.
* Source: http://www.rarst.net/wordpress/debug-wordpress-hooks/
* Modified by Ren Ventura, EngageWP.com
**/