Skip to content

Instantly share code, notes, and snippets.

View nfsarmento's full-sized avatar

Nuno Sarmento nfsarmento

View GitHub Profile
@nfsarmento
nfsarmento / yoast_seo_opengraph_change_image_size.php
Created March 16, 2020 10:33 — forked from amboutwe/yoast_seo_opengraph_change_image_size.php
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 24 2019 using Yoast SEO 11.2.1 on WordPress 5.2.1
*/
add_filter( 'wpseo_opengraph_image_size', 'yoast_seo_opengraph_change_image_size' );
function yoast_seo_opengraph_change_image_size( $string ) {
@nfsarmento
nfsarmento / debian-laravel.sh
Created March 4, 2020 13:17 — forked from butschster/debian-laravel.sh
LEMP server configured for Laravel (MySQL, NGINX, php7.2-fpm, Redis, Websocket server, MongoDB, Composer)
# ================================================
# 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
@nfsarmento
nfsarmento / index.php
Last active February 28, 2020 23:40 — forked from rbk/index.php
Turn input placeholders into floating labels for WP Contact Form 7 fields
/*
*
* 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');
@nfsarmento
nfsarmento / functions.php
Created February 26, 2020 17:04 — forked from jaredatch/functions.php
WordPress Search Autocomplete using admin-ajax.php
<?php
/**
* Enqueue scripts and styles.
*
* @since 1.0.0
*/
function ja_global_enqueues() {
wp_enqueue_style(
'jquery-auto-complete',
@nfsarmento
nfsarmento / popular-widget.php
Last active February 5, 2020 17:35 — forked from billerickson/gist:1888923
Popular Posts Widget
@nfsarmento
nfsarmento / breadcrumb.php
Last active January 26, 2024 17:26 — forked from timnovis/breadcrumb.php
WordPress Breadcrumbs & Schema Markup
<?php
/**
* Breadcrumbs
*
* @package nunosarmento
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
@nfsarmento
nfsarmento / get-isotope-items.php
Created August 6, 2019 15:49 — forked from mohandere/get-isotope-items.php
jQuery isotope plugin for wordpress posts filtering by category with pagination.
<?php
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
);
@nfsarmento
nfsarmento / functions.php
Created May 24, 2019 13:30 — forked from vicskf/functions.php
Event Tickets > Send a copy of the RSVP or ticket email to all event organizers that have a valid email address
<?php
/**
* BCC event organizers email on all Event Tickets' RSVP and commerce ticket emails so they get a copy of it too
*/
function bcc_all_event_organizers( $headers, $event_id, $order_id ) {
//check if has organizer
if ( !tribe_has_organizer( $event_id ) ) {
return $headers;
}
@nfsarmento
nfsarmento / .htaccess
Created September 5, 2018 15:25 — forked from Zodiac1978/.htaccess
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
#
@nfsarmento
nfsarmento / functions.php
Last active August 8, 2018 16:52 — forked from bmoredrew/gist:dcc7d04b23e785f6c0bb
Front-end Attendee List WooCommerce WooTickets Events Calendar Plugin
<?php
global $current_user;
get_currentuserinfo();
if (is_user_logged_in() && $current_user->ID == $post->post_author) {
// Build a list of attendees
$attendeeList = TribeEventsTickets::get_event_attendees($event_id);
$customerList = array();