• I am in the process of converting a static website to all WordPress (it already has WordPress section for news)

    On the old site I could, on a non-wordpress page, do links to links to the titles of the last few articles (posts) by using this code:

    <div id="more" style="width: 290px; float: right;">
    More
    <strong><a href="https://www.hadleightemple.org.uk/CorpsNews/?cat=9" target="_blank">Silver Service Club News</a>:</strong>
    <ul class="navlist" style="margin-left:15px; font-size:0.8em" >
              <?php require_once('../CorpsNews/wp-blog-header.php');
    $posts = get_posts('numberposts=5&category=9&order=DESC&orderby=post_date');
    foreach ($posts as $post) : start_wp(); ?>
              <li style="margin-left:margin-left:3px"> <a href="<?php the_permalink() ?>">
                <?php the_title(); ?>
                </a></li>
              <p>
                <?php endforeach;  ?>
              </p>
            </ul>
    </div>

    I have tied to put this code on the page, which is now a WordPress page, but it doesn’t appear as it should.

    I am using Weaver II Pro.

    Are you able to help please?

    TIA

    Brian

Viewing 2 replies - 1 through 2 (of 2 total)
  • By default, you can’t include PHP code in the content of a WordPress page. You can either install a plugin or use a widget to do what you want, or you can install a plugin that allows you to use the PHP code in a page (can be a security risk)

    Weaver II Pro is not a contributed theme. They have their own support page which you can find at:

    https://forum.weavertheme.com

    Thread Starter bnrepiano

    (@bnrepiano)

    Thanks Matt.

    I don’t know what you mean by a contributed theme, but I found the answer by following the link you kindly gave.

    Brian

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Links to Posts on a Page’ is closed to new replies.