Troubleshooting Featured Posts Issues

  • Sticky
    Posted in: WPJobus  

  • Keymaster
    Alex Ursu
    July 20, 2016 at 12:30 pm #17228

    In the past we have made updates that solved Featured Jobs/Resumes/Companies issues. (I will refer to them as “Featured J/R/C” later in the post)

    This is a guide on troubleshooting these issues if you still somehow encounter them.

    It might save you a lot of time between the Support Team answering , the exchange of credentials, the actual debugging and solving.

    So let’s start it simple. We will be looking at an example of featured jobs issue, replace the word ‘job’ with ‘resume’ or ‘company’ and it works all three ways.

    Featured J/C/R issue.

    Symptoms : Featured Jobs/Companies/Resumes don’t appear on the right of the latest_resumes shortcode that is located by default on the frontpage.

    Explanation: Basically the Featured J/C/R are being selected from the database. The problem here in 90% of the cases is that there is no “valid” F/C/R to be selected and so none is displayed. Here is the actual code that selects the featured F/C/R. (More specifically the featured jobs)

    SELECT DISTINCT p.ID
    FROM {$wpdb->prefix}posts p
    LEFT JOIN {$wpdb->prefix}postmeta m ON p.ID = m.post_id
    WHERE p.post_type = 'job' ( or ‘resume’ or ‘company’ in those specific cases)
    AND p.post_status = 'publish'
    AND m.meta_key = 'wpjobus_featured_expiration_date'
    AND m.meta_value >= '".$currentDate."'
    ORDER BY RAND()"

    If it seems complicated – fear not, it is actually pretty simple. What you need to understand from here is that the code selects the data from the database which has the following values :

    1.The post is a Job (or Resume or Company).
    2.The post is published.
    3.The post is featured.
    4.The post has an expiration date that is later than $currentDate. (This is made so the featured option can actually expire, so you won’t

    Troubleshooting:

    Knowing how the code works allows you to troubleshoot. If you have issues with Featured J/R/C not displaying check for the following things:
    1. Do you have one (or more) J/C/R? – If you answered “no” , make a test one.
    2. Is/Are the J/C/R(s) published? – If you answered “no” set it to “published”.
    3. Is/Are the J/C/R(s) featured? – If you answered “no” set it to “featured”.
    4. Do(es) they(it) have an expiration date that is set to a day later than the day you are troubleshooting? – If you answered no give it a temporary expiration date of 99days for testing purposes.

    If after this process you still encounter problems with the Featured J/R/C please open a ticket here and email me at alexthemesdojo@gmail.com with your credentials to an admin account and a link to the ticket explaining the issue. (FTP Access is also desirable)

    I hope this post will save you some time, or will at least give you a better understanding of what is happening “under the hood” of a very small portion of the theme.

    Regards,
    Ursu Alex
    ThemesDojo Support

    • This topic was modified 11 months by  Alex Ursu. Reason: Grammatical Errors

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.