Site logo

[Support request] Use Category/Tag descriptions as dynamic Content?

Home Forums Support [Support request] Use Category/Tag descriptions as dynamic Content?

Home Forums Support Use Category/Tag descriptions as dynamic Content?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2166557
    Jabien

    Hi,

    Is it possible to use Category/Tag descriptions as dynamic Content? For instance, if I want to use a category’s description as the page title, can I do that?

    Thanks in advance!

    Cheers,
    Jabien

    #2166570
    Ying
    Staff
    Customer Support

    Hi Jabien,

    I don’t think the dynamic block can achieve this, the category/tag descriptions are usually be called on archive pages.

    And usually pages don’t have category assigned to them.

    However you can try something like this to call category description:

    function show_category_description() {
    	$taxonomy ='category';
    	echo term_description( get_the_terms($post->ID , $taxonomy)[0], $taxonomy );
    }
    #2166580
    Jabien

    I was using the word “page” but I think a more accurate description would be that I want the Archive Pages to pull their title from the category description.

    Would that function work for what I am trying to do? If so, where exactly do I put it?

    #2166581
    Ying
    Staff
    Customer Support

    If you are talking about archive, then there’s no custom function needed.

    You can use adynamic contentblock, choose term description as the type:
    https://www.screencast.com/t/PVrxaos4zqS

    Choose post category archive as location in this case.

    #2166583
    Jabien

    Okay great, this gets me halfway there. Now it has the description where I need it but I can’t format the typography of the dynamic content to look like a title. This is basically the last thing I need to move my site away from Elementor (I think). Any way to do that?

    #2166584
    Ying
    Staff
    Customer Support

    You can wrap a containerblock outside thedynamic content, the style of the container block will pass on to the dynamic content.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.