Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View and cat icon fix #1642

Merged
merged 19 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions templates/archive/fields/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
/**
* @author wpWax
* @since 6.6
* @version 7.4.0
* @version 7.8.3
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the template version

if ( ! defined( 'ABSPATH' ) ) exit;

$default_icon = 'las la-folder-open';
?>

<div class="directorist-listing-category">
<?php if ( ! empty( $listings->loop['cats'] ) ) {
$term_icon = get_term_meta( $listings->loop['cats'][0]->term_id, 'category_icon', true );
$term_icon = $term_icon ? $term_icon : $default_icon;
$term_icon = $term_icon ? $term_icon : $icon;
$term_link = esc_url( get_term_link( $listings->loop['cats'][0]->term_id, ATBDP_CATEGORY ) );
$term_label = $listings->loop['cats'][0]->name;
?>
Expand All @@ -27,7 +25,7 @@
<?php
foreach (array_slice($listings->loop['cats'], 1) as $cat) {
$term_icon = get_term_meta( $cat->term_id, 'category_icon', true );
$term_icon = $term_icon ? $term_icon : $default_icon;
$term_icon = $term_icon ? $term_icon : $icon;
$term_link = esc_url( ATBDP_Permalink::atbdp_get_category_page( $cat ) );
$term_link = esc_url( get_term_link( $cat->term_id, ATBDP_CATEGORY ) );
$term_label = $cat->name;
Expand All @@ -45,8 +43,8 @@
}
}
else { ?>
<a href="#"><?php directorist_icon( $default_icon );?><?php esc_html_e('Uncategorized', 'directorist'); ?></a>
<a href="#"><?php directorist_icon( $icon );?><?php esc_html_e('Uncategorized', 'directorist'); ?></a>
<?php
}
?>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/archive/fields/view_count.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* @author wpWax
* @since 6.6
* @version 7.4.0
* @version 7.8.3
*/

if ( ! defined( 'ABSPATH' ) ) exit;
?>

<div class="directorist-view-count"><?php directorist_icon( 'las la-eye' ); ?><?php echo ! empty($listings->loop['post_view']) ? esc_html( $listings->loop['post_view'] ) : 0;?></div>
<div class="directorist-view-count"><?php directorist_icon( $icon ); ?><?php echo ! empty($listings->loop['post_view']) ? esc_html( $listings->loop['post_view'] ) : 0;?></div>