Skip to content

Instantly share code, notes, and snippets.

View kirasiris's full-sized avatar
😍
In love with JavaScript!!

Kevin Uriel Fonseca kirasiris

😍
In love with JavaScript!!
View GitHub Profile
@kirasiris
kirasiris / functions.php
Last active October 10, 2017 07:24
Wordpress login page customization - Function
<?php
function wpb_theme_setup(){
// Login Page
function my_login_logo_url() {
return home_url();
}
add_filter( 'login_headerurl', 'my_login_logo_url' );
function my_login_logo_url_title() {
return 'Your Site Name and Info';
}
@kirasiris
kirasiris / defaultwordpressloginstyle.css
Created October 10, 2017 07:26
Default Wordpress Login Page Style
body.login {}
body.login div#login {}
body.login div#login h1 {}
body.login div#login h1 a {}
body.login div#login form#loginform {}
body.login div#login form#loginform p {}
body.login div#login form#loginform p label {}
body.login div#login form#loginform input {}
body.login div#login form#loginform input#user_login {}
body.login div#login form#loginform input#user_pass {}
@kirasiris
kirasiris / wordpresscustomloginpagestyle.css
Created October 10, 2017 07:27
The custom login style for Wordpress
/******************** Login Page ********************/
body.login {
background: url(https://images.alphacoders.com/201/thumb-1920-201591.jpg) repeat center center;
background-size:cover;
}
body.login div#login {}
body.login div#login h1 {}
body.login div#login h1 a {
background-image: url(img/login-register-lost.png);
height:80px;
@kirasiris
kirasiris / addmorefilestoupload.php
Last active October 12, 2017 07:43
Functions to add more file format when uploading media in Wordpress
<?php
// Archivos Permitidos a subir
function edit_upload_types($existing_mimes = array()) {
$existing_mimes['woff'] = 'font/woff';
$existing_mimes['zip'] = 'application/zip';
$existing_mimes['epub'] = 'application/epub+zip';
$existing_mimes['mobi'] = 'application/x-mobipocket-ebook';
$existing_mimes['m4r'] = 'audio/aac';
$existing_mimes['aif'] = 'audio/x-aiff';
$existing_mimes['aiff'] = 'audio/aiff';
<ul class="nav navbar-nav navbar-right">
<?php if(is_user_logged_in()) : ?>
<li class="dropdown">
<?php global $current_user; get_currentuserinfo(); ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $current_user->display_name ?> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="<?php echo admin_url(); ?>">Profile</a></li>
<li><a href="<?php echo get_edit_user_link(); ?>">Settings</a></li>
<li role="separator" class="divider"></li>
<li><a href="<?php echo wp_logout_url( home_url() ); ?>">Log out</a></li>
<?php
/*
This functions notifies all the users who have had registered in your Wordpress about the new published posts
*/
function email_members($post_ID) {
$wp_user_search = new WP_User_Query( array( 'fields' => array('user_email') ) );
$usersarray = $wp_user_search->get_results();
$arrUsers = array ();
for ($arr = $usersarray, $mU = count ($arr), $iU = 0; $iU < $mU; $iU++) {
$arrUsers = $arr[$iU]->user_email;
<?php
// Sidebar
function wpb_init_widgets($id){
register_sidebar(array(
'name' => 'Sidebar',
'id' => 'sidebar',
'before_widget' => '<div class="well">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
<div class="alert alert-info">
<p>
<?php
$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
if (0 < $numcomms) $numcomms = number_format($numcomms); echo "There's <span>".$numcomms."</span> total comments on "; bloginfo('name');
?>
</p>
</div>
<?php
// Demo URL
function demo_url($postID){
$demo_url = 'URL para ver Demo';
$demostracion_url = get_post_meta($postID, $demo_url, true);
if($demostracion_url==''){
delete_post_meta($postID,$demo_url);
add_post_meta($postID,$demo_url, '#');
return "#";
}
<?php
remove_action('welcome_panel', 'wp_welcome_panel');
?>