Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View brojask's full-sized avatar

Hello World! Here's brojask

View GitHub Profile
@brojask
brojask / Best Single Page Wordpress
Created September 17, 2015 05:15
Best Single Page Wordpress
#Ref: http://qnimate.com/creating-a-one-page-wordpress-theme/
#Create a Template file for Home Page
<?php /* Template Name: Single Page Theme Page */ ?>
#Programmatically Creating and Setting Home Page
<?php
if(get_page_by_title("Home") == null)
{
var defaults = {
number: 1,
bool: true,
magic: 'real',
animal: 'whale',
croutons: 'delicious'
};
var options = {
number: 2,
@brojask
brojask / post-listing-shortcode.php
Created December 24, 2015 00:29
Shortcode to List Posts With Multiple Parameters
<?php
/*
Plugin Name: WPTutsPlus Post-listing shortcode
Plugin URI: http://rachelmccollin.co.uk
Description: This plugin provides a shortcode to list posts, with parameters. It also registers a couple of post types and tacxonomies to work with.
Version: 1.0
Author: Rachel McCollin
Author URI: http://rachelmccollin.co.uk
License: GPLv2
*/
<?php
add_action('admin_init', function () {
// register a new setting for "wporg" page
register_setting('wporg', 'wporg_options');
// register a new section in the "wporg" page
add_settings_section(
'wporg_section_developers',
__('The Matrix has you.', 'wporg'),
<script>
// 1. Habilitar clic derecho
(function (d) {
d.oncontextmenu = function () {
return true;
};
d.addEventListener("click", function () {
console.log("El clic derecho regresó...");
});
})(document);