Skip to content

Instantly share code, notes, and snippets.

View theodorocaliari's full-sized avatar
💻

Theodoro Caliari theodorocaliari

💻
View GitHub Profile
@theodorocaliari
theodorocaliari / posts_page_conditional.php
Created July 13, 2013 23:21
Conditional for WordPress posts page
<?php
if( is_home('page_name_defined_in_settings_reading_wp_admin_menu') )
{
// code
}
?>
@theodorocaliari
theodorocaliari / Preferense.sublime-settings.json
Last active December 19, 2015 07:48
My ST2 user settings
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_size": 14.0,
"word_wrap": true,
"save_on_focus_out": true,
"tab_size": 2,
"translate_tabs_to_spaces": false,
"enable_tab_scrolling": false,
}
@theodorocaliari
theodorocaliari / remove-adminbar-front-end-wp.php
Last active December 19, 2015 07:09
Remove Wordpress admin top bar in front-end for all users.
<?php
//http://www.paulund.co.uk/remove-the-wordpress-admin-bar
if (!current_user_can( 'manage_options' )){
add_filter( 'show_admin_bar', '__return_false' );
}
?>
@theodorocaliari
theodorocaliari / WP-prevent-direct-access.php
Created July 2, 2013 22:22
Prevent direct access to include file in WordPress
<?php
if ( ! defined( 'WPINC' )) {
die;
}
?>
@theodorocaliari
theodorocaliari / WP-enqueue-style-child-theme.php
Last active December 19, 2015 06:49
Call style recommended practice in functions.php of WordPress
<?php
function custom_style(){
$css = dirname(get_bloginfo('stylesheet_url'))."/your_style.css";
wp_register_style('name_ur_choice', $css);
wp_enqueue_style('name_ur_choice');
}
add_action('wp_enqueue_scripts', 'custom_style', $priority);
?>