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
/* | |
* redirect all subdomains example | |
* example domain name testsite.com | |
*/ | |
// split the incoming host to get the first element | |
var incoming = req.headers.host.split('.')[0]; | |
// check if it matches your domain | |
if ( incoming !== 'testsite' ) { |
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
//Add this to your theme's functions.php file | |
//Modify the function to add the custom field value you are looking for | |
add_filter('sharepress_og_tags', 'my_sharepress_og_tags'); | |
function my_sharepress_og_tags( $og ) { | |
global $post; | |
$custom_value = get_post_meta($post->ID, 'your custom field name', true); | |
$og = array_merge($og, array( | |
'og:title' => $og['og:title'] . " " . $custom_value |
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
.fb-comments, .fb-comments iframe[style] { | |
width: 100% !important; | |
} |
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
/** | |
* add this to the functions.php file in your theme to disable fb comments open graph metadata | |
*/ | |
add_filter('fbc_og_tags', '__return_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
server.get('/*', function(req, res, next) { | |
var fullURL = req.protocol + "://" + req.get('host') + req.url; | |
//your 301 redirects | |
var redirects_301 = { | |
'http://thinkingandmaking.com/working/92/72-questions-to-ask-on-your-first-day': '/view/72-questions-to-ask-on-your-first-day', | |
'http://thinkingandmaking.com/working/92/someother': '/view/someother' | |
} | |
//check and see if there is a redirect, if so, redirect to it! | |
if (redirects_301[fullURL]) { | |
res.redirect(301, redirects_301[fullURL]); |
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
add_filter('sp_auto_flush_fb', '__return_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 | |
/** | |
* Display a list of the 10 most commented posts (WordPress) | |
* @author Corey Brown https://github.com/coreyweb | |
* @author Aaron Collegeman: https://github.com/collegeman | |
* @author Joey Blake: https://github.com/joeyblake | |
* | |
* Rules: | |
* - show a list of 10 posts | |
* - published any time |
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 foreach ( $recipe_vars['instructions'] as $instruction ) { ?> | |
<p itemprop="recipeInstructions" > | |
<?php | |
if ($instruction['image_id'] != ""){ | |
$inst_image = wp_get_attachment_image_src( $instruction['image_id'], "medium", false ); | |
echo "<img src='{$inst_image[0]}' style='float:left;' /> "; | |
} | |
if (count($instruction['text']) > 1 ) { | |
echo '<ol>'; | |
foreach ($instruction['text'] as $numbered_inst ){ |
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 | |
# copy this file to /usr/sbin | |
# if you have other hosts entries that you would not like to lose, make sure they get added to the hosts.mamp.bak file | |
cat /etc/hosts.mamp.bak > /etc/hosts | |
echo 'clean!' |