Skip to content

Instantly share code, notes, and snippets.

@laras126
laras126 / gist:965060
Created May 10, 2011 18:24
sidebar conditional
<?
// Filter thematic_sidebar() .. remove from everything except the blog (category chosen in theme options).
function remove_sidebar() {
$shortname = get_option('of_shortname');
$cat_option = get_option($shortname.'_cats_in_blog');
$cat = get_cat_ID($cat_option);
if ($cat != '') {
if ( is_category($cat) ) {
@laras126
laras126 / gist:965062
Created May 10, 2011 18:25
add portfolio body class
<?
// Add portfolio body class to anything that isn't the blog
function portfolio_body_class($class) {
if ( !is_home() ) {
$class[] = 'portfolio';
return $class;
}
}
add_filter('thematic_body_class','portfolio_body_class');
@laras126
laras126 / gist:965065
Created May 10, 2011 18:26
get blog cat option
<?
// Get all posts from category specified in the Blog Category option. This is the only category displayed on the blog page.
function get_blog_cat() {
$shortname = get_option('of_shortname');
$cat_option = get_option($shortname.'_cats_in_blog');
$cat = get_cat_ID($cat_option);
query_posts( "cat=$cat" );
}
@laras126
laras126 / gist:965069
Created May 10, 2011 18:27
blog cat option
<?
// Which category will be the blog page?
$options[] = array( "name" => "Blog Category",
"desc" => "Select the category that will be blog posts. All other categories will be in the portfolio format.",
"id" => $shortname."_cats_in_blog",
"std" => "",
"type" => "select",
"options" => $of_categories);
@laras126
laras126 / gist:971210
Created May 13, 2011 19:59
version conditional all
<?php
// Testing to see if the PHP version is up to date. If it is, add a WPFolio RSS feed widget, and if it's not, add a widget prompting an upgrade.
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
// Add WPFolio Wiki site as a Dashboard Feed
// Thanks to bavotasan.com: http://bavotasan.com/tutorials/display-rss-feed-with-php/
function custom_dashboard_widget() {
$rss = new DOMDocument();
@laras126
laras126 / gist:1033592
Created June 18, 2011 23:30
jquery slides
$(document).ready(function()
var slideWidth = 560;
var slides = $('.slide');
var numberOfSlides = slides.length;
// Wrap all .slides with #slideInner div
slides
.wrapAll('<div id="slideInner"></div>')
// Float left to display horizontally, readjust .slides width
@laras126
laras126 / gist:1043707
Created June 23, 2011 21:42
cycle head
<!-- include jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.74.js"></script>
<!-- initialize the slideshow when the DOM is ready -->
<script type="text/javascript">
$(document).ready(function() {
$('.slideshow').cycle({
<div class="slideshow">
<img src="http://cloud.github.com/downloads/malsup/cycle/beach1.jpg" width="200" height="200" />
<img src="http://cloud.github.com/downloads/malsup/cycle/beach2.jpg" width="200" height="200" />
<img src="http://cloud.github.com/downloads/malsup/cycle/beach3.jpg" width="200" height="200" />
</div>
...
<script type="text/javascript">
$(document).ready(function() {
// this is the first slideshow
$('.slideshow').cycle({
fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});
// this is the second slideshow
$('.slideshow2').cycle({
@laras126
laras126 / index.html
Created July 12, 2011 15:50
LimeJS and jQuery conflict
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="de-de" />
<title>NODOI 3.0</title>
<link type="text/css" rel="stylesheet" href="jquery-isotut/map.css" />
<script type="text/javascript" src="../closure/closure/goog/base.js"></script>
<script type="text/javascript" src="nodoi.js"></script>