This file contains 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
1) http://www.w3resource.com/php-exercises/php-for-loop-exercises.php | |
2) https://shafiq2410.wordpress.com/2013/09/08/draw-pyramid-shape-of-stars-in-php-using-loop-structure/ | |
3) http://www.tutorialspoint.com/php/php_object_oriented.htm | |
Commonly used WordPress plugins: | |
1) i-theme security | |
* directory permission (https://wordpress.org/support/topic/best-permissions-to-set) | |
* lockout | |
* username/password strong | |
* db/files backup |
This file contains 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
1) Use phpmyadmin > (use compressed file) > check partial import and go | |
2) Using cmd | |
C:\wamp\bin\mysql\mysql5.0.51b\bin>mysql -u root -p YourDatabaseName < YourFileName.sql | |
http://stackoverflow.com/questions/14846879/import-sql-file-by-command-line-in-windows-7 | |
3) Best - using BigDumb script | |
http://www.ozerov.de/bigdump/usage/ (Tested 118 mb data (.sql file import) in 5-10 sec) | |
4) |
This file contains 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
<!-- Create Interest Rates Dropdown. Selecting any rate will display table of that interest rate data --> | |
<select name="interestItems" id="interestItems" class="styledGrayMedium" selected="selected"> | |
<option value="All">All</option> | |
<?php | |
$rate_type_list = array(); | |
if ($xml) { | |
foreach ($xml->children() as $second_gen) { | |
foreach ($second_gen->children() as $third_gen) | |
{ | |
// 2 ways to collect different interst rate types 1) using $third_gen->type or extract from $third_gen->name |
This file contains 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 | |
// For an current page/URL is: http://mysite.com/currency-pair-detail?fullname=US Dollar / Indonesian Rupiah FX Spot Rate | |
// Feed URL logic, first check from url keywords, then check url from shortcode else set default one. | |
if (isset($_REQUEST['fullname']) && $_REQUEST['fullname']!="") { | |
// create a feed url by finding keywords from current url (fullname variable) | |
$headlines_keywords = $_REQUEST['fullname']; | |
$headlines_keywords = strstr($headlines_keywords, 'FX Spot Rate', true); | |
$headlines_keywords = str_replace(" / ",",", $headlines_keywords); | |
$headlines_keywords = str_replace(" ","%2B", $headlines_keywords); |
This file contains 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
<body> | |
<script> | |
// JS array (commodityList) to store all Commodity for autocomplete dropdown. | |
var commodityList = new Array(); | |
// JS object to store all Commodity with additional information. Useful to create form action url after submit. | |
var commodityInfo = new Object(); | |
</script> | |
<script> | |
var commodityName = "Soybeans (comp) cvoi1"; | |
var type= "Grains"; |
This file contains 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 | |
class Easy_Newsletter{ | |
// Constructor | |
function __construct() { | |
add_action( 'admin_menu', array( $this, 'easy_n_add_menu' )); | |
register_activation_hook( __FILE__, array( $this, 'easy_n_install' ) ); | |
register_deactivation_hook( __FILE__, array( $this, 'easy_n_uninstall' ) ); | |
} |
This file contains 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
1) add_image_size() doesn't generate the thumbnail, it just registers an image size as available to WordPress. so if you are using many different size of thumbnails on homepage, using add_image_size will generate a new registered size image with each post's featured image. Therefore, there will be so many images created on server. Sometimes, not all post image need to resize, so unnecessary images. | |
2) so instead of create a new sized image for every image, we can resize image on the fly. So that only certain category images that required can be resized. earlier we use timthumb for this. But it has encounterd with some vulterabilities so can not be used. Other options are | |
3) Aqua Resizer | |
4) vt_resizer (default version does not work with wp multisite, but modified scrips are available) |
This file contains 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 | |
/* =============== Starts: Shortcode to display RSS Feeds using WordPress fetch_feed() ================== */ | |
/* Shortcode Example: [news_list] | |
Example Feed URL: | |
=> 'http://online.wsj.com/xml/rss/3_8068.xml' | |
=> 'http://dealbook.nytimes.com/feed/' | |
=> 'http://www.bloomberg.com/feed/bview/' | |
*/ | |
function news_page_fx( $atts ) { | |
extract( shortcode_atts( array( |
This file contains 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 | |
/* Starts: Register Custom Post Type for tab management */ | |
function tab_type_post() { | |
$labels = array( | |
'name' => _x( 'Tab-Posts', 'post type general name' ), | |
'singular_name' => _x( 'Tab-Post', 'post type singular name' ), | |
'add_new' => _x( 'Add New', 'book' ), | |
'add_new_item' => __( 'Add New Tab-Post' ), | |
'edit_item' => __( 'Edit Tab-Post' ), |