This file contains hidden or 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
<body> | |
<div class="container"> | |
<h2>Dynamic Tabs</h2> | |
<p>To make the tabs toggleable, add the data-toggle="tab" attribute to each link. Then add a .tab-pane class with a unique ID for every tab and wrap them inside a div element with class .tab-content.</p> | |
<ul class="nav nav-tabs" id="myLinks"> | |
<li class="active"><a data-toggle="tab" href="#home">Home</a></li> | |
<li><a href="#menu1">Menu 1</a></li> | |
<li><a href="#menu2">Menu 2</a></li> |
This file contains hidden or 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 tryMe (param1, param2) { | |
alert(param1 + " and " + param2); | |
} | |
function callbackTester (callback) { | |
callback (arguments[1], arguments[2]); | |
} | |
callbackTester (tryMe, "hello", "goodbye"); |
This file contains hidden or 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
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); | |
$config['base_url'] .= "://".$_SERVER['HTTP_HOST']; | |
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); |
This file contains hidden or 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> | |
var picker = $('#test').pickadate({ | |
format: 'dd/mm/yyyy' | |
}).pickadate('picker'); | |
$('#previous_day, #next_day').click(function(e) { | |
e.preventDefault(); | |
setDate($(this).data('diff')); | |
}) |
This file contains hidden or 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
<div class="form-group mb-2 mt-3"> | |
<label>Upload Their Images</label> | |
<br> | |
<input type="text" class="form-control"> | |
<input type="file" name="uploads_images[]" class="files" size="50" multiple="multiple" /> | |
<?php wp_nonce_field( 'uploads_images', 'my_image_upload_nonce' ); ?> | |
</div> | |
if ($_FILES) { |
This file contains hidden or 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
class widget_simple extends WP_Widget { | |
// Create Widget | |
function widget_simple() { | |
parent::WP_Widget(false, $name = 'Custom Simple Widget', array('description' => '')); | |
} | |
// Widget Content | |
function widget($args, $instance) { | |
extract( $args ); |
This file contains hidden or 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 | |
$unzip = new ZipArchive; | |
$out = $unzip->open('wordpress.zip'); | |
if ($out === TRUE) { | |
$unzip->extractTo(getcwd()); | |
$unzip->close(); | |
echo 'File unzipped'; | |
} else { | |
echo 'Error'; | |
} |
This file contains hidden or 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 | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title> Create a Zip with contents in the current Direcory (php script)</title> | |
<style type="text/css"> | |
body{ | |
font-family: arial; |
This file contains hidden or 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 | |
// Now you can have (3 possibilities): | |
// 1) The saving price: | |
add_filter( 'woocommerce_get_price_html', 'change_displayed_sale_price_html', 10, 2 ); | |
function change_displayed_sale_price_html( $price, $product ) { | |
// Only on sale products on frontend and excluding min/max price on variable products | |
if( $product->is_on_sale() && ! is_admin() && ! $product->is_type('variable')){ | |
// Get product prices |
This file contains hidden or 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( 'submit_job_form_fields', 'make_location_field_required' ); | |
function make_location_field_required( $fields ) { | |
$fields['job']['job_location']['required'] = true; | |
return $fields; | |
} |
NewerOlder