####PROJECT DIRECTORY
(dir) wp-content
- all your wordpress theme files and plugins
(dir) db-content
- your sql database file to import
docker-compose.yml (code example below)
| # see all running docker containers | |
| docker ps | |
| # terminal into docker container | |
| docker exec -it container-name /bin/bash | |
| # allow larger transfers for container - eg to import larger sql file | |
| docker exec -it container_name bash -c "echo 'max_allowed_packet = 512M' >> /etc/mysql/mysql.conf.d/mysqld.cnf" | |
| docker exec -it container_name bash -c "echo 'wait_timeout = 1500' >> /etc/mysql/mysql.conf.d/mysqld.cnf" |
| <?php | |
| // example 1 | |
| $episodes = preg_grep('~^good-.*\.html$~', scandir(__DIR__)); | |
| $d = new DOMDocument; | |
| $mock = new DOMDocument; | |
| $d->loadHTML(file_get_contents(__DIR__ . '/' . end($episodes))); | |
| $body = $d->getElementsByTagName('body')->item(0); |
| ``` | |
| <?php | |
| function rmcomments($id) | |
| { | |
| if (file_exists($id)) { | |
| if (is_dir($id)) { | |
| $handle = opendir($id); | |
| while ($file = readdir($handle)) { | |
| if (($file != ".") && ($file != "..")) { |
| Original credit to renzramos/wordpress-bootstrap-4-pagination - however his only works with the main loop. Small modification. | |
| Now you can use in main query or custom wp query. | |
| ```php | |
| <?php | |
| if (!function_exists('pagination_that_doesnt_suck')) { | |
| function pagination_that_doesnt_suck($query = 0) | |
| { |