Pagely MultiEdit
[resolved] MultiEdit Regions and Conditionals (3 posts)

  1. Andrew Miguelez
    Posted 3 years ago #

    I would like to conditionally include code in my custom pages, dependent on whether or not there is content in a certain region. How can I do this?


    <?php if (region) { ?>
      <div class="region">
        <?php multieditDisplay('region'); ?>
    <?php } ?>


  2. Acts7
    Posted 3 years ago #

    I see its been 3 months. Hopefully this is still of help to you or others?

    // don't forget to add the suffix class "multiedit_" which is automatically appended to all of your multiedit fields.
    //you can find the full name, by viewing your post , going to the custom-fields section and clicking "show/hide multiedit fields"
    In your case you should see "multiedit_region"

    // if you are checking multiple fields in unique spots on your template, be sure to give each a unique variable name.
    //this could be done easier with a function where you pass the key name but for simplicity this works
    // define the key you want to find
    $key4 = 'multiedit_region';
    // use this WP built in function to grab the meta key
    $themeta4 = get_post_meta($post->ID, $key4, TRUE);
    // now lets see if anything was returned in that meta key value
    if($themeta4 != '') {
    // if found , display the multiedit field and its surrounding html code
      <div class="region">
        <?php multieditDisplay('region'); ?>
  3. Andrew Miguelez
    Posted 2 years ago #

    The project I needed this solution for is long finished and I forget how I went about handling it. But your answer is sufficient to resolve my topic. I hope this is a help to others searching for a way to do the same thing I was.

    Thank you, @Acts7.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Pagely MultiEdit
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic