• Hi,

    I am looking for a way to exclude certain terms from the displayed titles.
    I have landing pages where the shortcode works perfectly as follows:
    [random_post_on_refresh post_type="issslpg-landing-page" show="title"]

    However, it only displays the most recently created posts.

    I would like it to display, for example, only posts containing the word or slug “roofer,” or to exclude posts with that word.
    I tried using category taxonomies, but it only works for the landing page templates. Unfortunately, the landing pages themselves are not listed in categories.
    The same goes for CSS classes—I can’t define a div in CSS using Elementor.

    Chat GPT gave me some advice on modifying the source code, but that didn’t work either.

    thanks for your replies.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter djsava

    (@djsava)

    I find an issue for displaying old posts :
    change number posts on RandomPostOnRefresh.php

    $query_args = [
    'post_type' => $post_types,
    'posts_per_page' => 100,

    to

    $query_args = [
    'post_type' => $post_types,
    'posts_per_page' => 2000,
    Plugin Author Micah Wood

    (@wpscholar)

    @djsava You can use the search attribute to only fetch items containing the word “roofer”.

    The taxonomy attribute will work with any taxonomy, but when combined with the post_type you have to select a post type that utilizes the specific taxonomy.

    While you can bump the posts_per_page to something above 100, that is not recommended for performance reasons. It is better to use the other attributes to customize the query and only select what you want to show.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.