canwild
Forum Replies Created
-
I installed 2.1 and changed /single to /single-205 in my themes folder to hide my template customizations. My site now shows no listings on the main page or the category pages. Search results display correctly and similar listings appear correctly when I click on a tag. Nothing displays when I click on a listing for more details or try to edit a listing. The Manage Listings and Submit A Listing pages do display correctly.
Looking more closely at wpbusdirman_sticky_loop in deprecated.php, I see it now uses wpbdp_the_listing_excerpt now where it used wpbusdirman_post_excerpt in 2.0.5. This looks similar to the modification I made to the function in 2.0.5 so my sticky listings could be rendered using a listing template.
Is there something like “is_sticky()” that I can use in the listing template to provide specific formatting for my sticky listings?I cannot upgrade to 2.1 because it does not render my theme correctly. In particular, I modified wpbusdirman_sticky_loop in 2.0.5 to properly render my featured (sticky) listings. The existing wpbusdirman_sticky_loop renders the listing using wpbdp_the_listing_excerpt but I need to render each field separately. WPBD supports separate field formatting for regular listings but not for sticky listings. I see wpbusdirman_sticky_loop has now been moved to deprecated.php and was surprised to see it still being used in your businessdirectory-category.tpl.php template and referenced in your documentation.
My site is https://wildernesstravelguide.comYes, I ended up using
get_post_meta($post->ID, "_wpbdp[sticky]", $single=true)
for the search results and browsing by tag in my theme since these use the index.php template in my theme folder. These pages use a single loop. The View Listings and Category pages use two loops – one for the sticky listings and one for the regular listings – so these are trickier and also mess with the pagination. I ended up modifying the viewlistings function in views.php so it rendered them in a separate template.Perhaps it would be better to implement the “sticky” feature by sorting the listings on two fields – first on the sticky flag and then by date, count, author, or whatever. This might eliminate the need for two loops.
Thanks for the suggestion. I need to make more significant changes then are possible through CSS. I have been able to make fairly complex changes to the regular listings but the sticky listings are displayed using “wpbusdirman_single_listing_details();” and I am looking for a way to insert the post title, tags, excerpt, content etc. individually into my HTML so I can format the sticky listings in the same manner as the regular listings.
I was copying the templates from the plugin’s “/posttemplate” directory and renaming them instead of copying the templates from the “/templates” directory. Moving these templates to my theme’s “/single” directory works fine.
Search for
<div style="clear:both;"></div>
in jquery.pinterest-lightbox.js and replace it with
<div style="clear:both;"></div><script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
This will launch a pop-up window when you click the Pin It button. The javascript is part of the Pin It button code provided by Pinterest and appears to be missing from the plug-in.
I ended up removing the Facebook and Twitter buttons from the light box because they were tagging the page rather than the image. I found the info on https://www.brettshumaker.com/nextgen-gallery-tweet-and-like-buttons/ was helpful.
I was able to create my own template where I specify the image id of one of the images on the page as a URL parameter (e.g., https://www…?show=ngg-344). The image is then displayed in the light box when the page loads.
Forum: Plugins
In reply to: [Pinterest Lightbox] [Plugin: Pinterest Lightbox] Not resized LightboxHaving made the comment about SlimBox not supporting image resizing, others have made modifications to the SlimBox code to support it – see https://www.trips.elusien.co.uk/slimbox2/example9.html
This mod allows you to provide SlimBox with display height and width parameters in either pixels or percentages. More work would be required to actually optimize the display size for the browser window, and as indicated by the author of SlimBox would detract from its efficiency.
This is just a hack but…
If you have de-minimized the javascript you should see around line #66 a long line of code that starts with “return [Q.href,….”. I replaced that line (all the way to the closing “]”) with the following to add the Facebook and Twitter buttons. All this does is add a couple of iframes for displaying the Facebook and Twitter buttons.
return [Q.href, '<span style="float: left; margin-right: 20px; display: block;"><a href="https://pinterest.com/pin/create/button/?url=' + document.URL + '&media=' + Q.href + '&description=' + Q.title + '" class="pin-it-button" count-layout="horizontal" target="_blank"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></span><span>' + Q.title + '</span><iframe src="https://www.facebook.com/plugins/like.php?href=' + document.URL + '&layout=button_count&show_faces=false&width=10&action=like&colorscheme=light&height=21" scrolling="no" frameborder="0" style="display:inline; border:none; overflow:hidden; width:100%; height:21px;" allowTransparency="true"></iframe><iframe allowtransparency="true" frameborder="0" scrolling="no" src="https://platform.twitter.com/widgets/tweet_button.html?url=' + document.URL + '&via=xtapit&text=' + document.title + '" style="width:115px; height:21px;"></iframe><div style="clear:both;"></div>']
Adding the Google +1 button was trickier and requires a new php script in the plugin directory and changes to pinterest-lightbox.php
Forum: Plugins
In reply to: [Pinterest Lightbox] [Plugin: Pinterest Lightbox] Not resized LightboxPinterest Lightbox appears to use SlimBox for its lightbox features. SlimBox is very efficient code and does not support image resizing to fit the browser window.
I used jsbeautifier.org to de-minimize the JavaScript and added Facebook, Twitter and +1 buttons using iframes as a hack until version 1.1 is released.
https://canadawilderness.com/photo-contest/2011-photo-contest
I used jsbeautifier.org to de-minimize the JavaScript and added target=”_blank” to function(Q) around the new line #66. This opens the Create Pin page in a new tab.
https://canadawilderness.com/photo-contest/2011-photo-contest
Forum: Themes and Templates
In reply to: Display a title based on multiple tagsI eventually came up with the following which works for my limited application. My activity specific tags are all named like “Fishing in Canada” with slugs like “fishing”. My location specific tags are all named like “Activities in British Columbia” with slugs like “bc”. When I call archive.php using two tags (e.g., “fishing+bc”) the following code finds the 2 tags names and joins them back together as “Fishing in British Columbia”. The code bypasses situations where there is only one tag in the query. The code does not handle “bc+fishing” just “fishing+bc”. With 20 or so activities and 10 provinces, this is easier than coding a separate page for each combination.
$page_title = wp_title('', false); $tags = get_query_var('tag'); $tag = explode(' ',$tags); if (count($tag)>1) { $tag_name = get_tags(array('slug'=>$tag[0])); $page_title = str_replace(' in Canada','', $tag_name[0]->name); $tag_name = get_tags(array('slug'=>$tag[1])); $page_title .= str_replace('Activities','', $tag_name[0]->name); }
Not very elegant but it works.