Skip to content

Instantly share code, notes, and snippets.

View gmmedia's full-sized avatar

Jochen Gererstorfer gmmedia

View GitHub Profile
@gmmedia
gmmedia / German Stopwords - Deutsche Stop Wörter
Created February 11, 2021 16:46
Stop Wörter für SEO und Crawling
ab
aber
abermaliges
abermals
abgerufen
abgerufene
abgerufener
abgerufenes
abgesehen
acht
@gmmedia
gmmedia / Custom Post Type Landingpage
Last active March 11, 2023 10:07
Landingpage Abschnitt in WordPress
<?php
/**
* Custom Post Type: Landingpages.
* Add to your functions.php
*/
function cptui_register_my_cpts_landingpage() {
/**
* Post Type: Landingpages.
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:07
Astra Theme: Display last modified and publisheddate in the post metadata.
<?php
/**
* Astra Theme: Display last modified and published date in the post metadata.
* See: https://j0e.org/astra-tipps-tricks/
*/
function j0e_post_date( $output ) {
$output = '';
$format = apply_filters( 'astra_post_date_format', '' );
$published_date = esc_html( get_the_date( $format ) );
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:06
Add featured image column to WP admin panel - posts AND pages
<?php
/**
* Add featured image column to WP admin panel - posts AND pages
* See: https://bloggerpilot.com/featured-image-admin/
*/
// Set thumbnail size
add_image_size( 'j0e_admin-featured-image', 60, 60, false );
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:05
WordPress: Wiederverwendbaren Block erstellen
<?php
function j0e_register_block_patterns() {
if ( class_exists( 'WP_Block_Patterns_Registry' ) ) {
register_block_pattern(
'j0e-header-pattern',
array(
'title' => __( 'Überschrift', 'j0e-patterns' ),
@gmmedia
gmmedia / functions.php
Last active January 17, 2024 13:56
Enable Gutenberg editor for WooCommerce
<?php
// Find the description at https://bloggerpilot.com/en/gutenberg-for-woocommerce/
// Disable new WooCommerce product template (from Version 7.7.0)
function bp_reset_product_template($post_type_args) {
if (array_key_exists('template', $post_type_args)) {
unset($post_type_args['template']);
}
return $post_type_args;
}
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:04
WordPress: Remove unwonted image sizes, like medium_large, 1536x1536, 2048x2048
<?php
/*
* WordPress: Remove unwonted image sizes.
* In this code I remove the three sizes medium_large, 1536x1536, 2048x2048
* See full article:
*/
add_filter('intermediate_image_sizes', function($sizes) {
return array_diff($sizes, ['medium_large']); // Medium Large (768 x 0)
@gmmedia
gmmedia / page-tools.php
Last active June 22, 2021 14:55
Kadence page template wp_footer
<?php
/**
* Template Name: Tools
*
* @package kadence
*/
namespace Kadence;
@gmmedia
gmmedia / page-something.php
Last active October 8, 2021 23:50
Kadence page template with the_content
<?php
/**
* Template Name: something
*
* @package kadence
*/
namespace Kadence;
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:04
Add alt tag to WordPress Gravatar images
<?php
// Add alt tag to WordPress Gravatar images
// Full how-to: https://bloggerpilot.com/gravatar-alt-tag/
function bloggerpilot_gravatar_alt($bloggerpilotGravatar) {
if (have_comments()) {
$alt = get_comment_author();
}
else {
$alt = get_the_author_meta('display_name');