Shortcut | Description |
---|---|
Ctrl+Shift+P | command prompt |
Ctrl+Alt+P | switch project |
Ctrl+P | go to file |
Ctrl+G | go to line |
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 | |
/* vars for export */ | |
// database record to be exported | |
$db_record = 'XXX_TABLE_NAME_XXX'; | |
// optional where query | |
$where = 'WHERE 1 ORDER BY 1'; | |
// filename for export | |
$csv_filename = 'db_export_'.$db_record.'_'.date('Y-m-d').'.csv'; | |
// database variables |
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 ($) { | |
$(document).ready(function () { | |
$('#next').click(function () { | |
$.post( | |
PT_Ajax.ajaxurl, | |
{ | |
// wp ajax action | |
action: 'ajax-inputtitleSubmit', | |
// vars |
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
/* Bootstrap 4 - https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css */ | |
.active | |
.alert | |
.alert-danger | |
.alert-dark | |
.alert-dismissible | |
.alert-heading | |
.alert-info | |
.alert-light |
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
/* | |
Plugin Name: Auto Add Read Posts | |
Description: A plugin that adds read posts to the user's read list - requires the Unread Posts plugin | |
Version: 1.0.0 | |
Author: Daniel Pataki | |
Author URI: http://danielpataki.com/ | |
License: GPLv2 or later | |
*/ | |
add_action( 'wp', 'auto_add_post_to_read_list' ); |
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
<div class='post' id='post-23'> | |
<h2><?php the_title() ?></h2> | |
<div class='excerpt'> | |
<?php | |
$content = get_the_content(); | |
if( strlen($content) < 250 ) { | |
echo $content; | |
} | |
else { | |
$content = substr( $content, 0, 250 ); |
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
public function get_remote_posts() { | |
$posts = get_transient( 'remote_posts' ); | |
if( empty( $posts ) ) { | |
$response = wp_remote_get( 'http://mysite.com/wp-json/wp/v2/posts/' ); | |
if( is_wp_error( $response ) ) { | |
return array(); | |
} | |
$posts = json_decode( wp_remote_retrieve_body( $response ) ); |
##Windows users:
- Download wamp: http://www.wampserver.com/en/
- Download and extract cmder mini: https://github.com/cmderdev/cmder/releases/download/v1.1.4.1/cmder_mini.zip
- Update windows environment variable path to point to your php install folder (inside wamp installation dir) (here is how you can do this http://stackoverflow.com/questions/17727436/how-to-properly-set-php-environment-variable-to-run-commands-in-git-bash)
cmder will be refered as console
##Mac Os, Ubuntu and windows users continue here:
- Create a database locally named
homestead
utf8_general_ci
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |