0
I am trying to collect the category name with the following code
<a href="<?php get_cat_name( $cat_id ); ?>"></a>
But I’m not having much success. Another thing is, I have about 4 categories but the code needs to know if this using category a or b within 4, if there is no category that is A or B shows nothing.. if anyone can help me.
Hello Rafael, thanks for the help, I used the code but it didn’t work: >> <a href="<? echo (get_cat_name( $cat_id ) == '48' || get_cat_name( $cat_id ) == '49') ? 'displays result' '; '; ? >"></a>
– user60953
what error gave @Renatoassis?
– RFL
Didn’t work @Rafaelacioly
– user60953
@Renatoassis as you put the code?
– RFL
in the same way that you see above > <a href="<? echo (get_cat_name( $cat_id ) == '48' || get_cat_name( $cat_id ) == '49') ? 'displays the result' : '; ? >"></a>
– user60953
@Renatoassis suggest you study a little more than
PHP
to proceed with the use ofwordpress
no headache, I changed the answer to make it clearer.– RFL
I don’t understand PHP anymore I turn around the ways I can... you don’t understand very well what I want, I don’t need to display a precise specific result that only shows the name of the category.. if it is A displays the name A if it is B displays the name B, if it is not A or B displays nothing.. nothing more than that if you can help I am grateful.
– user60953
I understand that the display result would be ideal to insert the function that informs the name of the category, but that’s where I can not.. I don’t know what function will do that.. I’ve tried every way.
– user60953
Let’s go continue this discussion in chat.
– user60953
Could you pass on more information? - @Rafaelacioly
– user60953