I created a function called portfolio but unfortunately the html of the code are not display while the function from wordpress is working.

function portfolio($id){
        $output = "<ul class="recentWorks port">";
            if (have_posts()) : {
            $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
            query_posts("&cat={echo $id;}&showposts=6&paged=$paged&order=ASC");
            }
            while(have_posts()) : the_post();
            $output .= "<li>";
                $output.= "<span>";
                the_title();
                $output .= "</span>";
          $output .= "</li>";
          endwhile;
         endif;
          $output .= "</ul>";
          return $output;
      }

only the the_title() display while the html wrap the the_title() is all gone.

Read more here: php function: the html did not display


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , ,

Wordpress related questions and answers: