Das Open Graph-Protokoll ermöglicht es, dass jede Webseite als “rich object” im “social graph” behandelt werden kann. Der Open Graph wird vor allem von Facebook dafür genutzt, spezielle Inhalte wie den Titel, die Beschreibung oder das Bild einer Webseite auszule ...
Martin Jost
Get Metadata from WordPress Video and Audio files
In addition to images, videos and audio files are other formats that we can upload to WordPress and make them accessible to users. Depending on the use case, it may be useful to get certain metadata from video or audio files to show more details for the user. How can I get Metadata fro ...
Use PHP to remove certain characters or words from a string
The default PHP function str_replace(); is a useful tool if we want to remove certain characters, symbols or words from a string. Below I show you how to work with it. How do I remove specific characters from a string? The following wrapper function shows how we can use PHP to remove s ...
Get the current WordPress URL
In some cases, it may be necessary to get the current WordPress URL of where the user is currently browsing or visiting a web page to pass that URL in a particular PHP function. How do I get the current URL in WordPress? The following function is useful to getting exactly the current W ...
Compress files with Gzip in PHP
If you already want to Gzip compress a file with PHP, the following function will help you. This allows you to store a file in advance gzip-compressed. How does the Gzip function work? Um mit dieser Funktion zu arbeiten, benötigen wir den absoluten Server-Pfad zu einer Datei, welchen w ...
Trim a PHP string before the last special character
This small PHP function is helping us to get only a part of a value (string) by using a specific character as an indicator. How do I get only the last part of a value? We can use the following function to get only a value after the last character we’ve passed to the function. ...
Get the absolute File Path (Document Root-Path) in WordPress
Wenn man als Webentwickler mit Dateien arbeitet, die auf dem Server liegen und diese innerhalb eines WordPress-Templates aufrufen möchte, benötigt man den absoluten Pfad zu einer Datei. Zum Beispiel kann dies hilfreich sein, wenn man bestimmte Dateieigenschaften oder Dateiinhalte ausle ...
Create a connection to WordPress MySQL database in PHP
WordPress stores all the website data in a database and uses it, for example, if a certain content or settings of a post will output to a visitor. In most cases, a MySQL database is used. As theme or plugin developers there may be reasons to change specific settings in the WordPress da ...