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
<script> | |
jQuery(document).ready(function($) { | |
$("img:not([title])").each(function() { | |
if($(this).attr("alt") != '') $(this).attr("title", $(this).attr("alt")); | |
else $(this).attr("title", $(this).attr("src")); | |
}); | |
}); | |
</script> |
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
<?php | |
add_shortcode( 'cibaria_loop', 'cibaria_loop_shortcode' ); | |
function cibaria_loop_shortcode( $atts ) { | |
$param = shortcode_atts( [ | |
'post_status' => 'publish', | |
'post_type' => 'post', | |
'orderby' => 'date', | |
'order' => 'DESC', | |
'posts_per_page' => -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
<?php | |
/** | |
* Automatically login a single WordPress user upon arrival to a specific page. | |
* | |
* Redirect to home page once logged in and prevent viewing of the login page. | |
* Compatible with WordPress 3.9.1+ | |
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead." | |
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
margin: 0; | |
font-size: 28px; | |
font-family: Arial, Helvetica, sans-serif; | |
} |
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
<?php | |
Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/ | |
//adjustments to wp-includes/http.php timeout values to workaround slow server responses | |
add_filter('http_request_args', 'bal_http_request_args', 100, 1); | |
function bal_http_request_args($r) //called on line 237 | |
{ | |
$r['timeout'] = 15; | |
return $r; | |
} | |
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
<?php | |
// Add additional fee ( Handling Fee etc. ) | |
add_action( 'woocommerce_cart_calculate_fees','theme_prefix_additional_fees' ); | |
function theme_prefix_additional_fees() { | |
global $woocommerce; | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
return; | |
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
<?php | |
// Customized login page | |
function theme_prefix_custom_login_page() { | |
$custom_logo_id = get_theme_mod( 'custom_logo' ); // image from cusomizer logo | |
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' ); | |
$bg = get_stylesheet_directory_uri() . '/images/bg.jpg'; // change url to your preferred image | |
?> | |
<style type="text/css"> | |
body.login { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body, html { | |
height: 100%; | |
margin: 0; | |
} | |
.bgimg { |
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
<?php | |
function exclude_roles_from_members_loop( $retval ) { | |
if ( bp_is_members_directory() ) { | |
$exclude_ids = get_users( | |
array( | |
'fields' => 'ID', | |
'role__in' => array( 'editor', 'author' ) // change the roles here | |
) | |
); |
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
<html> | |
<form method="post"> | |
<input name="url" size="50" /> | |
<input name="submit" type="submit" /> | |
</form> | |
<?php | |
// maximum execution time in seconds | |
set_time_limit (24 * 60 * 60); | |
if (!isset($_POST['submit'])) die(); |
NewerOlder