####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)
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) | |
{ |
``` | |
<?php | |
function rmcomments($id) | |
{ | |
if (file_exists($id)) { | |
if (is_dir($id)) { | |
$handle = opendir($id); | |
while ($file = readdir($handle)) { | |
if (($file != ".") && ($file != "..")) { |
<?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); |
# 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 | |
/* Commands to create the project. */ | |
// mkdir <name> & cd <name> | |
// npm init react-app <name> | |
// cd <name> | |
// npm/yarn install | |
/* To build and deploy. */ |
# Initial Server Setup | |
- add a non root user | |
- give sudo privileges | |
- enable firewall | |
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04 | |
# Also allow http and https through the firewall | |
sudo ufw allow http | |
sudo ufw allow https |
check clear all files on C drive (keeping other drives intact).
Install chrome with powershell
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer
Run chrome and login, do not sync passwords and settings (because why taint your shiny new setup !?)
# edit the my.cnf file in /etc/mysql and add the line | |
bind-address=0.0.0.0 | |
# and if you have the line: | |
skip-networking | |
# make sure to comment it: | |
#skip-networking | |
# restart mysql | |
sudo service mysql restart |