Forum

Thread tagged as: Question, Blog

Blog post link not working

I have 7 'boxes' on the home page each is a blog post. I have changed the layout and order of the boxes and matched the new order to the blog post but none of them now link to the blog/article. I have not changed any of the code. How to I fix this?

   <?php    
// Include the header. You can find this in tempates/layouts/global
perch_layout('global/global.header', [
     'title'=>perch_pages_title(true),
]);

     perch_layout('header.home');

    perch_layout('intro.box');

      perch_blog_custom(array(
              'sort'=>'postDateTime',
              'sort-order'=>'DESC',
              'filter'=> 'homepageorder',
              'match' => 'eq',
              'value' => '1',
             'template'=>'blog/post_in_list_home_dark_box.html',
              'section' => 'Blog',
              'count'=>1
             ));

etc

blog/post_in_list_home_dark_box.html template

     <div class="box-one">
<div class="text-box-one">
    <section>
        <div class="text-box">
            <h1 class="title-heading"><perch:blog id="postTitle" /></h1>
            <perch:blog id="excerpt" type="textarea" markdown="true" />
            <a href="<perch:blog id=" postURL " />" class="button">READ MORE</a>
        </div>
    </section>
</div>
         </div>
David Roberts

David Roberts 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Be sure to correct this:

<perch:blog id=" postURL " />

to

<perch:blog id="postURL" />

but otherwise, how is it failing? You say the link is not working, but what are you seeing? An incorrect URL in the href attribute, or does the page itself not respond how you intended it to? Something else?

That fixed it. Thanks.

When you click the link it just reloads the home page