dnnsldr
Forum Replies Created
-
You can code this using font awesome:
<a href="<?php echo site_url(); ?>?wpfpaction=add&postid=<?php echo $post->ID ?>" class="heart-icon wpfp-link"><i class="icon-left fa fa-heart"></i>Favorite</a>
Forum: Plugins
In reply to: [WP Favorite Posts] WP-Favorite Posts and BuddyPressI am using a custom post type called ‘Locations’ where a user can favorite a location. This should get you started in the right direction. Just add your loop in between:
<div class="favoritePlaces"> <h3>My Favorite Places</h3> <?php $favorite_post_ids = wpfp_get_users_favorites($GLOBALS['bp']->displayed_user->userdata->user_login); if($favorite_post_ids) { foreach ($favorite_post_ids as $o) : $p = get_post($o); if ($p->post_status == 'publish') { $postID = get_post_meta( $post->ID); //$locationID = get_post_meta( $post->ID, $postID); //$locations = EM_Locations::get(array('location_id'=>$locationID)); $locationName = $postID[_location_name][0]; $locationCity = $postID[_location_town][0]; $locationState = $postID[_location_state][0]; $locationAddress = $postID[_location_address][0]; //$locationURL = $postID[guid][0]; $locationID = $postID[_location_id][0]; $favCount= $postID[wpfp_favorites][0]; $post_image_url = wp_get_attachment_image_src( $postID ); ?> <div class="feedItem places"> <div class="span5 feedImage placesColumns"> <a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail( $current_post, 'wpbs-featured-carousel' ); ?></a> </div><!-- end of feedImage --> <div class="span4 feedInfo"> <h3><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a><span class="heart-icon vanilla"><em class="count"><i class="icon-left fa fa-heart"></i><?php echo $favCount ?></em></span></h3> <p class="description"><?php echo $postContent; ?></p> <span class="info"><?php echo $locationAddress; ?><br /><?php echo $locationCity; ?>, <?php echo $locationState; ?></span> <!--<a href="#" target="_blank">clubaron.com</a>--> <ul class="feedLinks"> <li><a class="view-icon" href="<?php the_permalink(); ?>"><i class="icon-left fa fa-search"></i>View</a></li> <?php if (current_user_can('member')) { ?> <li><a href="<?php echo site_url(); ?>?wpfpaction=remove&postid=<?php echo $post->ID ?>" class="heart-icon wpfp-link"><i class="icon-left fa fa-heart"></i>Favorite</a></li> <?php } ?> <li><a class="share-icon popdiv bottom" rel="popdiv" data-content=" <ul class='socialShare'> <!-- facebook --> <li><a class='facebook' href='https://www.facebook.com/sharer.php?u=<?php the_permalink() ?>&t=A New Location from Nightvite' target='_blank' onclick='return fbs_click()'><i class='icon-left fa fa-facebook-square'></i></a></li> <!-- twitter --> <li><a class='twitter' href='https://twitter.com/intent/tweet?original_referer=<?php echo site_url() ?>&text=<?php echo urlencode(get_the_title()) ?>&url=<?php the_permalink() ?>' target='_blank' data-text='Check out this new Nightvite Location' data-count='none' data-hashtags='nightvite' data-url='<?php echo the_permalink(); ?>'><i class='icon-left fa fa-twitter-square'></i></a></li> <!-- google plus --> <li><a class='google' href='#' target='_blank'><i class='icon-left fa fa-google-plus-square'></i></a></li> <!-- email --> <li><a class='email' href='mailto:?subject=<?php gb_e('Nightvite has added a new location:') ?> <?php the_title(); ?>&body=<?php gb_e('Check this new Nightvite Location:') ?> <?php the_title(); ?>%0A<?php the_permalink(); ?>'><i class='icon-left fa fa-envelope'></i></a></li> </ul>"><i class="icon-left fa fa-share"></i>Share</a> </li> </ul> </div><!-- end of feeInfo --> </div><!-- end of feedItem --> <?php } endforeach; ?> <?php } else { ?> <div class="profile-item"> <strong>You currently have no favorite places. Why not <a href="<?php echo get_bloginfo('url'); ?>/places">favorite some places</a> now.</strong> </div> <?php } ?> </div>
Forum: Fixing WordPress
In reply to: Multisite registration problemdid you find anything out on this. I am having the same issue. The user is not being added to the site, even though I see them as a user.
Forum: Fixing WordPress
In reply to: How to check if image exists with an if/else statementthanks for the `$thumbnail = p75GetThumbnail($post->ID, 150, 120);
if ($thumbnail) {`I was using the built in featured post and the Simple Post Thumbnail plugin on each post and need a way to loop thru and check if it had a p75GetThumbnail image, and if it did use it; if not then use the featured image.
Heres the code if anyone else wants it:
<?php $featuredthumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); $permalink = get_permalink($post->ID); $studiopress = p75GetThumbnail($post->ID); if ($studiopress) { echo '<a href="'.$permalink.'" rel="bookmark"><img class="post-thumb" src="'.$studiopress.'" alt="'.get_the_title().'" /></a>'; } else if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { echo '<a href="'.$permalink.'" rel="bookmark"><img class="post-thumb" src="'.get_bloginfo('template_url').'/inc/timthumb.php?src='.$featuredthumb[0].'&w=200&h=150&zc=1&q=100" alt="'.get_the_title().'" /></a>'; } ?>
Forum: Fixing WordPress
In reply to: “Permalink Settings” page is Blank – WP 2.9.2Forum: Fixing WordPress
In reply to: images insted of wordsI have the Category Images ii displaying all child category images. What I don’t know how to do is to have the category image link to the category. Any ideas?