skip to Main Content

WordPress Advanced Custom Fields – Cleaner Way To Code This

I have added advanced custom fields to woocommerce category pages to help with SEO. Is there a cleaner way to code this as a lot of excess probably don't need <div class="full top-cat-seo"> <?php $queriedObject=get_queried_object(); echo get_field('product_category_top_section_seo','product_cat_'.$queriedObject->term_id); $link1 = get_field('link_url_1','product_cat_'.$queriedObject->term_id);…

VIEW QUESTION

PHP echo field, field appears before div – WordPress

I have the following code: if( get_field('event_timedate') ): echo "<div class='bm-event_timedate'><p>".the_field('event_timedate')."</p></div>"; endif; But for some reason the output is (the date appears before the div and p tags) 27/08/2022 8:00pm <div class='bm-event_timedate'><p>".the_field('event_timedate')."</p></div> Id really appreciate any help, thanks in advance!

VIEW QUESTION
Back To Top
Search