Skip to content

Instantly share code, notes, and snippets.

View syamilmj's full-sized avatar

Syamil MJ syamilmj

View GitHub Profile
@syamilmj
syamilmj / index.php
Created June 13, 2012 19:37
smof index.php file
<?php
/*
Title : SMOF
Description : Slightly Modified Options Framework
Version : 1.4.0
Author : Syamil MJ
Author URI : http://aquagraphite.com
License : WTFPL - http://sam.zoy.org/wtfpl/
Credits : Thematic Options Panel - http://wptheming.com/2010/11/thematic-options-panel-v2/
KIA Thematic Options Panel - https://github.com/helgatheviking/thematic-options-KIA
@syamilmj
syamilmj / gist:2952342
Created June 19, 2012 04:51
Fix pagination error on homepage WP3.4
//Fix for home page navigation error on WP 3.4
function aq_query_for_homepage( $query ) {
global $paged;
if(get_option('lp_include_reviews') == "true") { $include_reviews = "reviews"; }
if(get_option('lp_include_videos') == "true") { $include_videos = "videos"; }
if(get_option('lp_include_screenshots') == "true") { $include_screenshots = "screenshots"; }
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'post_type', array( 'post', $include_reviews, $include_videos, $include_screenshots ) );
@syamilmj
syamilmj / functions.php
Created June 21, 2012 19:08
Fix "Cheatin' uh?" error on custom media upload buttons
/**
* Get rid of "Cheatin' uh?" error
* note: this will create a persistent "Hello World" post
*/
function aq_cheatin_uh(){
$id = 1;
$check = get_post($id);
if(! $check ) {
$post = array(
@syamilmj
syamilmj / functions.php
Created July 19, 2012 14:34
fix pagination on search
function aq_fix_query( $query ) {
global $paged;
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'post_type', array( 'post', 'listings' ) );
}
}
add_action( 'pre_get_posts', 'aq_fix_query' );
class My_Custom_Block extends AQ_Block {
function __construct() {
// block actual processes
}
function form( $instance ) {
// outputs the options form on admin
}
@syamilmj
syamilmj / gist:3993470
Created November 1, 2012 12:57
replace attachment with dummy image
function dummy_wp_get_attachment_url( $url, $post_id ){
return 'http://dummy/image/URL';
}
add_filter( 'wp_get_attachment_url' , 'dummy_wp_get_attachment_url' , 10 , 2 );
@syamilmj
syamilmj / styles.php
Created November 15, 2012 04:25
disable bg patterns
/** line 125 */
background: <?php echo $data['header_bg_color'] ?> url(<?php echo $data['header_bg_img'] ?>);
// Change to:
background: <?php echo $data['header_bg_color'] ?>;
/** line 169 */
@syamilmj
syamilmj / gist:4442840
Created January 3, 2013 11:30
template-portfolio.php
<?php
/*
Template Name: Portfolio
*/
$column = strtolower($data['aq_portfolio_layout']); //Get number of columns
get_header(); ?>
<div id="content-full-width" class="cf">
@syamilmj
syamilmj / meta-boxes.php
Created April 24, 2013 22:14
meta-boxes.php
<?php
/**
* Posts & Pages meta boxes
*/
/**
* Main custom meta boxes class
*/
if(!class_exists('AQ_Meta_Boxes')) {
@syamilmj
syamilmj / gist:6108795
Created July 29, 2013 23:28
index.php
<?php get_header(); ?>
<?php get_template_part( 'includes/contents/content', 'stream'); ?>
<?php get_template_part( 'includes/contents/content', 'index' ); ?>
<?php get_footer(); ?>