From 49bd340a930cbfe56e00173f6de5f1296f614f3b Mon Sep 17 00:00:00 2001 From: Duskell Date: Sun, 1 Feb 2026 14:06:09 +0100 Subject: [PATCH] updated the cpt and others --- includes/class-partnerexpo-core.php | 11 ++++++----- partnerexpo-core.php | 4 ++-- public/class-partnerexpo-core-public.php | 14 +++++++++++++- public/css/searchbox.css | 4 ++++ public/js/searchbox.js | 4 ++-- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/includes/class-partnerexpo-core.php b/includes/class-partnerexpo-core.php index 71425da..1cf7adb 100644 --- a/includes/class-partnerexpo-core.php +++ b/includes/class-partnerexpo-core.php @@ -186,12 +186,13 @@ class Partnerexpo_Core { 'view_item' => __('Partner megtekintése', 'partnerexpo-core'), 'all_items' => __('Összes partner', 'partnerexpo-core'), ], - 'public' => true, - 'has_archive' => true, - 'show_in_rest' => true, + 'public' => true, + 'has_archive' => true, + 'show_in_rest' => true, 'capability_type' => 'post', - 'supports' => [ 'title', 'editor', 'thumbnail', 'excerpt' ], - ]; + 'supports' => [ 'title', 'editor', 'thumbnail', 'excerpt' ], + 'taxidermy' => [ 'tags' ], + ]; register_post_type( 'pexpo_partners', $args ); diff --git a/partnerexpo-core.php b/partnerexpo-core.php index 38ec0ff..cd5406c 100644 --- a/partnerexpo-core.php +++ b/partnerexpo-core.php @@ -9,7 +9,7 @@ * Plugin Name: PartnerExpo Core * Plugin URI: https://partnerexpo.eu * Description: A PartnerEXPO oldal belső pluginja - * Version: 1.0.5 + * Version: 1.0.6 * Author: Juhász Levente * Author URI: https://github.com/Duskell/ * License: GPL-2.0+ @@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) { die; } -define( 'PARTNEREXPO_CORE_VERSION', '1.0.5' ); +define( 'PARTNEREXPO_CORE_VERSION', '1.0.6' ); function activate_partnerexpo_core() { require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php'; diff --git a/public/class-partnerexpo-core-public.php b/public/class-partnerexpo-core-public.php index d117456..6da2e14 100644 --- a/public/class-partnerexpo-core-public.php +++ b/public/class-partnerexpo-core-public.php @@ -73,12 +73,24 @@ class Partnerexpo_Core_Public { $posts = []; foreach ($query->posts as $post) { + $terms = wp_get_post_terms($post->ID, 'taxidermy_tags', ['fields' => 'all']); + $my_term = null; + + foreach ($terms as $term) { + if ($term->slug === 'tags') { + $my_term = $term->name; // or ->term_id + break; + } + } + + $posts[] = [ 'id' => $post->ID, 'title' => $post->post_title, 'image' => get_the_post_thumbnail_url($post->ID), 'excerpt' => $post->post_excerpt, - 'modif' => $post->post_modified, + 'date' => date('Y-m-d', strtotime($post->post_date)), + 'tag' => $my_term ?? null, 'url' => get_permalink($post), ]; } diff --git a/public/css/searchbox.css b/public/css/searchbox.css index a43c890..abf7a4e 100644 --- a/public/css/searchbox.css +++ b/public/css/searchbox.css @@ -258,6 +258,10 @@ .pexpo-core-title { font-weight: 750; letter-spacing: .15px; + color: var(--text); + &:hover { + color: initial; + } } .pexpo-core-tag { diff --git a/public/js/searchbox.js b/public/js/searchbox.js index 0f4a3cc..1fd6a1f 100644 --- a/public/js/searchbox.js +++ b/public/js/searchbox.js @@ -68,7 +68,7 @@ document.addEventListener('DOMContentLoaded', () => { style="width:100%; border-radius:10px; object-fit:cover;" />
-
${escapeHtml(r.title)}
+ ${escapeHtml(r.title)}
${escapeHtml(r.excerpt)}
@@ -96,7 +96,7 @@ document.addEventListener('DOMContentLoaded', () => { } catch (error) { console.error("Search failed:", error); - masonry.innerHTML = `
Error loading results.
`; + masonry.innerHTML = `
Hiba történt a keresés során.
`; } finally { masonry.style.opacity = "1"; }