I need some help regarding PHP output. Actually i am trying to show a message but in return it showing multiple messages on page.
OUTPUT: Here are some questionsHere are some questionsHere are some questionsHere are some questions
Here is my code: See Line #2
function sc_wptabtitle( $atts, $content = null ) {
echo '<span class="acbar">Here are some questions</span>';
extract(shortcode_atts(array(
'header' => 'h3',
'hclass' => 'wp-tab-title',
'label' => 'text',
'image_size'=> '24,24',
'_id' => false,
'load' => '',
'post' => '',
'page' => '',
'cat' => '',
'category_name' => '',
'tag' => '',
'tag_name' => '',
'number' => '4',
'exclude' => '',
'tag' => '',
'feed' => '',
'hide' => "false",
'elength' => $this->options['excerpt_length'],
'before_post' => '',
'after_post' => '',
'template' => '1',
'icon' => false
), $atts));
global $wpui_id_remove_chars;
if ( str_ireplace( $wpui_id_remove_chars, '', $_id ) != $_id )
$_id = false;
$tmpl = ( isset( $this->options[ 'post_template_' . $template ] ) ) ?
$this->options[ 'post_template_' . $template ] :
$this->options[ 'post_template_1' ];
if ( isset( $this->options[ 'title_template' ] ) && $this->options[ 'title_template' ] != '' ) {
$title_template = $this->options[ 'title_template' ];
if ( $_id ) {
$title_template = str_ireplace( '>{$title}', 'id="' . $_id . '">{$title}', $title_template );
}
} else {
$title_template = '<' . $header;
$title_template .= ' class="' . $hclass . '"';
if ( $_id ) {
$title_template .= ' id="' . $_id . '"';
}
$title_template .= '>{$title}</' . $header . '>';
}
Any guess why it is showing multiple messages/text lines on output page?
Thank you so much in advance
Because of you are calling the function sc_wptabtitle
multiple times in your code.
So it is calling the below code
echo '<span class="acbar">Here are some questions</span>';
multiple times and it is giving such output.
Check your code that where is it calling. May be it will be in loop or called multiple times.