Skip to content

Instantly share code, notes, and snippets.

@gitussr
gitussr / readme.md
Last active December 9, 2023 12:53
SQL CRUD process

INSERT QUERY

To insert data into a table, you can use the INSERT INTO statement. Here's an example:

INSERT INTO table_name (column1, column2, column3)
VALUES (value1, value2, value3);

For instance, if you have a table called customers with columns id, name, and email, and you want to insert a new customer, the SQL code would look like this:

/*
Crunchify Tips - Clean up WordPress Header START
The crunchify_remove_version() function is a WordPress function that removes the WordPress version number from the header of a WordPress site. This can be useful for security purposes, as it makes it more difficult for attackers to determine what version of WordPress a site is running. The function works by adding a filter to the the_generator hook, which is responsible for outputting the WordPress version number. The filter simply returns an empty string, which effectively removes the version number from the header.
The rest of the code in the snippet removes various other unnecessary elements from the header of a WordPress site. These elements include:
* The emoji detection script
* The emoji styles
* The REST API output link
@gitussr
gitussr / index.php
Created July 6, 2023 13:51
ACF Group Repeater Loop
<?php if ( ! have_rows( 'services' ) ) { return false; } ?>
<?php if ( have_rows( 'services' ) ) : ?>
<?php while ( have_rows( 'services' ) ) : the_row(); ?>
<?php if ( have_rows( 'services_list' ) ) : ?>
<?php
@gitussr
gitussr / template-upcoming-tour.php
Created July 6, 2023 11:08
Upcoming Tour ASC order according to ACF Date Picker Field
$current_date = date('Ymd'); // Get the current date in the format YYYYMMDD
$args = array(
'post_type' => 'tour',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'travel_date', // ACF field name
'value' => $current_date,
'compare' => '>=', // Filter tours with travel_date greater than or equal to the current date