Skip to content

Instantly share code, notes, and snippets.

View FrankM1's full-sized avatar
🎯
Focusing

Franklin Gitonga FrankM1

🎯
Focusing
View GitHub Profile
<?php
/*
Plugin Name: Test
*/
class My_Like_Button {
function __construct()
{
$this->hooks();
}
@FrankM1
FrankM1 / shortcode-supported list
Created June 4, 2012 14:20
Supported Shortcodes
<?
global $shortcode_tags;
echo "<pre>"; print_r($shortcode_tags); echo "</pre>";
?>
@FrankM1
FrankM1 / dummy images wordpress
Created August 2, 2012 01:03
dummy images for wordpress before export
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 );
@FrankM1
FrankM1 / jquery.slider.css
Created August 2, 2012 03:11 — forked from lukemorton/jquery.slider.css
slider tutorial
.slider-container {
width: 600px;
height: 200px;
overflow: hidden;
position: relative;
}
.slider ul, .slider li {
margin: 0;
padding: 0;
list-style: none;
@FrankM1
FrankM1 / user media
Created August 6, 2012 01:44
Only show current User's media
//
// Mostrar sólo las Publicaciones, Comentarios y Multimedia que sean Propios
// Más info en > PC-SERVEIS, Diseño Web - http://www.pc-serveis.es
//
// Show only posts and media related to logged in author
add_action('pre_get_posts', 'query_set_only_author' );
function query_set_only_author( $wp_query ) {
global $current_user;
if( is_admin() && !current_user_can('edit_others_posts') ) {
@FrankM1
FrankM1 / wysiwyg.css
Created August 10, 2012 11:25
WYSIWYG styles for WordPress editor. Displays the elements classname next to each element
body *[class] {
position:relative;
border:1px dashed #ccc;
}
body *[class]::before {
content:attr(class);
line-height:10px;
color:#fff;
font-size:9px;
font-family:sans-serif;
@FrankM1
FrankM1 / sociial options
Created September 23, 2012 14:49
social options for radium framework
/*
$sections[] = array(
'icon' => RADIUM_OPTIONS_URL.'assets/images/icons/icon-social.png',
'title' => __('Social Media Links', 'radium'),
'desc' => __('<p class="description">Enter social account urls here.</p>', 'radium'),
'fields' => array(
array(
'id' => 'facebook_url',
'type' => 'text',
'title' => __('Facebook Account Url', 'radium'),
@FrankM1
FrankM1 / smooth_sortable_animating.html
Created November 1, 2012 22:25 — forked from chrisdickinson/smooth_sortable_animating.html
smoothly animate jquery sortable lists.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
ul { float:left; margin-right:20px; }
body { color:white; font-family:Helvetica, sans-serif; text-shadow:1px 1px 1px rgba(0,0,0,0.2); }
ul { width:512px; overflow:hidden; border-radius:6px; }
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag
<?php
/*
* Resize images dynamically using wp built in functions
* Victor Teixeira
*
* php 5.2+
*
* Exemplo de uso:
*
* <?php