Skip to content

Instantly share code, notes, and snippets.

View itcomindo's full-sized avatar
🎯
Focusing

Budi Haryono itcomindo

🎯
Focusing
View GitHub Profile
@itcomindo
itcomindo / .htaccess
Created October 11, 2022 03:48 — forked from seoagentur-hamburg/.htaccess
UPDATE 2022/10: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.6 - 10/2022
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@itcomindo
itcomindo / auto-set-featured-image.php
Created July 15, 2022 07:01 — forked from rveitch/auto-set-featured-image.php
Automatically Set the Featured Image in WordPress from the first image in the post
<?php
// Add Meta Box to post
add_action('admin_init', 'single_rapater_meta_boxes', 2);
function single_rapater_meta_boxes() {
add_meta_box( 'single-repeter-data', 'Single Rapeter', 'single_repeatable_meta_box_callback', 'post', 'normal', 'default');
}
function single_repeatable_meta_box_callback($post) {
@itcomindo
itcomindo / WordPress Repeater MetaBox.php
Created June 20, 2022 03:42 — forked from akshuvo/WordPress Repeater MetaBox.php
Creating a “repeater meta-box” without a Plugin in WordPress
<?php
add_action('admin_init', 'gpm_add_meta_boxes', 2);
function gpm_add_meta_boxes() {
add_meta_box( 'gpminvoice-group', 'Custom Repeatable', 'Repeatable_meta_box_display', 'page', 'normal', 'default');
}
function Repeatable_meta_box_display() {
global $post;
$gpminvoice_group = get_post_meta($post->ID, 'customdata_group', true);
@itcomindo
itcomindo / gist:1120891495a42d14977cf87d4a0dd08f
Created June 14, 2022 13:49 — forked from simplistik/gist:2001897
htaccess: Force PDF download
<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
@itcomindo
itcomindo / basic_wp_query.php
Created June 11, 2022 10:00
basic_wp_query
<div class="prq">
<?php
# ARGUMEN START
$args = array (
'post_type' => 'post',
'posts_per_page' => 5,
'order' => 'ASC'
);
<?php
/*
* Source: https://gist.github.com/HechtMediaArts/aceadf06b5e4431dc33d
*/
//emoji aus dem header entfernen
function disable_emoji_dequeue_script() {
wp_dequeue_script( 'emoji' );
}
add_action( 'wp_print_scripts', 'disable_emoji_dequeue_script', 100 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
@itcomindo
itcomindo / basic.css
Last active May 31, 2022 05:56
My Basic CSS
p { margin-top:6px; margin-bottom:6px;}
.bgwa,
.wabg {
background-color:darkgreen;
}
.bgcall,
.callbg {
background-color: darkred;
@itcomindo
itcomindo / dosu.php
Created May 28, 2021 02:17 — forked from karthikax/dosu.php
PHP Download file to server from URL
<html>
<p style="width: 70%;margin: auto;margin-top: 5%;font-size:larger;text-align:center">
Download a file from any URL</p>
<form method="post" style="width: 70%;margin: auto;margin-top: 10%;">
<input name="url" size="50" placeholder="Source URL" style="width: 100%;height: 10%;font-size: 1.5em;padding:10px" required>
<input name="submit" type="submit" value="Download" style="width: 30%;height: 10%;margin: 5% auto; display: block;">
<p style="width: 70%;margin: auto;margin-top: 10%;font-size:larger;text-align:center">
To <?php echo getcwd(); ?></p>
<p style="width: 70%;margin: auto;font-size: smaller;text-align: center;position: fixed;bottom: 0;background: #fff;">
Powered by: <a href="https://karthikbhat.net/portfolio" target="_blank" style="color:#f60;text-decoration:none;">Karthik</a></p>