Skip to content

Instantly share code, notes, and snippets.

View mikeyarce's full-sized avatar

Mikey Arce mikeyarce

View GitHub Profile
function marce_allow_pages_for_relatedposts( $enabled )
{
if ( is_page() ) {
$enabled = true;
}
return $enabled;
}
add_filter( 'jetpack_relatedposts_filter_enabled_for_request', 'marce_allow_pages_for_relatedposts' );
@mikeyarce
mikeyarce / move-jp-testimonials.php
Created June 5, 2015 15:42
Move Jetpack's Testimonials into a custom Panel in the Customizer
// If you haven't already, make sure you add theme support for Jetpack Testimonials
add_theme_support( 'jetpack-testimonial' );
//Now we will set the panel for the Testimonials to our custom panel
function marce_customize_register( $wp_customize ) {
$wp_customize->get_section( 'jetpack_testimonials' )->panel = 'my_panel';
}
@mikeyarce
mikeyarce / 1-functions.php
Last active August 29, 2015 14:23
Jetpack's Featured Content
// Add Theme support and write a function to get the featured posts
// This goes in your themes functions.php file
add_theme_support( 'featured-content', array(
'filter' => 'mytheme_get_featured_posts',
'max_posts' => 20,
'post_types' => array( 'post', 'page' ),
) );
function mytheme_get_featured_posts() {
@mikeyarce
mikeyarce / schema-footer.php
Last active August 29, 2015 14:25
Add a shortcode to the footer
@mikeyarce
mikeyarce / carousel-custom-options.php
Created July 29, 2015 17:52
Customize WooSliders Carousel Nav JS
@mikeyarce
mikeyarce / uno-navigation.css
Last active August 29, 2015 14:26
Edit Uno's navigation colours
/* Set the Navigation Bar color */
#nav-container, #navigation {
background: blue;
font-size: 13px;
}
/* Set the Active and Hover Colors */
#navigation ul.nav > li:hover > a,
#navigation ul.nav li.current_page_item a, #navigation ul.nav li.current_page_parent a, #navigation ul.nav li.current-menu-ancestor a, #navigation ul.nav li.current-cat a, #navigation ul.nav li.current-menu-item a {
background: green;
@mikeyarce
mikeyarce / sensei-change-pagination.php
Created August 18, 2015 18:26
Sensei Pagination Filter
<?php
function woo_sensei_pagination() {
global $wp_query, $woothemes_sensei;
$paged = $wp_query->get( 'paged' );
$course_page_id = intval( $woothemes_sensei->settings->settings[ 'course_page' ] );
if ( ( is_post_type_archive( 'course' ) || ( is_page( $course_page_id ) ) ) && ( isset( $paged ) && 0 == $paged ) ) {
// Silence
} elseif( is_singular( 'course' ) ) {
<?php
// Hook In
add_action( 'woo_top', 'woo_hello' );
// Our hooked in Function
function woo_hello() {
echo "Hello World";
}
@mikeyarce
mikeyarce / variations-per-page.php
Created October 1, 2015 21:41
Set the number of Variations to show on a page in the WordPress admin
<?php
function custom_wc_admin_variations_per_page( $qty ) {
return 999;
}
add_filter( 'woocommerce_admin_meta_boxes_variations_per_page', 'custom_wc_admin_variations_per_page' );