Hey.
There is a code, it displays the text up to the more tag from the page I specified to the main page.
<?php global $paged; if(is_home() && $paged == "") : $my_query = new WP_Query('pagename=страница'); // тут надо указать название требуемой страницы while ($my_query->have_posts()) : $my_query->the_post(); the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); endwhile; endif; Question:
how to rewrite the code so that it displays part of the text after the more tag with an anchor an id . That is, the segment, which has an anchor id c name . There are only 2 such bindings on the page after the more tag, they need to be displayed in separate divs.
Looks like that:
<h1>Заголовок</h1> <p>текст</p> <--more--> <div id="1"><a name="1"></a></div> <h2>Заголовок 1</h2> <p>текст</p> <div id="2"><a name="2"></a></div> <h2>Заголовок 2</h2> <p>текст</p> The main page should display text with id = "1" in one block, and the text from id = "2" into another div block.