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
if ($_POST['email']) { | |
$email = $_POST['email']; | |
$message = "Hello this is a test! It worked!"; | |
mail($email, 'My Subject', $message); | |
echo 'Mail Should Now Be Sent!'; | |
} |
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 | |
/* | |
* FOR THE PHP GEEKS! | |
------------------ | |
Can anyone spot any errors with the code below? | |
I need it to display an output that matches with this document from the client (see screenshot here: https://twitter.com/fredbradley/status/322399388146216961/photo/1 ) | |
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 | |
/* | |
Hello! | |
This has been bugging me for the best part of a day now, so I'm appealing to help in order to calm my nerves. | |
I run a site that has many custom post types. Every post type shares the use of the post_tag taxonomy. | |
I need to create a page that shows all the posts that are tagged with "video". It's not working like I expect. It's only showing the normal blog posts - not the other custom post types that are also tagged with 'video'. |
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="no-format" id="header"> | |
<div class="text-center"> | |
<p>BLAH BLAH BLAH</p> | |
</div> | |
</div> | |
<div class="container" id="emailWrapper"> | |
<div class="row" id="header"> | |
<div class="col-md-5"> | |
SRA LOGO | |
</div> |
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
<html> | |
<head> | |
<style> | |
/** | |
* Update: July 2020 | |
* I have converted this into it's own separate project now: https://github.com/fredbradley/tfl-colours | |
*/ | |
</head> | |
<body> | |
<!-- Here is an example of how the above styles can be implmented! |
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
p.interact a { | |
background:url("twitter-sprite.png"); /* Obviously make sure that twitter-sprite.png is included in your template! */ | |
display: inline-block; | |
height: 20px; | |
width: 20px; | |
text-indent: -9999px; | |
} | |
p.interact a.twitter_reply_icon, | |
p.interact a.twitter_retweet_icon, | |
p.interact a.twitter_fav_icon { |
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
<? | |
/** | |
* Some custom code written by Fred that will pull in all the photos in given photosets | |
*/ | |
// First we Add some custom styles! Not ideal, and not compliant but quick and easy! ?> | |
<style> | |
ul.flickr-photos, | |
ul.flickr-photos li { | |
list-style:none; |
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 | |
/** | |
* Update Custom Terms | |
* | |
* @author Fred Bradley <@fredbradley> | |
* @version 1.0 | |
* @since Since Release 1.0.0 | |
*/ | |
function update_station_tag_list($post_id) { | |
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 | |
/** | |
* get youtube video ID from URL | |
* | |
* @param string $url | |
* @return string Youtube video id or FALSE if none found. | |
*/ | |
function youtube_id_from_url($url) { | |
$pattern = | |
'%^# Match any youtube URL |
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 | |
/** | |
* How this works: While writing content in the Wordpress editor. Simply add a twitter handle without a link but with the @ symbol. | |
* EG: "Here is some content written by @FredBradley" would turn into "Here is some content written by <i class="fa fa-fw fa-twitter"></i><a href="https://twitter.com/intent/user/?screen_name=@FredBradley">@FredBradley</a>" | |
* | |
* Notes: For this snippet to work 100% as intended it requires two things. | |
* 1. You need to have Font Awesome working on your site. (http://fontawesome.io/) | |
* 2. You need to have called the Twitter Widgets.js javascript for Web Intents to work. More details here: https://dev.twitter.com/web/intents#user-intent | |
* | |
* How to implement: Simply add this snippet into your theme's functions.php file! |
OlderNewer