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
// Create Random bg color in php | |
$rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); | |
$color = '#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)]; | |
echo '<style> body { background-color:'.$color.'}</style>'; |
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
echo do_shortcode( '[foo]' ); // Boo | |
echo foo_shortcode_callback(); // Yey! |
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
function page_custom() { | |
if($_SERVER['REQUEST_URI'] == '/register'){ | |
// path to the file | |
include(get_template_directory().'/users/register.php'); | |
} | |
} | |
add_action('template_redirect', 'page_custom'); |
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
Go to Terminal | |
Enter " which php " | |
If it says /usr/bin/php, then proceed to 3. | |
Enter sudo nano ~/.bash_profile (or sudo vim ~/.bash_profile if you know how to use it) | |
then paste this export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH" | |
ctrl - O then enter to save, then ctrl - X to exit. | |
restart terminal. | |
Enter which php | |
http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension |
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
Go into domain folder | |
transfer or run a new install of laravel | |
git clone https://github.com/laravel/laravel example.com && cd example.com | |
// get composer | |
curl -sS https://getcomposer.org/installer | php -d allow_url_fopen=On | |
// install composer | |
php -d allow_url_fopen=On composer.phar install | |
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
<snippet> | |
<content><![CDATA[ | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>${1:New Project Title}</title> |
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 get_header(); | |
/* | |
Template Name: Product Page | |
*/ | |
?> | |
<div class="col-xs-12"> | |
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> |
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 | |
if( current_user_can('administrator')){ | |
// show something to admins only | |
} | |
?> |
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 get_header(); | |
/* | |
Template Name: Cats Grid Page | |
*/ | |
?> | |
<p>Show the cats grid</p> | |
<div class="well"><ul> | |
<?php |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Btn Hovers</title> | |
<style> | |
a.btn { | |
width:200px; | |
height: 200px; |