This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php.ini / php configuration option | |
search in file and change: | |
post_max_size | |
upload_max_filesize | |
optional: | |
memory_limit | |
restart apache service and there you go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register Custom Post Type | |
function custom_post_type() { | |
$labels = array( | |
'name' => _x( 'Post Types', 'Post Type General Name', 'text_domain' ), | |
'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'text_domain' ), | |
'menu_name' => __( 'Post Types', 'text_domain' ), | |
'name_admin_bar' => __( 'Post Type', 'text_domain' ), | |
'archives' => __( 'Item Archives', 'text_domain' ), | |
'attributes' => __( 'Item Attributes', 'text_domain' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $wp; | |
$current_url = home_url(add_query_arg(array(),$wp->request)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: Leon Beilis | |
* Desription: A Program that asks for two dotes | |
* and calculate their distance on the Coordinate system | |
* by known math formula | |
*/ | |
import java.util.Scanner; | |
public class Line { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Search by Post Title | |
function search_by_title_only( $search, &$wp_query ) | |
{ | |
global $wpdb; | |
if ( empty( $search ) ) | |
return $search; // skip processing - no search term in query | |
$q = $wp_query->query_vars; | |
$n = ! empty( $q['exact'] ) ? '' : '%'; | |
$search = ''; | |
$searchand = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== SQL Snippets == | |
-- Lesson1 | |
-- show all | |
SELECT * FROM {{table_name}}; | |
-- select more then 1 column | |
SELECT name, imdb_rating FROM movies; | |
-- create table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* check recursive array and spot the diffrence | |
* @param $_first_array | |
* @param $_second_array | |
* @return array | |
*/ | |
private function recursive_array_check($_first_array, $_second_array) { | |
$diff = []; | |
foreach($_first_array as $k => $v) { | |
if(is_array($v) && isset($_second_array[$k])){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add the following attribute: | |
allow="autoplay; encrypted-media" | |
example: | |
<iframe width="100%" src="https://www.youtube.com/embed/hCgokw_cmxA?modestbranding=1&autoplay=1&showinfo=0&controls=0&playlist=hCgokw_cmxA&loop=1" allow="autoplay; encrypted-media" frameborder="0" allowfullscreen=""></iframe> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######### CRUNCHIFY SETTING - START ########## | |
Options All -Indexes | |
# Disable ETags | |
<IfModule mod_headers.c> | |
Header unset ETag | |
Header set Connection keep-alive | |
</IfModule> | |
FileETag None | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_acf_init() { | |
acf_update_setting('google_api_key', 'api key here'); | |
} | |
add_action('acf/init', 'my_acf_init'); |
OlderNewer