Forums

[Plugin: More Fields] Exclude blank fields in bxSlider (5 posts)

  1. Jonster1220
    Member
    Posted 9 months ago #

    I am currently trying to make a bxSlider with content from fields that I created through More Fields.

    <div class="left">
    		<ul id="slider">
    			<?php while (have_posts()) : the_post(); ?>
      				<li><?php meta('content1'); ?></li>
    				<li><?php meta('content2'); ?></li>
    				<li><?php meta('content3'); ?></li>
    				<li><?php meta('content4'); ?></li>
     				 <?php endwhile; ?>
    			</ul>
    		</div>

    This will display everything correctly and fine, however content4 does not have content in it. How do I check to see if it is empty to skip it in my bxScroller? Thanks in advance for any help!

  2. Jonster1220
    Member
    Posted 9 months ago #

    I'm not sure if I am missing information to help code my problem. Let me know if there is anything I can give to help out.

  3. Jonster1220
    Member
    Posted 9 months ago #

    <php
    $key = content1();
    if (empty($key)) {
        $content1 = '<div class="clear"></div>';
    } else {
        $content1 = '<p>'.$key.'</p><div class="clear"></div>';
    }
    if ( has_content1() )
    echo <li><?php meta ('content1');?></li>;
    ?>

    maybe something along these lines? I'm just spit balling.

  4. Jonster1220
    Member
    Posted 9 months ago #

    additional info:
    -The box title is "Home Content"
    -The Fields are called "Paragraph 1", "Paragraph 2", ect..
    -Field Keys are called "content1", "content2", "content3", "content4"
    -Tpyes are all WYSIWYG

  5. Jonster1220
    Member
    Posted 8 months ago #

    I am still trying to figure out a filter for this if anyone has an idea

Reply

You must log in to post.

About this Topic