Skip to content

Instantly share code, notes, and snippets.

error_reporting(E_ALL); ini_set(‘display_errors’,1);
define(‘WP_DEBUG’, true);
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
@domantasg
domantasg / style.css
Created June 6, 2017 14:11
Change WordPress background color
.site-content-contain {
background-color: #d5ffa0;
position: relative;
}
@domantasg
domantasg / WordPress Version Generator Meta Tag
Created June 15, 2017 08:36
Check which version of WordPress You are Running
<script type='text/javascript' src='http://hostinger-tutorials.com/wp-includes/js/jquery/jquery.js'></script>
<script type='text/javascript' src='http://hostinger-tutorials.com/wp-includes/js/jquery/jquery-migrate.min.js'></script>
<link rel='https://api.w.org/' href='http://hostinger-tutorials.com/wp-json/' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://hostinger-tutorials.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://hostinger-tutorials.com/wp-includes/wlwmanifest.xml" />
<meta name="generator" content="WordPress 4.8" />
class hstngr_widget extends WP_Widget {
//Insert 4 functions here
}
class hstngr_widget extends WP_Widget {
//Insert functions here
}
function hstngr_register_widget() {
register_widget( 'hstngr_widget' );
}
add_action( 'widgets_init', 'hstngr_register_widget' );
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
return $instance;
}
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) )
$title = $instance[ 'title' ];
else
$title = __( 'Default Title', 'hstngr_widget_domain' );
?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
public function widget( $args, $instance ) {
$title = apply_filters( 'widget_title', $instance['title'] );
echo $args['before_widget'];
//if title is present
if ( ! empty( $title ) )
echo $args['before_title'] . $title . $args['after_title'];
//output
echo __( 'Hello, World from Hostinger.com', 'hstngr_widget_domain' );
echo $args['after_widget'];
}