Skip to content

Instantly share code, notes, and snippets.

View billrobbins's full-sized avatar

Bill Robbins billrobbins

View GitHub Profile
import axios from "axios";
export const HTTP = axios.create({
baseURL: baseURL.url
});
HTTP.get("wp-json/wp/v2/pages?slug=" + this.$route.params.id)
.then(resp => {
this.page = resp.data[0];
...
import axios from "axios";
export const HTTP = axios.create({
baseURL: `http://localist.test`
});
<?php
if ( ( is_single() || is_page() || is_singular( 'staff', 'podcast', 'post' ) ) && get_post_meta( $post->ID, 'page_layout', $single = true ) != '' ) {
$layout = get_post_meta( $post->ID, 'page_layout', true );
} else if ( is_home() && ( get_post_meta( get_option( 'page_for_posts' ), 'page_layout', $single = true ) != '' ) ) {
$layout = get_post_meta( get_option( 'page_for_posts' ), 'page_layout', true );
} else {
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|twitterbot|Pinterest|applebot|facebot|linkedinbot|slackbot)
RewriteRule /(\d*)$ https://yoursite.com/assets/share/index.php?id=$1 [P]
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
map $http_user_agent $root {
"~*twitterbot" /var/www/yoursite.com/html/assets/share;
"~*applebot" /var/www/yoursite.com/html/assets/share;
"~*facebookexternalhit" /var/www/yoursite.com/html/assets/share;
"~*facebot" /var/www/yoursite.com/html/assets/share;
"~*linkedinbot" /var/www/yoursite.com/html/assets/share;
"~*pinterest" /var/www/yoursite.com/html/assets/share;
"~*slackbot" /var/www/yoursite.com/html/assets/share;
default /var/www/yoursite.com/html;
}
//URL to your app
$appURL = 'https://yourapp.com/';
// URL to the WordPress source
$sourceURL = 'https://yourapp.com/source/';
// URL to default share image
$dImage = 'https://yourapp.com/assets/img/default-share.jpg';
title: 'Artisan',
description: 'Make your business stand out from the rest',
'og:image': 'https://artisan.wpwebapps.com/assets/img/default-share.jpg',
'og:type': 'website',
'og:locale': 'en_US'
<title>Artisan</title>
<meta property="og:description" content="Make your business stand out from the rest" />
<meta property="og:title" content="Artisan" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://artisan.wpwebapps.com" />
<meta property="og:image" content="https://artisan.wpwebapps.com/assets/img/default-share.jpg" />
<link href="https://fonts.googleapis.com/css?family=Crimson+Text|Montserrat|Playfair+Display" rel="stylesheet">