How To Moving the category listing description to the bottom. I want showing description after listing block.
I’ve tried with this code but it doesn’t work
add_filter(
'hivepress/v1/templates/listings_view_page',
function ($template){
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'page_description' => [
'_order' => '1000',
],
],
]
);
},
1000
);
Thx`
1 Like
yevhen
September 8, 2022, 8:38am
4
Please try this PHP snippet
add_filter('hivepress/v1/templates/listings_view_page/blocks', function($blocks, $template){
$listing_category = $template->get_context('listing_category');
if($listing_category){
$blocks = hivepress()->helper->merge_trees(
[ 'blocks' => $blocks ],
[
'blocks' => [
'listings_container' => [
'blocks' => [
'custom_category_description' => [
'type' => 'content',
'content' => category_description($listing_category->get_id()),
'_order' => 1000,
],
]
]
]
]
)['blocks'];
}
return $blocks;
}, 1000, 2);
1 Like
thanks for helping.
now the description is a duplicate. the first is above (below the title), the second is below the content.
I tried using CSS to hide the top description, it worked. But a problem arises, the category description does not appear on the homepage.
Is there any solution for other code?
by the way, i use the listinghive theme
ihor
September 10, 2022, 6:06pm
7
Please try hiding the top one using this CSS snippet, the category block should still show the description:
.hp-listing-category--view-page .hp-listing-category__description {display:none!important}
In which file should this be changed?
ihor
September 22, 2022, 8:32am
9
yevhen:
add_filter('hivepress/v1/templates/listings_view_page/blocks', function($blocks, $template){
$listing_category = $template->get_context('listing_category');
if($listing_category){
$blocks = hivepress()->helper->merge_trees(
[ 'blocks' => $blocks ],
[
'blocks' => [
'listings_container' => [
'blocks' => [
'custom_category_description' => [
'type' => 'content',
'content' => category_description($listing_category->get_id()),
'_order' => 1000,
],
]
]
]
]
)['blocks'];
}
return $blocks;
}, 1000, 2);
Substituted this code wherever possible. The theme is basic. I can’t figure out how to move the description down.
ihor
September 24, 2022, 2:31pm
12
Make sure that you added it via the Code Snippets plugin, or to the child theme’s functions.php file. I’ve tested it locally and it seems to be ok, but it doesn’t move the description - it adds the second one at the bottom so the top one should be also hidden with CSS.
system
Closed
October 24, 2022, 2:32pm
13
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.