Single.php edit

Posted in: Newspaper
Post count: 28

Hi

I have a question. I just want to add block – OUR LATEST POST (from 404.php) at the bottom of the single post. How to add or modify this code and paste to single.php?

<h4 class="block-title"><span><?php echo __td('OUR LATEST POSTS', TD_THEME_NAME) ?></span></h4>

                <?php

                $args = array(
                    'post_type'=> 'post',
                    'showposts' => 6
                );
                query_posts($args);

                $td_loop_block_module = td_util::get_option('tds_404_page_layout');
                //$td_loop_block_module

                locate_template('loop.php', true);
                //get_template_part('category', 'slider');
                wp_reset_query();

                ?>

of course after content and before widget (mobile)

  • This topic was modified 8 years by agracjan.
Post count: 20688

Hi,

The single post page displays only a related articles section
https://forum.tagdiv.com/related-articles/
If you would like to display additional content you will have to edit the loop-single file corresponding to the post template you use (post template 2->loop-single-2.php)
https://www.screencast.com/t/3ffUaBATNZ
These post templates are located in the main theme folder. Opening one of them in a text editor you can see the structure. Enter the code there, maybe below the related articles section or where you want the block to display. Then check the results.

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.