updated the cpt and others
This commit is contained in:
@@ -191,6 +191,7 @@ class Partnerexpo_Core {
|
|||||||
'show_in_rest' => true,
|
'show_in_rest' => true,
|
||||||
'capability_type' => 'post',
|
'capability_type' => 'post',
|
||||||
'supports' => [ 'title', 'editor', 'thumbnail', 'excerpt' ],
|
'supports' => [ 'title', 'editor', 'thumbnail', 'excerpt' ],
|
||||||
|
'taxidermy' => [ 'tags' ],
|
||||||
];
|
];
|
||||||
|
|
||||||
register_post_type( 'pexpo_partners', $args );
|
register_post_type( 'pexpo_partners', $args );
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Plugin Name: PartnerExpo Core
|
* Plugin Name: PartnerExpo Core
|
||||||
* Plugin URI: https://partnerexpo.eu
|
* Plugin URI: https://partnerexpo.eu
|
||||||
* Description: A PartnerEXPO oldal belső pluginja
|
* Description: A PartnerEXPO oldal belső pluginja
|
||||||
* Version: 1.0.5
|
* Version: 1.0.6
|
||||||
* Author: Juhász Levente
|
* Author: Juhász Levente
|
||||||
* Author URI: https://github.com/Duskell/
|
* Author URI: https://github.com/Duskell/
|
||||||
* License: GPL-2.0+
|
* License: GPL-2.0+
|
||||||
@@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
define( 'PARTNEREXPO_CORE_VERSION', '1.0.5' );
|
define( 'PARTNEREXPO_CORE_VERSION', '1.0.6' );
|
||||||
|
|
||||||
function activate_partnerexpo_core() {
|
function activate_partnerexpo_core() {
|
||||||
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';
|
||||||
|
|||||||
@@ -73,12 +73,24 @@ class Partnerexpo_Core_Public {
|
|||||||
$posts = [];
|
$posts = [];
|
||||||
|
|
||||||
foreach ($query->posts as $post) {
|
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[] = [
|
$posts[] = [
|
||||||
'id' => $post->ID,
|
'id' => $post->ID,
|
||||||
'title' => $post->post_title,
|
'title' => $post->post_title,
|
||||||
'image' => get_the_post_thumbnail_url($post->ID),
|
'image' => get_the_post_thumbnail_url($post->ID),
|
||||||
'excerpt' => $post->post_excerpt,
|
'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),
|
'url' => get_permalink($post),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,10 @@
|
|||||||
.pexpo-core-title {
|
.pexpo-core-title {
|
||||||
font-weight: 750;
|
font-weight: 750;
|
||||||
letter-spacing: .15px;
|
letter-spacing: .15px;
|
||||||
|
color: var(--text);
|
||||||
|
&:hover {
|
||||||
|
color: initial;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pexpo-core-tag {
|
.pexpo-core-tag {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
style="width:100%; border-radius:10px; object-fit:cover;" />
|
style="width:100%; border-radius:10px; object-fit:cover;" />
|
||||||
</div>
|
</div>
|
||||||
<div class="pexpo-core-cardTop">
|
<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>
|
||||||
<div class="pexpo-core-desc">${escapeHtml(r.excerpt)}</div>
|
<div class="pexpo-core-desc">${escapeHtml(r.excerpt)}</div>
|
||||||
<div class="pexpo-core-foot">
|
<div class="pexpo-core-foot">
|
||||||
@@ -96,7 +96,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Search failed:", 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 {
|
} finally {
|
||||||
masonry.style.opacity = "1";
|
masonry.style.opacity = "1";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user