Skip to content

Instantly share code, notes, and snippets.

View Mativve's full-sized avatar
⌨️
Coding is my life.

Mateusz Świder Mativve

⌨️
Coding is my life.
  • Poland
  • 19:28 (UTC +01:00)
View GitHub Profile
@Mativve
Mativve / watermarked.php
Created January 15, 2020 09:14
Wordpress Watermark system (use Regenerate Thumbnail after apply)
<?php
//
// Source: https://wordpress.org/support/article/debugging-in-wordpress/
//
function register_watermarked_size() {
add_theme_support( 'post-thumbnails' );
add_image_size( 'watermarked', 550, 550, true );
}
@Mativve
Mativve / index.html
Created April 1, 2020 05:37
It's part of filesystem in Electron
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
@Mativve
Mativve / index.js
Created April 1, 2020 05:38
It's main file of electron filesystem.
const { app, BrowserWindow } = require('electron');
function createWindow (){
// Create the browser window.
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
@Mativve
Mativve / add-wordpress-settings-page.php
Created January 21, 2021 17:12 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@Mativve
Mativve / functions.php
Last active April 16, 2021 18:40
WordPress adding custom columns to custom post types
<?php
// Add the custom columns to the book post type:
add_filter( 'manage_<post_type>_posts_columns', 'set_custom_edit_<post_type>_columns' );
function set_custom_edit_<post_type>_columns($columns) {
unset( $columns['author'] );
$columns['column_name'] = __( 'Column name', 'text-domain' );
return $columns;
}
@Mativve
Mativve / functions.php
Last active June 29, 2021 10:50
Yoast SEO Show all product category & shop page in product category
<?php
//
// Yoast SEO Show all product category & Shop page in product category
//
function wpseo_show_all_categories( $this_crumbs ){
if( is_product() ){
$last = $this_crumbs[ count($this_crumbs)-1 ];
$terms = get_the_terms( $last['id'], 'product_cat' );
@Mativve
Mativve / functions.php
Created August 18, 2021 16:31
This code disable the block editor
<?php
//
// ByeByeGutenberg
//
// Disables the block editor from managing widgets in the Gutenberg plugin.
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false', 100 );
// Disables the block editor from managing widgets.
add_filter( 'use_widgets_block_editor', '__return_false' );
?>
@Mativve
Mativve / README.md
Last active October 1, 2021 22:22
WordPress - mapa kontaktów z podziałem na województwa

Skrypt ten dodajemy albo do swojego motywu w pliku functions.php lub przy pomocy wtyczki, która rozszerza taką możliwość np.: https://pl.wordpress.org/plugins/my-custom-functions/

Mapkę umieszczamy w treści strony/posta przy pomocy odpowiednich shortcode'ów w następujący sposób:

[map]
[card title="Oddział Główny" name="Adam Kowalski" phone="000-111-222" email="[email protected]" address="Warszawska XYZ abc" wojewodztwo="małopolskie"]
[card title="Oddział Główny" name="Andrzej Jędrzej" phone="111-111-222" email="[email protected]" address="Prosta 12/3" wojewodztwo="małopolskie"]
[card name="Michał Nowak" phone="111-222-000" email="[email protected]" address="Krakowska XYZ abc" wojewodztwo="pomorskie"]
@Mativve
Mativve / WordPress Theme Customizer Sample.php
Last active September 13, 2022 18:29 — forked from Abban/WordPress Theme Customizer Sample.php
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@Mativve
Mativve / style.css
Created October 10, 2022 11:11
OceanWP naprawa wysokości zdjęć i kategorii
.product-category a:empty{
display:none !important;
}
.image-wrap{
height:300px;
}
.image-wrap .woo-entry-image, .product-category .woo-entry-image{
height:300px;
}
.image-wrap .woo-entry-image > a:first-child, .product-category .woo-entry-image > a:first-child{