threevisual
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Custom post type templatefigured it out (I searched a bit longer and found the answer). Creating single-customposttypename.php did the job
Forum: Fixing WordPress
In reply to: Get odd / even postsWorked like a charm. Thanks!
Forum: Fixing WordPress
In reply to: Get odd / even postsanyone have an idea of how I could get this to work?
Forum: Fixing WordPress
In reply to: Get odd / even poststhanks for the comment, sadly I have no idea how to put that into code (I can just about code wordpress templates but not php).
at the moment i’m using this for the first column:
<?php global $post; $myposts = get_posts('numberposts=5'); foreach($myposts as $post) : setup_postdata($post);?>
I just need to adapt it so it shows even / odd posts.
Forum: Plugins
In reply to: Add column to post admin page?anyone have any ideas? thanks.
Forum: Plugins
In reply to: Post to category restriction?Thanks for the links, I’m trying to find something that won’t allow users to see restricted categories in the edit screen though. Any other ideas?
Forum: Fixing WordPress
In reply to: if is in ‘news’ category but is not indexgenius! thank you.
Forum: Fixing WordPress
In reply to: if is in ‘news’ category but is not indexThanks Simon, yes that makes perfect sense, you’re right, the last post is in category ‘3’ just need to try and figure a way around this
Forum: Fixing WordPress
In reply to: if is in ‘news’ category but is not indexso at the moment there is a news.php (the news landing page with a custom page template) and then separate posts in the news *category*.
The homepage has content from various categories but for some reason the code i’m using in the header…
<li><a href="/news/" title="News" <?php if (is_page_template('news.php')) {?>class="current"<?php } ?><?php if (in_category('3')) {?>class="current"<?php } ?>><span></span>News</a></li>
confuses wordpress and when I’m on the index page it thinks it’s viewing content from the news category so shows the class as current for both the home button and the news button.
It’s quite hard to explain, so I’m not sure if that helped, but take a look at navigation at https://www.wiredbristol.com/index.php and you’ll see what I mean (hopefully)
(basically I don’t want the news button to show as active if it’s the index page)
thanks again.
Forum: Fixing WordPress
In reply to: if is in ‘news’ category but is not indexthanks for the reply, it’s the news button that is causing the problem though, it’s showing as active on the homepage so I somehow need to tell it that if it’s the homepage don’t show the class=”current”
Forum: Plugins
In reply to: [Plugin User Photo] Small PHP issueBrilliant, thanks for your help… worked perfectly, now I have to try and figure out how to edit that so it does the same for comment avatars.
Forum: Plugins
In reply to: [Plugin User Photo] Small PHP issueStill needing some help here, anyone have any ideas? Thank you.
Forum: Fixing WordPress
In reply to: Whats wrong with this code?OK, I’ve had a look around and found that in_category doesn’t pick up sub-categories so you have to list them manually. For anyone else trying to do something similar here’s how you do it:
<?php if ( in_category(2) || in_category (2) || in_category (3) || in_category (4) ) { ?> Content <?php } else { ?> Content <?php } ?>
Forum: Fixing WordPress
In reply to: Whats wrong with this code?Is there anyway to modify this so its if in SUB category of x?
Forum: Fixing WordPress
In reply to: <?php the_category(‘,’ ); ?> without link?worked perfectly! thanks!