Skip to content

Instantly share code, notes, and snippets.

@ercanertan
ercanertan / functions.php
Created January 6, 2023 18:20 — forked from yoren/functions.php
Parent Post From Another Post Type And A New URL Structure In WordPress
<?php
// Flush rewrite rules after switch theme
function my_rewrite_flush() {
flush_rewrite_rules();
}
add_action( 'after_switch_theme', 'my_rewrite_flush' );
// A little help so we can get the stylesheet from parent theme
// Remove line 10-19 if this is not a child theme
function my_enqueue_styles() {
@ercanertan
ercanertan / instructions.md
Created February 26, 2022 18:44 — forked from ju5t/instructions.md
Livewire enabled TinyMCE blade component

Instructions

This is a very basic TinyMCE component. It uses 'entangle'. This allows you to link a Livewire and Alpine property to eachother. If one value changes, the other does too.

Installation

Add tinymce.blade.php to views/components/input. This can be another component folder too if you prefer, but keep in mind that you should also

@ercanertan
ercanertan / Fetch_example.md
Created June 23, 2021 20:02 — forked from jimgwhit/Fetch_example.md
Fetch simple example

Just test data and uptating one field using put:

    document.getElementById('submitBtn').addEventListener('click', submitPost);
    function submitPost(e) {
        e.preventDefault();
        const data = {petid: document.getElementById('petid').value,
            species: document.getElementById('species').value,
            _token: document.getElementsByName("_token")[0].value,
            _method: document.getElementsByName("_method")[0].value};
@ercanertan
ercanertan / whm-change-document-root.md
Created July 14, 2017 10:21 — forked from Bodom78/whm-change-document-root.md
WHM/cPanel - Changing an accounts document root

To properly edit an accounts DocumentRoot go to /var/cpanel/userdata/username/ (replace username with the actual cPanel username for the account), then edit the file domain.com (where domain.com is your primary domain name).

You will see something like this in that file:

documentroot: /home/username/public_html

You will also see the cgi-bin area in this section:

scriptalias: