- This topic has 40 replies, 4 voices, and was last updated 1 year, 8 months ago by Fernando.
-
AuthorPosts
-
July 19, 2022 at 11:39 am #2287715Sabbir
no
July 19, 2022 at 11:42 am #2287719DavidStaffCustomer SupportHow did you add the Shortcode to that page ?
July 19, 2022 at 8:51 pm #2288013Sabbirin child Theme Functions
(functions.php)July 20, 2022 at 12:58 am #2288124Fernando Customer SupportI tested the code from my end, and it’s not adding a
<code>
tag like yours does.Most likely, as mentioned by Ying, it may be from a plugin or a custom code.
Can you try disabling all non-GP plugins again, and we’ll check from our end how it goes? If you have a staging site, you can do it there instead.
Hope to hear from you soon.
July 20, 2022 at 1:19 am #2288141SabbirHi,
I did it, please check it fast for me.
July 20, 2022 at 1:38 am #2288158Fernando Customer SupportThank you for testing. I can confirm that it’s still there.
Since your
functions.php
only includes the code provided by David, by any chance, do you have any custom code added through a Hook Element?Kindly let us know.
July 20, 2022 at 1:43 am #2288161Sabbirhere are my 3 active element: https://prnt.sc/IwQr0VqcoG30
July 20, 2022 at 1:49 am #2288170Fernando Customer SupportI see. There’s nothing there that should cause the issue as well.
Can you try this code instead?:
add_shortcode('cat_listing', function($html){ $categories = get_categories(); $cat_html = '<div class="my-category-term-list">'; foreach( $categories as $category ) { $cat_html .= sprintf( '<h3 class="term-title entry-title"><a class="term-links" href="%1$s" alt="%2$s">%3$s</a></h3>', esc_url( get_category_link( $category->term_id ) ), esc_attr( $category->name ), esc_html( $category->name ) ); } $cat_html .= '</div>'; return $cat_html; });
Kindly let us know how it goes.
July 20, 2022 at 1:51 am #2288172Sabbirnot working: https://www.disabilityresources.org/cat.html
July 20, 2022 at 2:06 am #2288186Fernando Customer SupportThank you for testing that, can you test this instead?:
add_shortcode('cat_listing', function($html){ $categories = get_categories(); $cat_html = '<div class="category-term-list">'; foreach( $categories as $category ) { $cat_html .= sprintf( '<h3 class="my-term-title my-entry-title"><a class="my-term-links" href="%1$s" alt="%2$s">%3$s</a></h3>', esc_url( get_category_link( $category->term_id ) ), esc_attr( $category->name ), esc_html( $category->name ) ); } $cat_html .= '</div>'; return $cat_html; });
I’m replacing the class name one by one to see if that may resolve the issue. Sorry for the back-and-forth.
July 20, 2022 at 2:07 am #2288189Sabbircheck the result here: https://www.disabilityresources.org/cat.html
July 20, 2022 at 3:59 am #2288257DavidStaffCustomer SupportIn the editor – how was the shortcode added to the page ? Is it in a Shortcode Block ?
July 20, 2022 at 4:07 am #2288266SabbirSorry, David, I paste the shortcode normally, as I did, I hoped it will automatically get a shortcode block but it was not, I didn’t notice that.
now I delete this block added a shortcode block and past the code. now, this is the result. now I just need an arrow with link.
here is the current result: https://www.disabilityresources.org/cat.html
July 20, 2022 at 4:34 am #2288302DavidStaffCustomer SupportThats ok – its working now 🙂
You can use this CSS:.category-term-list .term-title { position: relative; } .category-term-list .term-title::after { color: #777; content: "\2192"; font-weight: 300; font-size: 20px; position: absolute; top: 0; right: 0; }
July 20, 2022 at 4:37 am #2288304SabbirIt looks good
-
AuthorPosts
- You must be logged in to reply to this topic.