Websitegärtner's tool shed.

A completely disorganised collection of short technical documentation, instructions and templates for self-service. Many of the snippets helped us with web development at the time, but consider the creation date of the contributions as the best-before date, because some of them are no longer "up to date".

  • Ternary Operator ?: versus Null Coalescing Operator ?? versus Null Coalescing Assignment Operator ??= explained by cats

    In short, PHP provides two useful operators to simplify condition checking: the ternary operator (?:) and the null coalescing operator (??). Both operators are used to...

    To the article...
  • Shortcode E-Mail Obfuscator

    The following shortcode snippet is useful for disguising emails to protect them from SPAM. Please note that this method only works if Javascript is activated...

    To the article...
  • TranslatePress renders individual language selector for default language incorrectly

    Problem: When creating a custom language selector for TranslatePress: $arr = trp_custom_language_switcher(); $arr returns a multidimensional array with all the necessary parameters to create a custom language selector....

    To the article...
  • How to search only for specific content types with the Elementor search form?

    Elementor Pro has a widget called "Search form". This is suitable for the attractive design of search forms. Unfortunately, this search form is limited in its functionality. Question:...

    To the article...
  • Elementor posts widget fill with ACF relationship field

    With the posts widget in Elementor you can easily loop other posts, pages, products or custom post types (CPT) ( =...

    To the article...
  • Elementor popup / flyout menu no longer closes for mobile view

    Elementor: Version 3.72 Behaviour: An Elementor popup opens, but no longer closes (when clicking on the icon or Esc or other triggers). If you look in the...

    To the article...
  • PHPStorm: Local Changelist in Git Tool disappeared

    Problem: Local Change List under PHPStorm is missing in the Git Tool Solution: From time to time I had the phenomenon that the Local Changelist (the files in...

    To the article...
  • Variable not available in blade component

    Problem: The parameter transfer of a blade attribute does not work, the variable in the component is empty. There is no error message, but the variable does not appear to have been passed...

    To the article...
  • Tailwind Autocomplete with PHPStorm (WebStorm) does not work

    Problem: If you are creating a Laravel app, for example, and are wondering why PHPStorm or WebStorm does not support autocompletion for your CSS classes in Blade templates, you...

    To the article...
  • WP CLI Error: Error establishing a database connection.

    Appearance: Submitting commands via WP CLI, but WordPress in the browser works. This error often occurs when the WP CL interpreter is not able to recognise the database connection in wp-config.php....

    To the article...
  • Convert Px to SEM / EM very quickly with Alfred

    There is a wonderful Alfred workflow on the Mac that converts Px to Rem: Download direct link: https://raw.githubusercontent.com/vitorgalvao/requested-alfred-workflows/master/Workflows/PxRemEm.alfredworkflow Simply install, then type CMD-Space: Alfred Bar "pxrem" and...

    To the article...
  • A Git tutorial that makes it easy to understand GIT.

    A documentation of GIT version control that can be grasped very quickly through visualisation: http://marklodato.github.io/visual-git-guide/index-en.html  

    To the article...
  • Setting up XDebug with PHPStorm and Valet Development Environment

    Preparation: Homebrew should be installed Valet should be installed and running: https://laravel.com/docs/7.x/valet Browser Extension for PHPSTORM should be installed: https://www.jetbrains.com/help/phpstorm/browser-debugging-extensions.html gerry@webgarten ~ % brew install...

    To the article...
  • Installing Redmine on Ubuntu Linux (LAMP stack), all steps in the console

    Installation of redmine on Ubuntu Linux system. All steps from the history. Wherever "ERROR" appears, additional installation steps were necessary.

    To the article...
  • Shortcode for a copyright sign with current year date

    This shortcode writes the copyright sign with the current year and other info. Useful for the footer of a website.

    To the article...
  • Left "Skip to Main" (Skip to Main)

    A WordPress shortcode to display the "Jump to main content" link in a frontend area.

    To the article...
  • Show Custom Post Type in the Admin menu of another Custom Post Type.

    Insert this snippet into the CPT configuration and change it accordingly to display a CPT in another CPT. Useful for cross-references or relations between CPTs....

    To the article...
  • Hide menu item "Posts" in WordPress Admin menu

    With the help of this gist (in functions.php) you can hide the menu item "Contributions" in the admin menu.

    To the article...
  • Give WordPress Editor Customizer rights

    This snippet gives a user with the editor role the rights to change the Customizer (Design -> Customizer) settings.

    To the article...
  • Jquery snippet for WordPress admin menus: Confirmation before leaving the website

    To the article...
  • PHP error "unexpected end of file

    Troubleshooting: How to get to the bottom of the error "PHP Parse error: syntax error, unexpected end of file in ...".

    To the article...