Skip to content

Instantly share code, notes, and snippets.

@aabergkvist
aabergkvist / nmigrate.php
Created September 10, 2016 09:36
Create a Wordpress page listing all of the websites URL:s and titles.
<?php
include "wp-load.php";
$posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish');
$posts = $posts->posts;
header('Content-type:text/plain');
foreach($posts as $post) {
switch ($post->post_type) {
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
<img src=”https://xxx.salesforce.com/servlet/servlet.ImageServer?
id=00000000000pwc&oid=00DD0000000FHaG&lastMod=000000000000" alt=”header background” 
height=”220" width=”350"/>
@aabergkvist
aabergkvist / [WP][Genesis]Add author box on SP
Created January 29, 2016 19:13
Lägg till författarbox single posts i Genesis
<?php
//* Do NOT include the opening php tag
//* Add the author box on single posts
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
/* Call-to-action Menu Link
--------------------------------------------- */
.genesis-nav-menu li.highlight a {
background-color: #e5554e;
border-radius: 3px;
color: #fff;
margin-left: 20px;
}
@aabergkvist
aabergkvist / [WP][Genesis]Move primary nav to header
Last active January 29, 2016 19:11
Flytta primary nav till site-header i Genesis
<?php
//* Do NOT include the opening php tag
//* Reposition the primary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_header', 'genesis_do_nav', 12 );
@aabergkvist
aabergkvist / [WP][Genesis]Google Fonts
Last active September 22, 2017 11:33
Google Fonts i Genesis
<?php
//* Do NOT include the opening php tag
//* Load Google Fonts
add_action( 'wp_enqueue_scripts', 'ab_load_google_fonts' );
function ab_load_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:400,700|Neuton:400', array(), CHILD_THEME_VERSION );
@aabergkvist
aabergkvist / [WP][Genesis]Structural Wraps
Created January 29, 2016 19:10
Structural wraps i Genesis
<?php
//* Do NOT include the opening php tag
//* Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'site-inner',
'footer-widgets',
'footer'
@aabergkvist
aabergkvist / [WP][Genesis]Remove sidebars
Created January 29, 2016 19:09
Ta bort primär & sekundär sidebar i Genesis
<?php
//* Do NOT include the opening php tag
//* Remove the primary and secondary sidebar
unregister_sidebar( 'sidebar' );
unregister_sidebar( 'sidebar-alt' );
@aabergkvist
aabergkvist / [WP][Genesis]Entry image b4 entry title
Last active September 22, 2017 11:34
Lägg till entry image före title
<?php
//* Do NOT include the opening php tag
//* Add entry image before entry title
add_action( 'genesis_entry_header', 'ab_entry_image', 1 );
function ab_entry_image() {
if ( is_page() || ! genesis_get_option( 'content_archive_thumbnail' ) )
return;
if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'entry-image' ) ) ) ) {
printf( '<a href="%s" rel="bookmark"><img class="aligncenter entry-image" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );