Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Answer by Andrew Schultz for Syntax for conditional statement in Wordpress functions.php

Here is a starting point.

function custom_event($content) {    global $post;    if( in_category( 'category-name-slug-id', $post ) ) {        $beforecontent = '<strong>[acf field="date"] [acf field="time"] [acf field="location" ] </strong>';        $fullcontent = $beforecontent . $content;        return $fullcontent;    }    return $content;}add_filter('the_content', 'custom_event');

Viewing latest article 2
Browse Latest Browse All 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>