updated the cpt and others
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -258,6 +258,10 @@
|
||||
.pexpo-core-title {
|
||||
font-weight: 750;
|
||||
letter-spacing: .15px;
|
||||
color: var(--text);
|
||||
&:hover {
|
||||
color: initial;
|
||||
}
|
||||
}
|
||||
|
||||
.pexpo-core-tag {
|
||||
|
||||
@@ -68,7 +68,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
style="width:100%; border-radius:10px; object-fit:cover;" />
|
||||
</div>
|
||||
<div class="pexpo-core-cardTop">
|
||||
<div class="pexpo-core-title">${escapeHtml(r.title)}</div>
|
||||
<a class="pexpo-core-title">${escapeHtml(r.title)}</a>
|
||||
</div>
|
||||
<div class="pexpo-core-desc">${escapeHtml(r.excerpt)}</div>
|
||||
<div class="pexpo-core-foot">
|
||||
@@ -96,7 +96,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
} catch (error) {
|
||||
console.error("Search failed:", error);
|
||||
masonry.innerHTML = `<div style="padding:20px; color:red;">Error loading results.</div>`;
|
||||
masonry.innerHTML = `<div style="padding:20px; color:red;">Hiba történt a keresés során.</div>`;
|
||||
} finally {
|
||||
masonry.style.opacity = "1";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user