Skip to content

Instantly share code, notes, and snippets.

View josanua's full-sized avatar
🎯
Focusing

Andrew josanua

🎯
Focusing
View GitHub Profile
@josanua
josanua / php-ini-solved.txt
Last active November 22, 2023 07:53
php ini file
https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors
#Wordpress update
#Upgrade stalls at ‘unpacking the update’
max_execution_time=60
#Import file size limit in PHPMyAdmin
upload_max_filesize
@josanua
josanua / wp-admin.php
Last active January 25, 2024 23:54
wp admin helper
<?php
https://developer.wordpress.org/reference/functions/add_menu_page/
add_menu_page( string $page_title, string $menu_title, string $capability, string $menu_slug, callable $function = '', string $icon_url = '', int $position = null );
/**
* Reset posts counts only for current users
*/
https://wordpress.stackexchange.com/questions/49154/hide-other-users-posts-in-admin-panel
@josanua
josanua / wp-cli-helper.php
Last active September 6, 2025 06:20
wp cli
<?php
// installing
https://make.wordpress.org/cli/handbook/guides/installing/\
https://deliciousbrains.com/complete-guide-to-installing-wp-cli/
// https://www.youtube.com/watch?v=O_LoQ0WC7DQ
//--> The Complete Guide to Installing WP-CLI
https://deliciousbrains.com/complete-guide-to-installing-wp-cli/#verifying-wp-cli
@josanua
josanua / wp-hooks.php
Last active November 10, 2024 22:28
wp hooks
<?php
/**
*
* The WordPress Hooks
*
*/
https://kinsta.com/blog/wordpress-hooks/
// loading order
@josanua
josanua / wp-query-arguments.php
Last active January 5, 2024 09:30
wp query arguments
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
https://clubmate.fi/an-in-depth-look-into-the-wp_query-and-a-wordpress-loop/
@josanua
josanua / wp-db.php
Last active October 21, 2025 08:26
wp db
<?php
/************ Work with Database in WP ************/
// interesting facts about DB, The WordPress Database Structure
// one-to-many relationships.
https://code.tutsplus.com/tutorials/understanding-and-working-with-data-in-wordpress--cms-20567
// official docs
https://codex.wordpress.org/Database_Description
@josanua
josanua / wp-robots.txt
Last active August 25, 2019 06:52 — forked from intelliweb/default_wp_robots.txt
robots.txt file for WP
User-agent: *
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
Disallow: /wp-includes/js
Disallow: /trackback
Disallow: /category/*/*
Disallow: */trackback
@josanua
josanua / htacces.txt
Last active June 29, 2023 14:18
htacces - Godaddy
#https://uk.godaddy.com/help/redirect-http-to-https-for-wordpress-on-linux-27904
#For Linux host
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
// For http to https redirect (work on bluehost)
RewriteCond %{HTTPS} !=on
@josanua
josanua / wp-header.php
Last active December 19, 2019 09:00
wp-header-helper
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="https://gmpg.org/xfn/11">
<!-- Open Graph data -->
<meta property="og:locale" content="en_US">
@josanua
josanua / class-wp-bootstrap-navwalker.php
Last active August 4, 2022 23:50
walker-bs4-class
<?php
// Documentation
https://codex.wordpress.org/Class_Reference/Walker
https://code.tutsplus.com/tutorials/understanding-the-walker-class--wp-25401
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-walker.php
https://www.smashingmagazine.com/2015/10/customize-tree-like-data-structures-wordpress-walker-class/#top
Instructions https://github.com/wp-bootstrap/wp-bootstrap-navwalker