ts
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Include post tags in body_classI seem to have solved my issue, but I’d still love some feedback from people more experienced in PHP. Here’s how I got it to work.
function category_id_class($classes) { global $post; $posttags = get_the_tags(); foreach((get_the_category($post->ID)) as $category) $classes[] = $category->category_nicename; if (is_single()) { foreach ($posttags as $tag) $classes[] = $tag->slug; } return $classes; }Forum: Fixing WordPress
In reply to: Show posts but exclude a specific tagSo I may have been having a senior moment – turns out I was editing the wrong file (just been tidying up my theme).
This seems to be doing the trick, but feedback is still welcomed.
<?php $section_headlines = new WP_Query(array('tag__not_in'=>'70','cat=6')) ?>Thanks.
ETA: Okay, so now I’m VERY confused. The above code causes the category number to be ignored. So it’s a bit of a fail so far. Back to square one. π
Forum: Networking WordPress
In reply to: Two domains, one site – with only slight differencesThanks for your help, it’s much appreciated. As mentioned in my first post, I’m still trying to get my head around the whole thing.
The idea of having to set up three sites (within multisite) just to ensure a redirected URL displays a different header throughout the site is adding to my confusion.
The regional data/posts themselves do not have to be separated, I just want visitors from the second region to feel ‘at home’ on the site rather than simply being redirected to the main site and its branding.
Sorry if it seems like I’m just refusing to listen, I just want to make sure we’re on the same page and I’m feeling a bit out of my depth with multisite.
Forum: Networking WordPress
In reply to: Two domains, one site – with only slight differencesThanks for the reply, Ipstenu.
Sorry, I realised my initial message wasn’t clear. I don’t want to duplicate the data onto another site, I just want to brand the ‘secondarysite’ differently.
To clarify, it’s for an online magazine that covers two different regions – hence the different domain names. All the magazine articles are the same, but ideally people who access the website by typing in the ‘secondarysite’ URL would see the ‘secondarysite’ logo, not the ‘mainsite’ logo – although they’ll be viewing the same website.
The index.php change would also enable the front page to be customised for the people visiting from ‘secondarysite’, with any featured articles tailored towards them.
Forum: Themes and Templates
In reply to: Display name of child category beside excerptThanks David, that’s better.
One more thing though – this orders the posts by sub-category, then date. Is it possible to just have it ordered by date? As in, most recent posts first regardless of sub-category.
Thanks.
Forum: Themes and Templates
In reply to: Display name of child category beside excerptNot sure if it’s perfect code, but this seems to be working:
<?php $categories = get_categories("child_of=6"); foreach ($categories as $cat) { ?> <?php query_posts("cat=$cat->cat_ID&showposts=-1&order=ASC&orderby=name"); ?> <?php while (have_posts()) : the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> <a href="<?php echo get_category_link($cat->cat_ID) ?>"><?php single_cat_title(); ?></a> | <?php the_excerpt(); ?> <?php endwhile; ?> <?php }?>Forum: Themes and Templates
In reply to: Display name of child category beside excerptThanks David.
Unfortunately there seems to be an issue with the syntax in
if $c->cat_ID != $catid { $cat_name = $c->cat_name; break; } }Appreciating your help!
Forum: Themes and Templates
In reply to: Need PHP help with loopPERFECT! Thank you so much for all your help.
Forum: Themes and Templates
In reply to: Need PHP help with loopThanks again. It’s sort of working now, except for the part where I want titles only of the last four posts in an unordered list. Instead it’s showing all posts (other than category 7) with excerpts.
Just to clarify – excluding the featured article, there should be seven posts displayed: three with titles and excerpts and four in an unordered list with titles only.
Appreciating your assistance, JPry. π
Forum: Themes and Templates
In reply to: Need PHP help with loopHi JPry,
Thank you so much for your assistance – unfortunately there seems to be an issue with line 8:
Parse error: syntax error, unexpected '<' in loop.php on line 8My PHP knowledge is already limited, so if you could advise what might be causing this issue I’d really appreciate it!
Thanks again.
Forum: Plugins
In reply to: Review not PublishI’ve been looking for a similar functionality, and came across this plugin. Is this the one you’re thinking of?