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 | |
/* Get the Page Slug to Use as a Body Class, this will only return a value on pages! */ | |
$class = ''; | |
/* is it a page */ | |
if( is_page() ) { | |
global $post; | |
/* Get an array of Ancestors and Parents if they exist */ | |
$parents = wp_get_post_parent_id( $post->ID ); | |
$id = ($parents) ? $parents: $post->ID; |
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
// STEP 1: | |
// Inside the start function, at around line 170 I commented out the assignation of the 'top' property, like this: | |
// Position Lightbox | |
var top = $window.scrollTop() + this.options.positionFromTop; | |
var left = $window.scrollLeft(); | |
this.$lightbox.css({ | |
// top: top + 'px', // comment out this line | |
left: left + 'px' | |
}).fadeIn(this.options.fadeDuration); |
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
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot DB-Name < /your/data/base/path.sql |
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
*~ | |
.DS_Store | |
.svn | |
.cvs | |
*.bak | |
*.swp | |
Thumbs.db | |
wp-config.php | |
wp-content/uploads/ | |
wp-content/blogs.dir/ |
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
$(document).ready(function(){ | |
/* Get browser */ | |
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase()); | |
/* Detect Chrome */ | |
if($.browser.chrome){ | |
/* Do something for Chrome at this point */ | |
alert("You are using Chrome!"); | |
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
// VIMEO | |
<?php | |
$url = get_field( 'full_video' ); | |
preg_match('%^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$%im', $url, $match); | |
$vimeo_id = $match[3]; | |
$data = file_get_contents("http://vimeo.com/api/v2/video/$vimeo_id.json"); | |
$data = json_decode($data); | |
?> | |
<img src="<?php echo $data[0]->thumbnail_large; ?>"> |
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
**** | |
* BEFORE COPY CODE | |
* Change this line with your desire values | |
* VALUES ('admin999', MD5('password999'), 'firstname lastname', '[email protected]', '0'); | |
**** | |
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, | |
`user_status`,`user_registered`) | |
VALUES ('admin999', MD5('password999'), 'firstname lastname', '[email protected]', '0', '2019-06-17 11:25:03'); | |
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
Using FTP/SSH & Database | |
This method allows you to delete all items in your media library at once. Be sure to backup your database prior to doing this. | |
Each file in your media library has one row in the `wp_posts` table and two rows in the `wp_postmeta` table. Learn more about how WordPress stores media library entries in the database here. You can delete them all in bulk using these commands: | |
DELETE FROM `wp_posts` WHERE `post_type` = "attachment"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attached_file"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attachment_metadata"; |
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
https://www.reviewplan.com/wp-content/uploads/2018/07/Siteground-php-version-change-edit.jpg | |
If you want to update to PHP 7.2– AddHandler application/x-httpd-php72 .php .php5 .php4 .php3 | |
For PHP 7.1– AddHandler application/x-httpd-php71 .php .php5 .php4 .php3 | |
For PHP 7.0– AddHandler application/x-httpd-php70 .php .php5 .php4 .php3 | |
For PHP 5.6– AddHandler application/x-httpd-php56 .php .php5 .php4 .php3 | |
For PHP 5.5– AddHandler application/x-httpd-php55 .php .php5 .php4 .php3 | |
So, copy and paste one of the lines from above to change the PHP version of your website. | |
For example, we have pasted the line‘AddHandler application/x-httpd-php72 .php .php5 .php4 .php3’ as we wanted to switch to PHP version 7.2 |
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
function objectToArray($d) { | |
if (is_object($d)) { | |
// Gets the properties of the given object | |
// with get_object_vars function | |
$d = get_object_vars($d); | |
} | |
if (is_array($d)) { | |
/* | |
* Return array converted to object |
OlderNewer