MEC Events Looper Questions

I’m attempting to make a Upcoming Events feature on my client’s site that pull in the latest MEC events data.
Below is a sample of what I’m trying to create.

Below are a few items I had some trouble finding.

  1. Where is the dynamic meta data for an MEC Event Location (i.e. Address)?
  2. How do I set up the looper provider so that the WP Query string only pulls up MEC Events of a specific category? I’m trying to pull the event category called Families. Currently I have in my WP Query field post_type=mec-events&post_status=publish&meta_key=mec_start_date&meta_type=DATE&meta_compare=>=&meta_value={{dc:global:date format="Ymd"}}
  3. How do I set up a Looper Provider WP Query, so that it limits the number of events it will pull?
  4. I’m trying to make it so that each column only shows 1 event from each event type. How do I setup a Condition where the column is not visible if an event does not exist of a specific category? (Ex: Do not show this column if there are no upcoming Student events)

Hey @santosfel5,

The MEC Event Location is not a meta key but a Custom Taxonomy so it can be displayed using the Term Meta Dynamic Content like {{dc:term:meta key="address" term="195"}}.

image

You need to add in Taxonomy parameters into the mix like the example below.

post_type=mec-events&tax_query%5B0%5D%5Btaxonomy%5D=mec_category&tax_query%5B0%5D%5Bterms%5D=families

That’s compiled from:

$args = array(
    'post_type' => 'mec-events',
    'tax_query' => array(
        array(
            'taxonomy' => 'mec_category',
            'terms'    => 'families',
        ),
    ),
);

It’s not in the Provider but in the Consumer. Set the Looper Consumer to display a set number of posts. To do that, choose Many in the Consumer setting then set a number.

image

Your Element Condition would look like the following screenshot.

image

Hope that helps.

Hi @christian

Thank you for your help.

  1. MEC Event Location - I entered what you provided but it resulted in no data appearing. Am I supposed to grab the term number from somewhere?

  2. Pulling Events of Specific Category for each Column - I entered what you provided updating the term to each respective MEC Events category, but it did not change the data pulled. It still is just pulling from only the most recent event for all areas.

See here what it looks like currently:

This is how it should look:

Here is what I put for each respective WP Query.

Families
post_type=mec-events&tax_query%5B0%5D%5Btaxonomy%5D=mec_category&tax_query%5B0%5D%5Bterms%5D=families

Student
post_type=mec-events&tax_query%5B0%5D%5Btaxonomy%5D=mec_category&tax_query%5B0%5D%5Bterms%5D=student

Public
post_type=mec-events&tax_query%5B0%5D%5Btaxonomy%5D=mec_category&tax_query%5B0%5D%5Bterms%5D=public

Partners & Donors
post_type=mec-events&tax_query%5B0%5D%5Btaxonomy%5D=mec_category&tax_query%5B0%5D%5Bterms%5D=partners-&-donors

  1. Limit Looper Provider Number of Events - Thank you this worked.
  2. Conditional Columns based on Available Events by Category - Thank you. This looks like it should work.

Hey @santosfel5

Yes, you need to grab your own location. What I posted is only an example. You can use the Current Term or use a Term ID like my example. You can get the Location Term ID when creating a location.

Sorry about that, I must have accidentally removed the Field key which makes the query work. It should be like the following string.

post_type=mec-events&tax_query%5B0%5D%5Btaxonomy%5D=mec_category&tax_query%5B0%5D%5Bfield%5D=slug&tax_query%5B0%5D%5Bterms%5D=student

Anyway, you must learn how to use the WP_Query and generate a string on your own as we do not include building queries as part of our theme support. The query above was tested on my end and it works. If it still doesn’t work on your end, please consider signing up to One where we can suggest the correct query.

Thanks.

@christian

  1. MEC Location of Current Event - I see what you are showing here, but this is a static address. I need it to dynamically show the address of the current event shown. I did try using {{dc:term:meta key="address"}} to grab the address of the current event, but it pulled up blank.

  2. WP Query - I will read more into this. I did try to read through the documentation on Theme.co, but this appears to flesh it out a bit more. Thank you!

Hi @santosfel5,

Would you mind sharing your admin credential so that we can check on your setup clearly? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

I added a secure note to my post. The page is called Homepage. I also had a couple of questions.

  1. Currently my Event dates are showing up as today’s date rather than the actual start date of the event. Any idea why?

  2. Events are showing up that are in the past. It should be showing the latest upcoming event not past events.

Hello @santosfel5,

1.) You are using the incorrect dynamic content for the dates. You should be using: {{dc:post:meta key="mec_start_date" type="date" format="d"}}

2.) Yes, the display is correct. You just need to add a condition that the event will only be displayed if the MEC Start Date is after the date of today, {{dc:post:meta key="mec_start_date"}} after current date.

Please check out the secure note for the test page.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.