This file contains hidden or 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 7.2 | |
| # | |
| # See https://www.colinodell.com/blog/201711/installing-php-72 | |
| # ================================================ | |
| apt-get install -y apt-transport-https lsb-release ca-certificates | |
| wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |
| echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list | |
| apt-get update | |
| apt-get install -y php7.2-cli php7.2-gd php7.2-mbstring php7.2-curl php7.2-xml php7.2-zip |
This file contains hidden or 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
| /* | |
| * | |
| * Description: Adds floating lables to all text inputs | |
| * | |
| */ | |
| function ns_append_style_and_js( ){ ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function($){ | |
| $(document).on('focus', 'input[type=text], input[type=email], textarea', function(e){ | |
| var ph = $(this).attr('placeholder'); |
This file contains hidden or 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 | |
| /** | |
| * Enqueue scripts and styles. | |
| * | |
| * @since 1.0.0 | |
| */ | |
| function ja_global_enqueues() { | |
| wp_enqueue_style( | |
| 'jquery-auto-complete', |
This file contains hidden or 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
| ############ WordPress #################### | |
| # Disable logging for favicon and robots.txt | |
| location = /favicon.ico { | |
| try_files /favicon.ico @empty; | |
| access_log off; | |
| log_not_found off; | |
| expires max; | |
| } |
This file contains hidden or 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 | |
| /** | |
| * The template used for displaying content | |
| * | |
| * @package ns-minimal | |
| * @since ns-minimal 1.0.0 | |
| */ | |
| ?> | |
| <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
This file contains hidden or 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
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^wp-content/uploads(.*)$ https://www.nuno-sarmento.com/wp-content/uploads/$1 [L,R] |
This file contains hidden or 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
| /** | |
| * Embed Gists with a URL on WordPress editor. | |
| * | |
| * Usage: | |
| * Paste a gist link into a blog post or page and it will be embedded eg: | |
| * https://gist.github.com/106134890a362a2a872055401f7fe743 | |
| * | |
| * If a gist has multiple files you can select one using a url in the following format: | |
| * https://gist.github.com/106134890a362a2a872055401f7fe743?file=embed-gist.php | |
| * |
This file contains hidden or 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
| /** | |
| * Extend Recent Posts Widget | |
| * | |
| * Adds different formatting (images) to the default WordPress Recent Posts Widget | |
| */ | |
| Class Ns_Recent_Posts_Widget extends WP_Widget_Recent_Posts { | |
| function widget($args, $instance) { |
This file contains hidden or 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
| /** | |
| * Popular Posts Widget | |
| * | |
| * Displays posts in last X days, sorted by most comments (proxy for popularity) | |
| * | |
| * @package Core Functionality | |
| * @author Nuno Sarmento <hello@nuno-sarmento.com> | |
| * | |
| */ |