This file contains hidden or 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
| // Previous Post | |
| get_permalink(get_adjacent_post(false,'',false)); | |
| // Next Post | |
| get_permalink(get_adjacent_post(false,'',true)); |
This file contains hidden or 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
| /** | |
| * Encrypt and decrypt | |
| * | |
| * @author Nazmul Ahsan <n.mukto@gmail.com> | |
| * @link http://nazmulahsan.me/simple-two-way-function-encrypt-decrypt-string/ | |
| * | |
| * @param string $string string to be encrypted/decrypted | |
| * @param string $action what to do with this? e for encrypt, d for decrypt | |
| */ |
This file contains hidden or 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
| -- all | |
| SELECT * FROM results; | |
| -- specific columns | |
| SELECT first_name, last_name, email FROM results; | |
| -- alias | |
| SELECT name AS "Product Name", description AS "Product Description" FROM products; | |
| -- filter by condition |
This file contains hidden or 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.- Start MAMP or MAMP PRO | |
| -- 2.- Start the server | |
| -- 3.- Open Terminal (Applications -> Utilities) | |
| -- 4.- Type in: (one line) | |
| /Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot | |
| -- select database | |
| mysql> use DATABASE_NAME; | |
| -- select sql |
This file contains hidden or 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
| /* Target an element by any of its HTML attributes and values. */ | |
| div[id="container"] { | |
| max-width: 500px; | |
| margin: auto; | |
| } | |
| [class] { | |
| border: solid 1px #ccc; | |
| } |
This file contains hidden or 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
| RewriteEngine On | |
| RewriteCond %{HTTPS} off | |
| RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains hidden or 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
| // You can disable "wpautop" for the plugin by placing the following constant in wp-config.php: | |
| define( 'WPCF7_AUTOP', false ); |
This file contains hidden or 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 | |
| add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
| function new_loop_shop_per_page( $products ) { | |
| // Return the number of products you wanna show per page. | |
| $products = 6; | |
| return $products; | |
| } |
This file contains hidden or 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 | |
| // this one | |
| add_filter( 'woocommerce_show_page_title', '__return_false' ); | |
| // or this one | |
| add_filter( 'woocommerce_show_page_title' , 'woo_hide_page_title' ); | |
| function woo_hide_page_title() { | |
| return false; | |
| } |
This file contains hidden or 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 | |
| $name = 'cienciastar'; | |
| $string = "Lets display \"Hello $name!\" to the screen"; | |
| echo $string; |
NewerOlder