Adam
Forum Replies Created
-
Hiya,
Is line 34 the
'current_category' => get_the_category()[ 0 ]->cat_ID,
line in your script?If so its because you’re running an older version of php which doesn’t support addressing arrays directly after a function call.
What you’d need to do instead is define a variable first:
$category = get_the_category()
and then change the other line'current_category' => $category[ 0 ]->cat_ID,
.Also should have said the str_replace and preg_replace lines are only necessary if you’re using Twitter’s Bootstrap for formatting.
You could modify the
sidebar.php
file of your theme to do this without using the categories widget directly.Something like:
if( pmpro_hasMembershipLevel( array( 'Free', 'Bronze', 'Silver', 'Gold' ) ) ) { $categories = wp_list_categories( array ( 'show_option_all' => '', 'orderby' => 'name', 'order' => 'ASC', 'style' => 'list', 'show_count' => 1, 'hide_empty' => 1, 'use_desc_for_title' => 0, 'child_of' => 0, 'feed' => '', 'feed_type' => '', 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'include' => '', 'hierarchical' => 1, 'title_li' => '', 'show_option_none' => __( 'No categories' ), 'number' => null, 'echo' => 0, 'depth' => 0, 'current_category' => get_the_category()[ 0 ]->cat_ID, 'pad_counts' => 1, 'taxonomy' => 'category', 'walker' => null ) ); $categories = str_replace( 'current-cat', 'active', $categories ); $categories = preg_replace( '/\((\d+)\)(?=\s*+<)/', '<span class="badge pull-right">$1</span>', $categories ); echo $categories; }
Regards
A bit message but this seems to do the trick in the theme’s search.php
$content = apply_filters( 'the_content', get_the_excerpt() ); $content = str_replace( ']]>', ']]>', $content ); $content = preg_replace( '/<div class="pmpro_content_message">.*<\/div>/i', '<a class="btn btn-default pull-right" href="' . get_permalink() . '">Read more...</a>', $content ); echo $content;
Forum: Themes and Templates
In reply to: Putting an Ad in the HeaderTry putting
margin-top: 50px;
Or whatever after your
float: right;
Forum: Themes and Templates
In reply to: Add Gravatars For The Post AuthorCan you post the code you’re actually using?
Forum: Themes and Templates
In reply to: Ahhh! Losing my mind with Internet Explorer!I just checked it with IE9, 64-bit. Looked fine. Changing that to IE7 in standards mode and again looked fine. IE7 in quirks mode however had your header way over to the right, so perhaps thats something to look at – whatever is at the top of the file causing it to trigger quirks mode?
Regards
Forum: Themes and Templates
In reply to: Add Gravatars For The Post AuthorLooking at the html you have output would suggest the $id_or_email has not been populated, or show avatars is set to no in your admin/settings/discussion.
Otherwise the code
<?php echo get_avatar( get_the_author_meta('ID'), 64 ); ?>
should work fine.
Regards
Forum: Hacks
In reply to: Setting Category/Tag Slug to "."Many thanks for that. I’d seen the no-cat-base plugin but for some reason didn’t find the no-tag-one!
Both work a treat and do just what I need.
I know what you mean about possible collisions and will live with the risk for now, although I’ll probably do some sort of plugin to detect it at design time for when its rolled out to the masses.
Many thanks once again.
Kind regards,
Adam M.
Forum: Fixing WordPress
In reply to: wp 3.1 permalinks still broken after many trys with fixes describedChipping in my two-penneth.
Multiple sites, multiple hosts, some Windows, some Linux. All are running 3.1.1.
Those that have /%category%/ in the pretty permalinks appear to generate correctly (i.e. the hyperlink is site/category/… but when accessed result in a 404.
Happy to run any additional tests anyone needs to help resolve this.
This is happening because the files
ngg.slideshow.js
ngg.slideshow.min.jsAre hardcoded to only load the first three images from any given Gallery.
I have modified them on my site replacing the 3 with stackLength (as that variable is defined as giving the total number of images) however it is pretty slow to be honest so I’m going to have to continue messing around with it.
Regards
The plugin does allow you to specify a custom taxonomy – it just doesn’t provide a user interface to do this for you. The method is described on the Installation tab of the documentation and involves changing part of the code.
That being said the plugin then only functions as described for posts where you populate the relevant taxonomies – all others are broken, as are pages.
This is extremely unfortunate as I need a category structure which WordPress doesn’t like (it insists on Category Slugs being unique, not taking into account the hierarchy).