You can check here for getting the latest version. Change the wget url to download newer versions.
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
<article class="m-article" v-for="post in posts"> | |
<div class="m-media"> | |
<a v-bind:href="post.link"> | |
<template v-if="post._embedded['wp:featuredmedia']"> | |
<img :src="post._embedded['wp:featuredmedia'][0].source_url" alt=""> | |
</template> | |
</a> | |
</div> | |
<div class="m-txts"> | |
<a v-bind:href="post.link"> |
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 ( is_user_logged_in() ) { ?> | |
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>"><?php _e('My Account','woothemes'); ?></a> | |
<?php } | |
else { ?> | |
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>"><?php _e('Login / Register','woothemes'); ?></a> | |
<?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
<?php | |
/** | |
* Remove Divi shortcodes from content | |
* | |
* @see http://victorfont.com/remove-divi-shortcodes-changing-themes/ | |
*/ | |
function remove_divi_shortcodes( $content ) { | |
$content = preg_replace('/\[\/?et_pb.*?\]/', '', $content); | |
return $content; |
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
SET @table=(SELECT DATABASE()); | |
select @table; | |
SELECT | |
table_schema as `Database`, | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
WHERE table_schema = @table | |
ORDER BY (data_length + index_length) DESC; |
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 | |
/** | |
* Using this method, a GET parameter can be passed to the page, enabling a simple locator form to be populated and submitted dynamically. | |
* One use case may exist where the user submits a gravity form, and is redirected to a list of locations without needing to resubmit the simple locator form. | |
* This code would be placed in a page template. | |
*/ | |
// First, we check if a GET parameter named "search" exists. If so, we sanitize it and set it for our use | |
// This could be passed via a link, or through another form submission | |
$location_search = ( isset($_GET['search']) ) ? sanitize_text_field($_GET['search']) : false; |
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 | |
/** | |
* Fix location of ACF local JSON. | |
* | |
* Since Sage does some surgery on the WordPress template locations, ACF looks in | |
* the wrong location for the acf-json directory. We will fix this by manually | |
* hooking into that functionality and attempting to save in the right spot. | |
* | |
* @param string $path |
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 | |
/* ————————————————————————— */ | |
/* ACF Inline SVGs | |
/* ————————————————————————— */ | |
$repeater = 'repeater_field_name' | |
if ( have_rows( $repeater ) ): ?> | |
<section class="content-main"> | |
<div class="container"> <?php |
@role
Blade Directive For Laravel Spark
Assumes you're using teams
Add this to the boot()
method of your AppServiceProvider
\Blade::directive('role', function($roles) {
$user = auth()->user();
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
#!/bin/bash -e | |
## | |
# WordPress Installation and VirtualHost Creation | |
# | |
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage, | |
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks, | |
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes, | |
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file | |
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress |