- This topic has 23 replies, 4 voices, and was last updated 5 years, 2 months ago by Tom.
-
AuthorPosts
-
February 9, 2019 at 1:52 pm #806185Maike
Hi Leo,
Sorry for being unclear. π
No, I want to keep the title, but hide the meta (categories). Is that possible?
Thank you,
MaikeFebruary 9, 2019 at 2:00 pm #806189MaikeHi Leo. I figured this one out. Thank you!
February 9, 2019 at 2:16 pm #806199LeoStaffCustomer SupportGlad it’s sorted π
February 11, 2019 at 3:56 am #807182MaikeHi guys
I’m still struggling to show the description on the category page.
I followed this… learned more about elements, add this shortcode to my php file:
(using dispatch skin, created a child theme)add_shortcode( 'term_description', 'tu_term_description' ); function tu_term_description() { ob_start(); echo term_description( get_queried_object()->term_id, 'category' ); return ob_get_clean(); }
and added this as a new element hook.
<?php if ( is_category() ) : ?> [term_description] <?php endif; ?>
checked off the execute PHP checkbox
left priority set to 10
hook: before_maine_contentdisplay rules: all archives.
The only thing that shows up is “[term_description]”
but not the actual description I created for that category.Can you please help?
Thank you,
MaikeFebruary 11, 2019 at 9:02 am #807496TomLead DeveloperLead DeveloperHey Maike,
Try this instead:
<?php if ( is_category() ) : echo do_shortcode( '[term_description]' ); endif; ?>
Let me know π
February 12, 2019 at 4:42 am #808195MaikeHi Tom!!
that code
<?php if ( is_category() ) :
echo do_shortcode( ‘[term_description]’ );
endif; ?>I T W O R K E D!!!
Nothing short of magical. Thank you, thank you!
I wish I was proficient enough to address the next few problems myself, but I’m afraid I do have to ask some follow up questions.
01
The text for the category description displays just fine. But it’s also displaying the latest post separately from the rest (inline with the end of the category description text).
Ideally, I’d like to have the category header show, the description show, then some small white space between the end of that text and the beginning of the 3×3 grid
Follow up.
The header and text styling would be done with CSS, right? I just don’t know how to ‘call’ those parts (h2, p, …) to customize it.
The second part is that I don’t want any one post to stand out.Here is how the categories display in a category in which I haven’t added any category description text
i.e. gluten free recipesHere is how the category page display in a category in which I have added some category description text
i.e. DinnersIn essence, I’d like to display them in the 3×3 grid, not show the latest post separate and have to ability to style the text.
Thank you,
MaikeFebruary 12, 2019 at 9:45 am #808544TomLead DeveloperLead DeveloperCan you try setting the priority of your hook to
5
?Let me know π
February 12, 2019 at 11:53 am #808624MaikeHi Tom!
That worked! It’s great! Thank you so much!
I love this coding magic.
Thank you,
MaikeFebruary 12, 2019 at 5:04 pm #808816TomLead DeveloperLead DeveloperYou’re welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.