View Single Post
Old 12-03-2018, 06:37 AM  
hausarzt
Confirmed User
 
hausarzt's Avatar
 
Industry Role:
Join Date: Jan 2011
Location: Somewhere in Germany
Posts: 817
Simple Wordpress / Php-code question. HELP

Hey guys.
My php skills are something around 8%, so I need a little help.

In my theme, I want to add the following php code:
Code:
if( function_exists('the_ad_placement') ) { the_ad_placement('placement_after_vote'); }
This should appear in this div:
Code:
$return .= "<div class='wp-hotornot-title'><h2>$header</h2></div>";
As I dont need the h2-header, I tried this code:
Code:
$return .= "<div class='wp-hotornot-title'>if( function_exists('the_ad_placement') ) { the_ad_placement('placement_after_vote'); }</div>";
The result is, that the php code is displayed as plain text.
The stuff before and after the edited line still works, so it does not mess everything up. But I don't know, why it's displayed as plain text.
It's a php-file of a plugin I use, so of course, there is more code including php open and end snippet.

Any help would be appreciated.
__________________
I know, my english is bad. But your german might be even worse
hausarzt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote