This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filters the posts by the specified author and returns the matching post IDs. | |
* If no matching posts are found, it returns a message indicating that no posts were found for the specified author. | |
* | |
* @param string $search_author The author to filter the posts by. | |
* @return array|string The array of matching post IDs or a message indicating no posts were found. | |
*/ | |
if (!empty($search_author)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="bg-{{ $backgroundColor }}" x-data="colorContrast()" x-bind:class="textColorClass"> | |
<p>Text som ska ändra färg beroende på bakgrundsfärg</p> | |
<a class="leading-non inline-block rounded-3xl border px-6 py-4 text-xs font-bold no-underline" href="{{ $card['card_button']['url'] }}" x-bind:class="borderColorClass"> | |
{{ $card['card_button']['title'] }} | |
</a> | |
</div> | |
<script> | |
document.addEventListener('alpine:init', () => { | |
Alpine.data('colorContrast', () => ({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Alpine Ajax test</title> | |
</head> | |
<body> | |
<h1>Users API Retrieval Test</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to Read WordPress Block Content Programmatically | |
https://www.ibenic.com/read-wordpress-block-content-programmatically/ | |
Creating a Server-Side Rendered ACF Field Block for WordPress | |
https://wpblockz.com/tutorial/learn-gutenberg-block-building-create-a-block-that-renders-an-acf-field/ | |
Coding Gutenberg Toggle Control Block Settings | |
https://wpblockz.com/tutorial/wp-gutenberg-editor-controls-form-toggle/ | |
Remove the default block patterns from WordPress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function postFilter() | |
{ | |
// Define custom post type and taxonomies | |
$post_type = 'product'; | |
$taxonomies = array('brand', 'category'); | |
// Get the current page number | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
head() { | |
# Usage: head "n" "file" | |
while IFS= read -r line; do | |
printf '%s\n' "$line" | |
i=$((i+1)) | |
[ "$i" = "$1" ] && return | |
done < "$2" | |
# 'read' used in a loop will skip over | |
# the last line of a file if it does not contain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin svg-icon($name, $height: 24, $width: 24, $color: $color-primary) { | |
-webkit-mask-size: contain; | |
-webkit-mask-repeat: no-repeat; | |
-webkit-mask-position: center; | |
height: calc($height / $base-font-size) + rem; | |
width: calc($width / $base-font-size) + rem; | |
background-color: $color; | |
mask-image: url(~@images/icons/#{$name}.svg); | |
background-size: cover; | |
mask-size: contain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define the base font-size and line-height | |
$base-font-size: 16px; | |
$base-line-height: 1.5; | |
// Define a mixin for setting font-size and line-height in rem units | |
@mixin font-size-rem($size, $line-height) { | |
font-size: ($size / $base-font-size) + rem; | |
line-height: ($line-height / $size); | |
} |