I wrote a php function wasnt getting to much success from it.
function get_by_category($cat){
$base_img_url = get_stylesheet_directory_uri();
$img =‘’;
if($cat == "Announcements & Misc. Leads"){
$img = "Announcements & Misc Leads.webp";
}
if($cat == "Blessed Event"){
$img = "Blessed Event.webp";
}
if($cat == "Business Promotions"){
$img = "Business Promotions.webp";
}
if($cat == "Goods and Services: For Sale (new/used)" || $cat == "Goods and Services: Free (new/used)" || $cat == "Goods and Services: For Sale (new/used)"){
$img = "Goods and Services For Sale.webp";
}
if($cat == "Housing Construction or Remodeling" || $cat == "Housing Purchased: Single or Multiple Family" || $cat == "Housing Wanted: Buy or Rent" || $cat == "Housing for Rent" || $cat == "Housing for Sale" || $cat == "Real Estate: Sale, Lease, Rent, & Purchase of Land and Buildings" || $cat == "Sub-Divisions and Other Residential Developments"){
$img = "Housing Construction or Remodeling.webp";
}
if($cat == "Information or Advice (ask or offer)"){
$img = "Information or Advice.webp";
}
if($cat == "Investment Opportunity"){
$img = "Investment Opportunity.webp";
}
if($cat == "Job or Position Openings"){
$img = "Job or Position Openings.webp";
}
if($cat == "Local Area Commercial Leads" || $cat == "Out-of-Area Commercial Leads"){
$img = "mind-info.webp";
}
if($cat == "Parting Thought for the Week"){
$img = "thoughts.webp";
}
if($cat == "People on the Move / New People in the Area"){
$img = "Job or Position Openings.webp";
}
if($cat == "Testimonials/Online Reviews"){
$img = "Testimonials Online Reviews.webp";
}
return $base_img_url.''.$img;
}
The simplicity is, check if the value equals X, if it does use image, which it should return. But, while it was evaluating the conditions, they never provided true or false.
Here is the code.
{echo:get_by_category('{je_cct_leads_category})}
I am using Bricks Builder (recent release)
PHP 8.2.1
the je is Jetengine.
Any suggestions. I have checked also in logs to see if there are errors, also utilized error checking to see if the result is returned.