0

ブログ以外の Wordpress のヘルプが必要です (私はブロガーではありません..)

そのため、Wordpress ブログから投稿を取得する必要があります。なんとか投稿を取得できましたが、カテゴリと時間で並べ替える必要があります。ここに私のコードの一部があります:

                          <div class="8u skel-cell-mainContent" id="newsfeed">

                            <!-- Main Content -->
                                <?php if ($_GET['id']) {
                                    $id = $_GET['id'];
                                    $post = get_post($id);
                                    echo "<section>";
                                    echo "<a href='javascript:history.back();'>&#8592;Tilbake</a>";
                                    echo "<header style='font-size: 30px;'>";
                                    echo "<h2>".$post->post_title."</h2>";
                                    echo "</header>";
                                    echo "<p>".$post->post_content;
                                    echo "</section>";

                                } else {
                                    while (have_posts()):

                                        the_post();
                                        echo "<section>";
                                        echo "<header style='font-size: 30px;'> ";
                                        echo the_title('<h2>', '</h2>');

                                        echo "</header>";
                                        the_excerpt('<h3>', '</h3>');
                                        $id = get_the_ID();
                                        echo "<p><a href='nyheter.php?id=".$id."#newsfeed'>Les mer...</a></p>";
                                        echo "</section>";

                                    endwhile;
                                } ?>
                        </div>
                        <div class="4u">

                            <!-- Right Sidebar -->
                            <section>
                                <header>
                                    <h2> <?php the_widget( WP_Widget_Archives, 'title=Arkiv' ); ?> </h2>
                                </header>
                            </section>
                            <section>
                                <header>
                                    <h2> <?php the_widget( 'WP_Widget_Categories', 'dropdown=1&count=1', 'title=Kategori' ); ?> </h2>
                                </header>
                            </section>



                        </div>
4

1 に答える 1