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 | |
/* | |
Plugin Name: My Custom Post Types | |
Description: Add post types for movies and movie reviews | |
Author: Liam Carberry | |
*/ | |
// Hook <strong>lc_custom_post_movie()</strong> to the init action hook | |
add_action( 'init', 'lc_custom_post_movie' ); | |
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 | |
date_default_timezone_set('Etc/UTC'); | |
require '../PHPMailerAutoload.php'; | |
//Create a new PHPMailer instance | |
$mail = new PHPMailer; | |
//Tell PHPMailer to use SMTP | |
$mail->isSMTP(); | |
//Enable SMTP debugging | |
// 0 = off (for production use) | |
// 1 = client messages |
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
version: '2' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: somewordpress |
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 | |
$servername = "mysql.hostinger.com"; | |
$username = "u266072517_user"; | |
$database = "u266072517_name"; | |
$password = "buystuffpwd"; | |
// Create a new connection to the MySQL database using PDO | |
$conn = new mysqli($servername, $username, $password); | |
// Check connection |
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_action('wp_head','my_analytics', 20); | |
function my_analytics() { | |
?> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | |
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
// Display field value | |
the_field( 'FIELD NAME' ); | |
// Return field value | |
get_field( 'FIELD NAME' ); |
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
/ Hook our custom function to the pre_get_posts action hook | |
add_action( 'pre_get_posts', 'add_reviews_to_frontpage' ); | |
// Alter the main query | |
function add_reviews_to_frontpage( $query ) { | |
if ( is_home() && $query->is_main_query() ) { | |
$query->set( 'post_type', array( 'post', 'movie', 'review' ) ); | |
} | |
return $query; | |
} |
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
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-00000000-1', 'auto'); | |
ga('send', 'pageview'); | |
</script> |
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 | |
ini_set( 'display_errors', 1 ); | |
error_reporting( E_ALL ); | |
$from = "testing@yourdomain.com"; | |
$to = "recipient@emailaddress.com"; |
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
$mail->Host = "HOSTINGER_SMTP_HOST_HERE"; | |
//Set the SMTP port number - likely to be 25, 465 or 587 | |
$mail->Port = HOSTINGER_SMTP_PORT_HERE; | |
//Whether to use SMTP authentication | |
$mail->SMTPAuth = true; | |
//Username to use for SMTP authentication | |
$mail->Username = "YOUR_SMTP_USERNAME"; | |
//Password to use for SMTP authentication | |
$mail->Password = "YOUR_SMTP_PASSWORD"; | |
//Set who the message is to be sent from |