|

Displaying Portfolios in UAE Post Widget Using Custom Filters

Do you want to elevate your WordPress website by seamlessly showcasing your stunning portfolio within the UAE Post Widget?

The following guide explains how to display portfolios in the UAE Post Widget on your WordPress website by adding a custom filter to the child theme’s functions.php file.

How to Display Portfolios in UAE Post Widget

Before you get started, ensure you are using a child theme to make modifications. If not, it’s recommended to create one to avoid losing changes during theme updates.

Then, you can follow the below enlisted steps to implement the code snippet:

  • Navigate to your WordPress dashboard.
  • Go to Appearance > Theme Editor.
  • On the right-hand side, find and select the Child Theme from the dropdown menu.
  • Locate and click on the functions.php file.
  • Within the functions.php file, add the following custom filter code:
add_filter( 'astra_portfolio_exclude_portfolio_items', '__return_false' );
  • After adding the filter, click on the Update File button to save the changes.

This filter specifically targets the portfolio items excluded in the UAE Post Widget.

Before adding this custom filter, using the UAE Post widget, when you select the post type as a portfolio, it shows a warning message “Sorry, we couldn’t find any posts. Please try a different search”.

By adding this custom filter, you override the default behavior of portfolio exclusion, making sure that the UAE Post Widget will showcase all portfolio items.

We hope this document has been helpful. If you have any questions, feel free to leave a comment below.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

On this page
Scroll to Top