Title: Major problem with post displaying
Last modified: August 20, 2016

---

# Major problem with post displaying

 *  [age1869](https://wordpress.org/support/users/age1869/)
 * (@age1869)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/major-problem-with-post-displaying/)
 * I’m working on a site of small local magazine and I have to create custom start
   page. Everything would be easier if the design was entirely mine, unfortunately
   it is a template bought by the owner of the site… I wrote two shortcodes functions
   and the shortcodes works fine.
 * functions:
 *     ```
       function mainpage2($atts, $content = null) {
   
       $strr = do_shortcode($content);
       	        $tekst = '<div class="cat_title"><h2>' . $strr . '</h2><div class="clear"></div></div>';
       				return $tekst;
   
       	}
       add_shortcode('nazwakategorii', 'mainpage2');
   
       function mainpage1($atts, $content = null) {
   
       $rss = do_shortcode($content);
        $args = array( 'numberposts' => 1, 'category' => $rss );
       $myposts = get_posts( $args );
       foreach( $myposts as $post ) :	setup_postdata($post);
       $eee = _e('Czytaj więcej', 'tfuse');
       					$tekst = '<div class="post-item"><h2><a href="' . the_permalink() . '">' . the_title() . '</a></h2><div class="post-meta">
       					<em>' .  _e('przez', 'tfuse') . '<span class="author">' . the_author_posts_link() . '</span> &nbsp;|&nbsp;
       						<a href="' . comments_link() . '" class="link-comments">
       							' . comments_number('0 komentarzy', '1 komentarz', '2 komentarze', '3 komentarze', '4 komentarze', '% komenatarzy') . '
       						</a>
       					</em>
   
       				</div>
   
       				<div class="entry">' . the_excerpt() .'
       					<div class="clear"></div>
       				</div>
   
       				<a class="link-more" href="' . the_permalink() . '" >
       					' .  $eee . '
       				</a>
       			</div>';
       			 endforeach;
       	return $tekst;
       	}
       add_shortcode('postglowna', 'mainpage1');
       ```
   
 * On my page I’ve got:
 *     ```
       [nazwakategorii]Edytorial[/nazwakategorii]
       [postglowna]4[/postglowna]
       ```
   
 * Unfortunately I displays in completly wrong way. Take a look -> [http://magazyn.linuxpl.info/](http://magazyn.linuxpl.info/)
 * Thanks for your replays!

The topic ‘Major problem with post displaying’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [age1869](https://wordpress.org/support/users/age1869/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/major-problem-with-post-displaying/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
