Clicky

Related Posts

This article is for AMP Theme Framework users.

About this Component

Related Post Component is for displaying the related posts for the single in your AMP theme.

How to use:

Following are the steps to use this component.

Step 1:

To initiate the support for the component in your theme just add the following code to the “functions.php” of the AMP Theme Framework directory.

This was the back-end part where we’ve just initiated, now to make it appear in the front-end follow the next step.

Step 2:

To add the Related Post we need to call it.
example: add the following code in “single.php” of the AMP Theme Framework directory.

with this, you’re successfully able to set Related Post on your theme.

But By default, it will show Image and Excerpt in Related Posts. If you don’t want image or excerpt in Related Posts then you can hide them using the Arguments.

Example: Add the following code to show Related Posts without Image and Excerpt.

You can also call separate parts of Related Posts inside the Query.

But Wait, There’s more!

You can even crop the image according to your need.

That’s all!

That’s it for this tutorial!

We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.

Ask your Questions Directly!
If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!
Updated on July 22, 2019

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Comments

  1. Hello guys I really apreciate what you are doing with this plugin.

    I have a question about this template for displaying related posts.
    Is there a way to overwrite this template in a custom theme framework?

  2. its showing 500 error after add this function
    // Related Posts
    add_amp_theme_support(‘AMP-related-posts’);

Leave a Comment