Skip to content

Instantly share code, notes, and snippets.

(function($) {
function find_page_number( element ) {
element.find('span').remove();
return parseInt( element.html() );
}
$(document).on( 'click', '.nav-links a', function( event ) {
event.preventDefault();
@nelsonogueh
nelsonogueh / wp-config.php
Created June 18, 2023 18:55 — forked from lukecav/wp-config.php
Redis Object Cache plugin bypass Redis object caching for debugging
define( 'WP_REDIS_DISABLED', true );
@nelsonogueh
nelsonogueh / ssh.md
Created June 8, 2023 08:42 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@nelsonogueh
nelsonogueh / gist:0d27c7f91255949bb8caf8a17cba11d6
Created May 25, 2023 12:02 — forked from dpapathanasiou/gist:4329613
Simple Social Media "Share" Buttons
<div><!-- social media share buttons -->
<a href="http://www.facebook.com/" onclick="window.location = 'http://www.facebook.com/share.php?u=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/aLnZg.png" alt="Share on Facebook" border="0" /></a>
<a href="http://twitter.com/" onclick="window.location = 'http://twitter.com/home/?status=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/oFrLG.png" alt="Tweet This" border="0" /></a>
<a href="http://www.linkedin.com/" onclick="window.location = 'http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/mwHNU.png" alt="Share on LinkedIn" border="0" /></a>
<a href="https://plus.google.com/" onclick="window.location = 'https://plus.google.com/share?url=' + encodeURIComponent(window.location); return false"><img src="http://i.imgur.com/tzMMp.png" alt="Share on Google+" border="0" /></a>
@nelsonogueh
nelsonogueh / author-filter-meta-box.php
Created March 9, 2023 06:34 — forked from bueltge/author-filter-meta-box.php
Add a meta box to WordPress edit posts and list only authors
<?php
/**
* Plugin Name: Author Meta Box only with authors
* Plugin URI: http://wordpress.stackexchange.com/questions/60429/stop-loading-collaborators-users-on-add-new-post-or-page
* Description:
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv3
*/
add_action( 'admin_menu', 'fb_remove_author_meta_boxes' );
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@nelsonogueh
nelsonogueh / page-forgot-password.php
Created December 20, 2022 11:54 — forked from jshakes/page-forgot-password.php
One-page WP password reset page (for themes with front-facing bespoke log-in)
<?php
/*
Lets you display a forgot/reset password page within your theme.
Eg, create a page called 'Forgot Password'; save this file as page-forgot-password.php
Adapted from code posted here: http://wordpress.stackexchange.com/questions/14692/check-for-correct-username-on-custom-login-form/14696#14696
*/
@nelsonogueh
nelsonogueh / upload-a-file.MD
Created December 19, 2022 23:44 — forked from ahmadawais/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@nelsonogueh
nelsonogueh / host-react-app-on-apache-server.md
Created October 11, 2022 23:54 — forked from ywwwtseng/host-react-app-on-apache-server.md
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@nelsonogueh
nelsonogueh / manual_paginate.php
Created July 13, 2022 13:34 — forked from nellytadi/manual_paginate.php
Manual Paginate In Laravel
<?php
namespace App\Http\Controllers\Api;
use App\Model;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Pagination\LengthAwarePaginator as Paginator;