www.n1bar.com
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Limit number of tags added to postNever mind i got it
It is
if (!is_array($keywords)) { $count=0; $keywords = explode(',', $keywords); } foreach ($keywords as $thetag) { $count++; wp_add_post_tags($post_id, $thetag); if( $count > 3 ) break; }at least post your website mate
Most of the time you can hide data relatively easy from css using display:none or you can use margin floats and padding to get it to the position you want
LI and UL tags got removed,
I did the following but is kinda buggy, when you remove a bookmark it doesnt really remove it unless you refresh, it has something to do with the tables.
if ($favorite_post_ids): $favorite_post_ids = array_reverse($favorite_post_ids); echo "<table id=\"fav-table\" width=\"100%\">\n"; foreach ($favorite_post_ids as $post_id) { $p = get_post($post_id); echo "<tr>\n"; echo "<td>" . get_the_post_thumbnail($post_id, array(55,55), array('class' => 'fav-thumbs')) . "</td>\n"; echo "<td><a href='".get_permalink($post_id)."' title='". $p->post_title ."'><span class='fav-title'>" . $p->post_title . "</span></a></td>\n"; echo "<td>"; wpfp_remove_favorite_link($post_id); echo "</td>\n"; echo "</tr>\n"; } echo "</table>\n";Also i got rid of all the
- and
- tags
Forum: Plugins
In reply to: [Infinite-Scroll] [Plugin: Infinite-Scroll] Please help me find selectorsNever mind got it working.
Forum: Your WordPress
In reply to: Feedback www.n1bar.comForum: Themes and Templates
In reply to: Fetch post thumbnail or attachmentI gave up and just added a featured image instead.
THanks andy thats awesome
Hi, the script is supposed to de-register css and js from everywhere except when it finds a tribe_events page.
That is the purpose.
What is it that you are trying to achieve.?
Thanks
I want this to, but i think is only available with the PRO version
I found the solution
REPLACE
if ( !is_page('1176') )WITH
if ( get_post_type() !== 'tribe_events' )The issue now is that, they will be loaded in the calendar page but when you click on an event, as it has different ID they will not be loaded, now what do we do
To overcome this issue i made a simple fix, add the following to your theme’s functions.php and change the value in !is_page for the value of the page where your calendar is located, or if you dont know the id use the slug ‘Events’.
The script deregisters js and css code on all pages exept the one you put in the !is_page(‘Events’). this means that it will only be loaded in Events page and not all other pages.
// DEREGISTER JAVASCRIPT EVENTS function decalendarjs() { if ( !is_page('1176') ) { wp_deregister_script('tribe-events-pjax'); wp_deregister_script('tribe-events-calendar-script'); } } add_action( 'wp_print_scripts', 'decalendarjs'); // now just run the function // DEREGISTER JAVASCRIPT EVENTS function decalendarcss() { if ( !is_page('1176') ) { wp_deregister_style('tribe-events-calendar-style'); } } add_action( 'wp_print_styles', 'decalendarcss'); // now just run the function