Skip to content

Non-featured posts not loading correctly #54

@tikrin

Description

@tikrin

From a wonderful contributor:

I'm using IssueM 2.7.4 and experiencing a problem when certain issues are saved; the system isn't properly registering when a post is or isn't a featured thumbnail or a featured rotator item when displaying using the shortcode.

The problem is in how the system finds non-featured posts; line 54 of issuem-shortcodes.php checks to see if the meta fields _featured_rotator or _featured_thumb exist in a post. This worked until recently, when a coding change in lines 187 and 192 of issuem-post-type.php sets those meta fields to the word "off" if they're not set.

So, the meta field contains the word "off", but the check is to see if the field exists at all, which will always return true.

My fix was to change line 54 of issuem-shortcodes.php to read:

$args['meta_query'] = array(
'relation' => 'AND',
array(
'key' => '_featured_rotator',
'compare' => '!=',
'value' => 'on'
),
array(
'key' => '_featured_thumb',
'compare' => '!=',
'value' => 'on'
)
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions