Skip to content

Instantly share code, notes, and snippets.

Shopify Code Notes

Templates folder are for main pages it could be liquid or json file

image

/config

settings_schema.json

@anonaba
anonaba / 1readme.md
Last active November 24, 2024 07:58
WP Pages

WP Pages

  • single.php
  • singular.php
  • archive.php
  • pagination

Relationships

image

One-to-Many Relationship

image

The image depicts a "One-to-Many" relationship commonly used in database design. Here's how this relationship is represented based on the visual:

@anonaba
anonaba / _postgresql.md
Last active November 16, 2024 15:06
PostgreSQL Notes

PostgreSQL Notes

  • how to write the correct data type to a particular value?
  • PostgreSQL Commands
@anonaba
anonaba / 0sql_query_practice_note.md
Created November 13, 2024 15:33
SQL QUERY PRACTICE NOTE

SQL QUERY PRACTICE NOTE

  • CONCAT
@anonaba
anonaba / r-debug.php
Created November 10, 2024 09:42 — forked from Rarst/r-debug.php
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
@anonaba
anonaba / 1readme.md
Last active November 27, 2024 13:18
WP Funtions

WP Functions

  • Register the Navigation Menu
  • register_sidebar
  • The Loop
  • template tags
  • conditional tags
  • wp_enqueue_style
  • snippets
  • WP Query

What are the difference between relative path and absolute path

The difference between relative path and absolute path lies in how they describe the location of a file or directory within the file system.

1. Absolute Path

An absolute path specifies the full location of a file or directory, starting from the root directory (/ in UNIX-like systems, or a drive letter like C: in Windows). It provides the complete, unambiguous path to the file, regardless of the current working directory.

Example (UNIX-like system):

  • /home/user/documents/file.txt
    • This refers to a file named file.txt in the documents directory, which is inside the user directory, and the user directory is in the home directory.

Using ob_start() (Output Buffering) in PHP is not always necessary, but it can be useful in certain cases. Here's when and why you might want to use it:

When to Use ob_start()

  1. Redirects After HTML Output:

    • PHP requires headers (such as header("Location: ...")) to be sent before any HTML output. If you have already sent some HTML output and then need to redirect, ob_start() can help by buffering the output, allowing you to use header() later in the script.
    <?php
    ob_start();
@anonaba
anonaba / 1wp_esc_string.md
Last active November 3, 2024 04:48
Translated String

In WordPress, translation functions are used to make themes and plugins translatable into different languages, enabling localization and internationalization (i18n). These functions allow developers to write code that can be easily translated without altering the original code structure. Here's an overview of the most common WordPress translation functions and their uses:

1. __()

  • Use: This function is used to translate a string without displaying it immediately. It simply returns the translated text.
  • Example:
    $translated_text = __('Hello, World!', 'text-domain');
  • Explanation: The __('string', 'text-domain') function looks up the translation of the string "Hello, World!" in the specified text domain. If no translation is available, it returns the original string.