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 / 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 / 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 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 / 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 / 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 / create_product_cpt
Created Oct 22, 2018
Opret Custom Post Type til produkter
View create_product_cpt
function eid_cpt_produkt() {
$labels = array(
'name' =&gt; _x( 'Produkter', 'Post Type General Name', 'eid_domain' ),
'singular_name' =&gt; _x( 'Produkt', 'Post Type Singular Name', 'eid_domain' ),
'menu_name' =&gt; __( 'Produkter', 'eid_domain' ),
'parent_item_colon' =&gt; __( 'Produkt over:', 'eid_domain' ),
'all_items' =&gt; __( 'Alle produkter', 'eid_domain' ),
'view_item' =&gt; __( 'Vis produkt', 'eid_domain' ),
@ellegaarddk
ellegaarddk / slider_cpt.php
Created Oct 22, 2018
creating custom post type for frontpage slider
View slider_cpt.php
<?php
/* creating custom post type for frontpage slider
* By ellegaard ID - www.eid.dk
*/
add_action('init', 'create_frontpagepic');
function create_frontpagepic() {
$feature_args = array(
'labels' => array(
'name' => __( 'Forsidebilleder' ),
@ellegaarddk
ellegaarddk / woo_change_tab_titel_desc.php
Last active Nov 2, 2018
Change Woocommerce description tab title to product name
View woo_change_tab_titel_desc.php
<?php
// This wil cheange the title (Description) of the description tab to product name
add_filter( 'woocommerce_product_tabs', 'eid_change_product_description_tab_title', 10, 1 );
function eid_change_product_description_tab_title( $tabs ) {
global $post;
if ( isset( $tabs['description']['title'] ) )
$tabs['description']['title'] = $post->post_title;
return $tabs;
}
@ellegaarddk
ellegaarddk / change_product_description_tab_title.php
Last active Nov 2, 2018
This will change the title (Description) of the description tab to something else - here 'Event information'. Use a suitable txt_domain for translations.
View change_product_description_tab_title.php
<?php
/* This will change the title (Description) of the description tab to something else
* @origin https://wp-pro.dk/guides/tilpas-woocommerce-faneblades-titel-og-overskrift
*/
add_filter( 'woocommerce_product_tabs', 'eid_change_product_description_tab_title', 10, 1 );
function eid_change_product_description_tab_title( $tabs ) {
global $post;
if ( isset( $tabs['description']['title'] ) )
$tabs['description']['title'] = __('Event information', 'txt_domain'); // change for something else, ready for translation
@ellegaarddk
ellegaarddk / functions.php
Created Nov 2, 2018
Special functions for this website that shouldn't be put in the child theme
View functions.php
<?php
/*
Plugin Name: Functions for my website
Plugin URI: https://wp-pro.dk/lav-dit-eget-funktionsplugin/
Description: Special functions for this website without their own plugin
Version: 1.5
Author: Ellegaard ID
Author URI: http://www.eid.dk
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
You can’t perform that action at this time.