Skip to content

Instantly share code, notes, and snippets.

ellegaarddk ellegaarddk

Block or report user

Report or block ellegaarddk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ellegaarddk
ellegaarddk / woo_add_SKU_cat_pages
Created Oct 22, 2018
Tilføj SKU fra WooCommerce på kategorisider
View woo_add_SKU_cat_pages
/* WooCommerce - add SKU on cat pages */
add_action( 'woocommerce_after_shop_loop_item_title', 'shop_sku', 5 );
function shop_sku(){
global $product;
echo '<span itemprop="productID" class="sku">' . __('SKU', 'woocommerce'). ': ' . $product->sku . '</span>';
}
View remove_woocommerce_widgets.php
//* Remove unused Woocommerce widgets */
function eid_unregister_woo_widgets() {
// unregister_widget( 'WC_Widget_Recent_Products' );
unregister_widget( 'WC_Widget_Featured_Products' );
// unregister_widget( 'WC_Widget_Product_Categories' );
unregister_widget( 'WC_Widget_Product_Tag_Cloud' );
unregister_widget( 'WC_Widget_Cart' );
// unregister_widget( 'WC_Widget_Layered_Nav' );
// unregister_widget( 'WC_Widget_Layered_Nav_Filters' );
unregister_widget( 'WC_Widget_Price_Filter' );
@ellegaarddk
ellegaarddk / rename_CTP_title.php
Last active Oct 22, 2018
Omdøb titelfelt i Custom Post Type
View rename_CTP_title.php
function change_default_title( $title ){
$screen = get_current_screen();
if ( $screen->post_type == 'your_custom_post_type' ) {
return __( Skriv din egen tekst her', 'lang_domain' );
}
}
add_action('init', 'change_default_title');
@ellegaarddk
ellegaarddk / stopwords_DA.txt
Created Oct 4, 2018
Liste af relevante stopwords / stopord til indekseringer mm
View stopwords_DA.txt
ad, af, aldrig, alle, alt, anden, andet, andre, at, bare, begge, blev, blive, bliver, da, de, dem, den, denne, der, deres, det, dette, dig, din, dine, disse, dit, dog, du, efter, ej, eller, en, end, ene, eneste, enhver, er, et, far, fem, fik, fire, flere, fleste, for, fordi, forrige, fra, få, får, før, god, godt, ham, han, hans, har, havde, have, hej, helt, hende, hendes, her, hos, hun, hvad, hvem, hver, hvilken, hvis, hvor, hvordan, hvorfor, hvornår, i, ikke, ind, ingen, intet, ja, jeg, jer, jeres, jo, kan, kom, komme, kommer, kun, kunne, lad, lav, lidt, lige, lille, man, mand, mange, med, meget, men, mens, mere, mig, min, mine, mit, mod, må, ned, nej, ni, nogen, noget, nogle, nu, ny, nyt, når, nær, næste, næsten, og, også, okay, om, op, os, otte, over, på, se, seks, selv, ser, ses, sig, sige, sin, sine, sit, skal, skulle, som, stor, store, syv, så, sådan, tag, tage, thi, ti, til, to, tre, ud, under, var, ved, vi, vil, ville, vor, vores, være, været
@ellegaarddk
ellegaarddk / functions.php
Created Aug 23, 2018
WordPress: Remove not needed widgets from Genes framework by StudioPress
View functions.php
/**
* Unregister Genesis widgets
*
* Include in theme's functions.php or create your own functions plugin
* Comment out needed widgets
*/
function eid_rem_genesis_widgets() {
unregister_widget( 'Genesis_eNews_Updates' );
// unregister_widget( 'Genesis_Featured_Page' );
// unregister_widget( 'Genesis_Featured_Post' );
@ellegaarddk
ellegaarddk / remove_widgets.php
Created Aug 23, 2018
WordpRess: Remove not needed widgets from backend
View remove_widgets.php
/*
* Remove unneccesary default widgets from backend
* Comment out what you wish to see
*/
function unregister_default_widgets() {
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
@ellegaarddk
ellegaarddk / URL_change.sql
Last active Apr 22, 2018
Skift af URL til https
View URL_change.sql
##Ret prefix og domæner!!!!
UPDATE wp_posts SET post_content = replace(post_content, 'http://domain.dk', 'https://domain.dk');
UPDATE wp_posts SET guid = REPLACE (guid, 'http://domain.dk', 'https://domain.dk') WHERE post_type = 'attachment';
UPDATE wp_comments SET comment_author_url = replace(comment_author_url, 'http://domain.dk', 'https://domain.dk');
UPDATE wp_comments SET comment_content = replace(comment_content, 'http://domain.dk', 'https://domain.dk');
@ellegaarddk
ellegaarddk / functions.php
Created Dec 15, 2017
Tilføjer 'Udsolgt label til WooCommerce
View functions.php
// Adds 'Udsolgt' label to produkts out of stock
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_stock', 10);
function woocommerce_template_loop_stock() {
global $product;
if ( ! $product->managing_stock() && ! $product->is_in_stock() )
echo '<p class="stock out-of-stock">Udsolgt</p>';
}
@ellegaarddk
ellegaarddk / remove-metainfo-on-posts.php
Last active May 29, 2017
Wordpress Genesis - change / remove meta info pon posts
View remove-metainfo-on-posts.php
<?php
/** Customise the post-info function */
add_filter( 'genesis_post_info', 'genesischild_post_info' );
function genesischild_post_info($post_info) {
if (!is_page()) {
$post_info = 'Posted on [post_date] Written by [post_author] [post_comments] [post_edit]'; //Edit to relevant text
//$post_info = ''; //To remove text
return $post_info;
}
}
@ellegaarddk
ellegaarddk / optimized.htaccess
Last active Jun 22, 2019
Optimised htaccess for WP - expires, headers and deflate
View optimized.htaccess
# Optimized expire cache and compression
# For WordPress
# by ellegaard ID
# Insert above default WP section in .htaccess - use with caution!
# BEGIN Manual editing for speed
## BEGIN Expire headers
<ifModule mod_expires.c>
AddType application/font-sfnt otf ttf
AddType application/font-woff woff
You can’t perform that action at this time.