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 | |
if ( is_singular('YOUR_CUSTOM_POST_TYPE') ) { | |
$terms = get_the_terms($post->ID, 'custom_categories'); | |
foreach ($terms as $term) { | |
$term_link = get_term_link($term, 'custom_categories'); | |
if (is_wp_error($term_link)) | |
continue; | |
echo '<a href="' . $term_link . '">' . $term->name . '</a>, '; | |
} |
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
## Use the code below only if you had enable .htaccess - "AllowOverride All" | |
## You may need to enable mod_headers on apache - "a2enmod headers" | |
## The code below goes under the rules that you should have if you are using WordPress | |
#BEGIN https code | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
#BEGIN Block bad hackers |
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 | |
/** | |
* | |
* Usage [newscpt posts_per_page="4" term="4"] . | |
* Change post_type to your CPT name | |
* Change taxonomy to your taxonomy name | |
* | |
*/ | |
// @codingStandardsIgnoreStart |
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 | |
// Show related posts. | |
// Fetch taxonomy terms for current product. | |
$productterms = get_the_terms( get_the_ID(), 'work_categories' ); | |
if( $productterms ) { | |
$producttermnames[] = 0; | |
foreach( $productterms as $productterm ) { | |
$producttermnames[] = $productterm->name; | |
} | |
// Set up the query arguments. |
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
# Prevents directory listing | |
Options -Indexes | |
# Deny backup extensions & log files | |
<Files ~ "(^#.*#|~|\.save|\.sw[op])$"> | |
Order allow,deny | |
Deny from all | |
</Files> | |
#Protect .htaccess From Unauthorized Access |
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
/* | |
* Admin user page custom column - Print User Web Visits Column Value | |
*/ | |
class NSLogin_Counter { | |
public function init() { | |
add_action( 'wp_login', array( $this, 'count_user_login' ), 10, 2 ); | |
add_filter( 'manage_users_columns', array( $this, 'add_stats_columns' ) ); | |
add_filter( 'manage_users_custom_column', array( $this, 'fill_stats_columns' ), 10, 3 ); |
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 svg support | |
* | |
*/ | |
add_filter( 'wp_check_filetype_and_ext', function( $data, $file, $filename, $mimes) { | |
global $wp_version; | |
if( $wp_version == '4.7' || ( (float) $wp_version < 4.7 ) ) { | |
return $data; | |
} | |
$filetype = wp_check_filetype( $filename, $mimes ); |
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
# Installation --- | |
# 1. In Bitbucket, add $FTP_USERNAME $FTP_PASSWORD and $FTP_HOST as environment variables. | |
# 2. Commit this file to your repo | |
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will | |
# push everything and initial GitFTP) | |
# | |
# Usage --- | |
# - On each commit to master branch, it'll push all files to the $FTP_HOST | |
# - You also have the option to 'init' (from Bitbucket Cloud) - pushes everything and initialises | |
# - Finally you can also 'deploy-all' (from Bitbucket Cloud) - if multiple deploys fail, you |
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="vpop" data-type="youtube" data-id="6xcG6ttMDVY" data-autoplay='true'>Youtube</div> | |
<br /> | |
<div class="vpop" data-type="vimeo" data-id="172052320" data-autoplay='true'>Vimeo</div> | |
<!-- copy this stuff and down --> | |
<div id="video-popup-overlay"></div> | |
<div id="video-popup-container"> |