Title: Echo printing error
Last modified: August 20, 2016

---

# Echo printing error

 *  [Shashikanta](https://wordpress.org/support/users/sashikanta/)
 * (@sashikanta)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/)
 * Line number 8 exho error, help me for the correct format
 *     ```
       <?php
       // The Query
       $the_query = new WP_Query( 'cat=13&post_type=publication&numberposts=5' );
   
       // The Loop
       while ( $the_query->have_posts() ) : $the_query->the_post();
       echo '<li>';
       echo '"<a href="the_permalink()"> the_title()"</a>"';
       echo '</li>';
       endwhile;
   
       // Reset Post Data
       wp_reset_postdata();
       ?>
       ```
   

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638201)
 * Replace:
    `echo '"<a href="the_permalink()"> the_title()"</a>"';`
 * with:
    `echo '<a href="' . the_permalink() . '">' . the_title() . '</a>';`
 *  Thread Starter [Shashikanta](https://wordpress.org/support/users/sashikanta/)
 * (@sashikanta)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638205)
 * Not working
 * Showing below result like this
 * [http://project.xxx.com/wp-content/plugins/wp-publication-archive/includes/openfile.php?file=http](http://project.xxx.com/wp-content/plugins/wp-publication-archive/includes/openfile.php?file=http)
   |project.xxx.com/wp-content/uploads/2012/03/tor_process_monitoring.pdfThis is
   a demo file (Download Publication)
 * [http://project.xxx.com/wp-content/plugins/wp-publication-archive/includes/openfile.php?file=http](http://project.xxx.com/wp-content/plugins/wp-publication-archive/includes/openfile.php?file=http)
   |project.xxx.com/wp-content/uploads/2012/03/GuidelineTender_Data_Card-Jajpur1.
   docReport 2012 (Download Publication)
 *  Thread Starter [Shashikanta](https://wordpress.org/support/users/sashikanta/)
 * (@sashikanta)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638207)
 * But the links are ok
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638209)
 * And where is the error now?
 *  Thread Starter [Shashikanta](https://wordpress.org/support/users/sashikanta/)
 * (@sashikanta)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638214)
 * yes same thing i am wondering
 * Check this [http://project.xxx.com/progress](http://project.xxx.com/progress)
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638216)
 * > where is the error now?
 *  Thread Starter [Shashikanta](https://wordpress.org/support/users/sashikanta/)
 * (@sashikanta)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638217)
 * linking is not done as per our coding
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638218)
 * All I did is fix the syntax errors in your code.
 *  Thread Starter [Shashikanta](https://wordpress.org/support/users/sashikanta/)
 * (@sashikanta)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638219)
 * I got it I’m already in a php block and opening another one. I should be doing
   something like this
 * <?php $the_query = new WP_Query(…); ?>
    <?php while ( $the_query->have_posts()):
   $the_query->the_post(); ?> “><?php the_title(); ?> <?php endwhile; ?> <?php wp_reset_postdata();?
   >
 * _[Moderator Note: Please post code or markup snippets between backticks or use
   the code button.]_

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Echo printing error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 2 participants
 * Last reply from: [Shashikanta](https://wordpress.org/support/users/sashikanta/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/echo-printing-error/#post-2638219)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
