Skip to content

Instantly share code, notes, and snippets.

View OscarAbadFolgueira's full-sized avatar

Oscar Abad Folgueira OscarAbadFolgueira

View GitHub Profile
@OscarAbadFolgueira
OscarAbadFolgueira / external_database.php
Created December 21, 2015 19:55 — forked from MrSaints/external_database.php
A custom database class to demonstrate how WordPress' wpdb class can be instantiated and extended to allow you to connect to another / an external or secondary database. The global $wpdb object is only capable of communicating with the WordPress database. Refer to http://codex.wordpress.org/Class_Reference/wpdb for more information.
<?php
/*
The MIT License (MIT)
Copyright © 2014 Ian Lai
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@OscarAbadFolgueira
OscarAbadFolgueira / Wordpress Number of Posts Per Page
Last active February 23, 2016 14:27
This WordPress code snippet set the number of posts per pages depending the page
/**
* This WordPress code snippet set the number of posts per pages depending the page
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the number of posts per page on each case.
*/
@OscarAbadFolgueira
OscarAbadFolgueira / add_checkout_top_text.php
Created February 23, 2016 18:20
WooCommerce Snippet: Añadir texto o html en la parte superior del checkout (finalizar compra)
/**
* This WordPress code snippet adds some text or html at the top of the checkout page of your WooCommerce
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*/
add_action( 'woocommerce_before_checkout_form', 'add_checkout_top_text', 11 );
@OscarAbadFolgueira
OscarAbadFolgueira / woocommerce_order_product_tabs.php
Last active March 28, 2019 12:07
This WordPress code snippet change de order of the woocommerce product tabs in products pages.
/**
* This WordPress code snippet change de order of the woocommerce product tabs in products pages.
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin.
*/
add_filter( 'woocommerce_product_tabs', 'oaf_wc_change_tabs_order', 20 );
@OscarAbadFolgueira
OscarAbadFolgueira / oaf_wc_change_product_tabs_titles.php
Last active February 27, 2016 11:06
Woocommerce code snippet change the product tabs titles
<?php
/**
* This WordPress/Woocommerce code snippet change the product tabs titles
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the tabs titles your needs.
@OscarAbadFolgueira
OscarAbadFolgueira / oaf_wc_chage_add_to_cart_text.php
Created February 27, 2016 12:23
WordPress WooCommerce Snippet that change the text "Add to cart".
<?php
/**
* This WordPress / Woocommerce code snippet change the "Add to cart" text.
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the text for your needs.
@OscarAbadFolgueira
OscarAbadFolgueira / oaf_wp_set_minimal_lengh_for_comments.php
Created February 27, 2016 14:16
WordPress Snippet to set the minimum length for comments
<?php
/**
* This WordPress / Woocommerce code snippet set the minimum length for comments.
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the number of characters to your needs.
@OscarAbadFolgueira
OscarAbadFolgueira / oaf_wp_redirect_new_registered_users_to_page.php
Created February 29, 2016 20:30
Wordpress Snippet: Redirigir nuevos usuarios registrados a una página específica
<?php
/**
* This WordPress code snippet redirect new registered users to specific page.
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the url of the page to your needs.
@OscarAbadFolgueira
OscarAbadFolgueira / oaf_change_login_logo.php
Created March 5, 2016 18:04
WordPress Snippet: Cambiar el logo del accedo a la administración.
<?php
/**
* This WordPress code snippet change the login logo of your WordPress site.
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the url of the logo image to your needs.
@OscarAbadFolgueira
OscarAbadFolgueira / oaf_change_login_logo_url.php
Created March 6, 2016 19:54
WordPress Snippet: Cambiar la url del logo de login
<?php
/**
* This WordPress code snippet change the url of the login logo of your WordPress site.
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the url to your needs.