This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeHeadLinks() { | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds | |
remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed | |
remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link | |
remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file. | |
remove_action( 'wp_head', 'index_rel_link' ); // index link | |
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link | |
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link | |
remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post. | |
remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place this in the comments.php theme file | |
<ol class="commentlist"> | |
<?php wp_list_comments('type=comment&callback=frankiewp_comment'); ?> | |
</ol> | |
// Place this in functions.php | |
function frankiewp_comment($comment, $args, $depth) { | |
$GLOBALS['comment'] = $comment; ?> | |
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> | |
<div id="comment-<?php comment_ID(); ?>"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (function_exists('register_sidebar')) { | |
register_sidebar(array( | |
'name' => __('Sidebar Widgets','themename' ), | |
'id' => 'sidebar-widgets', | |
'description' => __( 'These are widgets for the sidebar.','themename' ), | |
'before_widget' => '<div id="%1$s" class="widget %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h2>', | |
'after_title' => '</h2>' | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function themename_scripts() { | |
wp_enqueue_script('functions', get_template_directory_uri() . '/js/functions.js', array('jquery')); | |
wp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom-style.css'); | |
} | |
add_action( 'wp_enqueue_scripts', 'themename_scripts' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prevent directory browsing | |
Options All -Indexes | |
# Deny access to wp-config | |
<Files wp-config.php> | |
order allow,deny | |
deny from all | |
</Files> | |
# Deny access to htacess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE 'wp_users' SET 'user_pass' = MD5('NEWPASSWORD') WHERE 'user_login' ='username' LIMIT 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'get_image_tag', 'remove_width_and_height_attribute', 10 ); | |
add_filter( 'post_thumbnail_html', 'remove_width_and_height_attribute', 10 ); | |
add_filter( 'image_send_to_editor', 'remove_width_and_height_attribute', 10 ); | |
function remove_width_and_height_attribute( $html ) { | |
return preg_replace( '/(height|width)="\d*"\s/', "", $html ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// store the links parent selectors as variables | |
var $next = $(".next"); | |
var $prev = $(".prev"); | |
// if the prev posts link doesn't exist but the next link does | |
if ($prev.children().length == 0 && $next.children().length > 0) { | |
// add a span with prev | |
$prev.append('<span class="disabled">Prev</span>'); | |
// if the next posts link doesn't exist but the prev one does | |
} else if ($next.children().length == 0 && $prev.children().length > 0) { | |
// add a span with next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function html5_insert_image($html, $id, $caption, $title, $align, $url) { | |
$html5 = "<figure id='post-$id media-$id' class='align-$align'>"; | |
$html5 .= "<img src='$url' alt='$title' />"; | |
if ($caption) { | |
$html5 .= "<figcaption>$caption</figcaption>"; | |
} | |
$html5 .= "</figure>"; | |
return $html5; | |
} | |
add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function g8_aus_address( $address_types, $form_id ){ | |
$address_types["australia"] = array( | |
"label" => "Australian", | |
"country" => "Australia", | |
"zip_label" => "Postcode", | |
"state_label" => "State", | |
"states" => array( | |
"NT" => "NT", | |
"ACT" => "ACT", | |
"NSW" => "NSW", |
OlderNewer