profile counter myspace
Website Design and Development | WordPress Development
Call Us Free: 1-877-792-0328

Profi Search Form and ACF

I’ve been working on a project for a while now. The site uses CPT (Custom Post Types UI), ACF (Advanced Custom Posts) and Profi Search Form. The entire project was fairly easy to setup.

One of the custom fields may or may not have an URL in it. If it doesn’t we didn’t want a link at all.

A big shout out to David Remer (Profi Search Form plugin developer) for assistance. The code to accomplish this is and it’s added to the layout for the Single Result Element Layout under Search Filter:


<div style="float:left; max-width: width: 25%;">
	<a href="#the_permalink#">#thumbnail#</a>
</div>
<strong>
<?php $link = get_post_meta( get_the_ID(), 'project_url', true );
if ( ! empty( $link ) ): ?>
<a href="<?php echo $link; ?>">
<?php endif; ?>

<?php echo get_post_meta( get_the_ID(), 'client_page_title', true ); ?>
<?php if ( ! empty( $link ) ): ?> </a> <?php endif; ?>
</strong>
<br />
<strong><?php echo get_post_meta( get_the_ID(), 'project_type', true ); ?></strong>.
<?php echo get_post_meta( get_the_ID(), 'project_description', true ); ?>

taxstrat

CSS for the abhove layout.

fieldset.sf-element.select {
    float: right;
    margin: 0;
    text-align: right;
}

div.sf-filter legend {font-size: 11px; font-weight: normal;}
.sf-result-head {
    background: transparent !important;
    border: none !important;
}

ul.sf-result p {margin-left: 4px;display: inline;}
ul.sf-result {background-color: transparent !important;}
.sf-result li {
    background: transparent !important;
}
.sf-result li {
    border: 1px none #cacaca !important;
}
/*	This set alters the Services/Clients page 	*/
body.page-id-45 .sf-result > li {
    left: 30%;
    padding: 7px 0;
    position: relative;
    width: 70%;
}
body.page-id-45 .sf-result strong:nth-child(2) {
    display: table-cell;
    float: left;
    left: -43%;
    position: absolute;
    width: 38%;
    line-height: 15px;
    padding: 4px 0;
    border: 1px solid red;
}
body.page-id-45 .sf-result br {
    display: none;
}
/*	This set alters the Library/Archive page 	*/
.page-id-55 ul.sf-result {
    list-style: outside none disc;
    margin: 0 0 0 28px !important;
}

.page-id-55  .sf-result > li {
    margin: 0 0 10px;
    padding: 0;
}

.page-id-55  .sf-result > li strong {
    font-weight: normal;
}

Leave a Reply

WordPress Code Tidbits

Marketing

News & More