Skip to content

Instantly share code, notes, and snippets.

View stebrech's full-sized avatar

Stefan Brechbühl stebrech

View GitHub Profile
@betojsx
betojsx / custom-post-type-in-author-archive
Last active July 14, 2022 15:46
Display Custom Post Type in Author Archive WordPress
// In functions.php, add:
<?php
function post_types_author_archives($query) {
if ($query->is_author)
// Add 'books' CPT and the default 'posts' to display in author's archive
$query->set( 'post_type', array('books', 'posts') );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
1. Highlight a recommended option,

2. Allow users to switch currency (€/$/£)

3. Allow users to switch pricing monthly/yearly

4. Keep the entire pricing plan area clickable

5. Use slider to calculate how much a user would save

6. Provide free first month for good engagement

7. Prominently highlight testimonials prominently

8. Repeating call to action on top and bottom

9. Sell benefits instead of features

10. Indicate that users can cancel any time

@lukas-h
lukas-h / license-badges.md
Last active May 14, 2024 18:38
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@neverything
neverything / comopser-wp-cli.md
Last active December 7, 2021 07:42
Install composer and wp-cli on cyon.ch hostings with SSH access.

Cyon.ch/Hostpoint - Install composer & wp-cli

SSH into your server and stay in the home directory of the user. Check if you have a bin directory in your user directory already, in case you do, omit the mkdir bin.

Use bin folder in $HOME for user scriptsr

For the commands to be loaded from the bin directory run echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc. For the new config to be used run source ~/.bashrc or close and reopen your SSH session.

Composer

@kevinwhoffman
kevinwhoffman / responsive-images-notes.md
Last active May 18, 2020 13:31
WordPress 4.4 Responsive Images Notes

Notes and Resources for Responsive Images in WordPress 4.4

Following the addition of responsive images support in WordPress 4.4, there has been a lot of confusion over what WordPress does "automatically" and what is left up to the developer. I've gathered the following notes from chatting with members of the core team and also my own investigation of the 4.4 source. Here's what I've discovered:

  • Following the 4.4 update, WordPress automatically serves the following images responsively:

    • Content images added via the main content editor will now be served with srcset markup. This is accomplished by filtering the_content() prior to display, which means it applies to existing posts and new posts going forward.
    • Featured images called by the_post_thumbnail() also get srcset markup without any additional steps required.
  • Images that are referenced from custom fields will not be served responsively unless the theme calls the image via wp_get_attachment_image() OR constructst the responsive m

@ericandrewlewis
ericandrewlewis / a.md
Last active October 27, 2020 18:44
The WordPress Customizer

The WordPress Customizer

The WordPress Customizer is an interface for drafting changes to content while previewing the changes before they are saved. This is an alternative to the "save and suprise" model of changing settings without knowing what exactly will happen.

The customizer can be accessed in the admin interface under Appearance > Customize.

A screenshot of the customizer

#19909 is the trac ticket that introduced the Customizer during the 3.4 release cycle.

@zottto
zottto / .htaccess
Last active December 7, 2018 11:20
Mehr Sicherheit in WordPress durch .htaccess
# Beispiel-Codeschnipsel für die WordPress-htaccess-Datei
# https://www.wp-sicherheit.info
# Marc Nilius, info@wp-sicherheit.info
# Mit Material von Zodiac1978, siehe auch https://gist.github.com/Zodiac1978/d25a8f3aebba7cd1c01c
#
# Diese Codeschnipsel gehören in die .htaccess-Datei im Hauptverzeichnis von WordPress
# Jeder einzelne Bestandteil kann einzeln kopiert und genutzt werden.
# Bitte die Verwendungshinweise (Kommentare) an jedem Schnipsel beachten
anonymous
anonymous / Menu-toggle-svg-animation.markdown
Created December 9, 2014 08:35
Menu toggle svg animation
@sergejmueller
sergejmueller / .htaccess
Last active June 16, 2016 08:34
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Apache
<FilesMatch "\.(txt|log|xml|css|js)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
@grappler
grappler / functions.php
Last active January 21, 2017 08:06
// add ie conditional html5 shim to header
<?php
// add ie conditional html5 shim to header
function _s_add_ie_html5_shim () {
echo '<!--[if lt IE 9]>';
echo '<script src="' . get_template_directory_uri() . '/js/html5.js"></script>';
echo '<![endif]-->';
}
add_action('wp_head', '_s_add_ie_html5_shim');