Javascript:
- Wes Bos tutorial for learning vanilla JS
- You Don't Know JS Book Series by Kyle Simpson
- FreeCodeCamp free coding curriculum
- Pluralsight CodeSchool JS courses
React:
function get_attachment_id_from_src ($src) { | |
global $wpdb; | |
$reg = "/-[0-9]+x[0-9]+?.(jpg|jpeg|png|gif)$/i"; | |
$src1 = preg_replace($reg,'',$src); | |
if($src1 != $src){ | |
$ext = pathinfo($src, PATHINFO_EXTENSION); | |
$src = $src1 . '.' .$ext; | |
} | |
$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$src'"; | |
$id = $wpdb->get_var($query); |
import React, { Component } from 'react'; | |
import './App.css'; | |
const ShowingYourName = (props) => { | |
return ( | |
<p>{props.firstName}</p> | |
) | |
} | |
class App extends Component { |
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
<!-- wp:heading --> | |
<h2>Heading Block (H2)</h2> | |
<!-- /wp:heading --> | |
<!-- wp:heading --> | |
<h3>You are looking at one. (H3)</h3> | |
<!-- /wp:heading --> | |
<!-- wp:heading --> | |
<h2>Subhead Block</h2> |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Bootstrap Masonry Template</title> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="style.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700"> |
<?php | |
$query1 = new WP_Query($arg1); | |
$query2 = new WP_Query($arg2); | |
$query = new WP_Query(); | |
$query->posts = array_merge( $query1->posts, $query2->posts ); | |
// we also need to set post count correctly so as to enable the looping |
# Variables to replace in urls below | |
username = 'your_username_here_without_at_symbol' | |
key = 'public_key_from_dev' | |
application_token = 'very_long_application_token' | |
# This needs to be parsed as JSON for all of the 'id' fields. These are the board_hashes | |
url_for_board_hashes = "https://api.trello.com/1/members/#{username}/boards?&key=#{key}&token=#{application_token}" | |
# | |
# Loop over each board_hash and call the following url |
/* | |
* Scaffolding | |
* Basic and global styles for generating a grid system, structural layout, and page templates | |
* ------------------------------------------------------------------------------------------- */ | |
.container | |
Sets a width of 940px which also centres the content (clears floated elements before/after) | |
.container-fluid | |
Sets a minimum width of 940px (clears floated elements before/after) |
Add the following to your `functions.php` | |
```php | |
function vc_before_init_actions() { | |
require_once( get_template_directory().'/functions/shortcodes/vc-text-image.php' ); | |
} | |
add_action( 'vc_before_init', 'vc_before_init_actions' ); | |
``` | |
And now create a file in the location specified above with the following (customise accordingly): |