rjpinney
Forum Replies Created
-
Forum: Plugins
In reply to: [jQuery Colorbox] [Plugin: jQuery Colorbox] Blank BoxPeter – could you let me know what fixed your problem? I have it too!
Forum: Plugins
In reply to: [jQuery Colorbox] [Plugin: jQuery Colorbox] Text wrapping problemI’m still having this problem I’m afraid – does anyone have any input on what might be causing it?
Forum: Plugins
In reply to: [jQuery Colorbox] [Plugin: jQuery Colorbox] rel attribute to enable colorbox?I’ve since figured this out (CSS class ‘colorbox-123).
Forum: Themes and Templates
In reply to: If conditional statement – if category is a parent categoryThanks so much, it’s working!
Forum: Themes and Templates
In reply to: If conditional statement – if category is a parent category<?php $category = get_the_category(); if ($category->category_parent != '') { } ?>
If I put anything in the area you entered for code, it crashes the page.
I want to then list the child categories as links, if that makes any difference.
Thanks for all your help, appreciated!
Forum: Themes and Templates
In reply to: If conditional statement – if category is a parent categoryI’m afraid I’ve still got the same problem..
Forum: Themes and Templates
In reply to: If conditional statement – if category is a parent categoryThanks for your response, I’ve put that in but it crashes the page if I try and put code (or anything) into it – I may have implemented it wrong.
This is what I have:
<?php $category = get_the_category(); if ($category->category_parent !== '') { } ?>
Forum: Themes and Templates
In reply to: If post is in parent category, echo subcategory slug?(The outstanding question here is now different from the original, so I’ll mark this resolved and start a new thread for the new question).
Forum: Themes and Templates
In reply to: Query multiple custom post types in single loopVery well spotted, that was precisely the problem!
Thanks!
Forum: Themes and Templates
In reply to: If post is in parent category, echo subcategory slug?A further update:
This code is now outputting the child category slugs as I want it to:
<?php foreach((get_the_category()) as $childcat) { if (cat_is_ancestor_of(5, $childcat)) { echo $childcat->slug; }} ?>
The only thing I need to do is to separate the values returned with a space!
Any ideas?
Forum: Themes and Templates
In reply to: If post is in parent category, echo subcategory slug?An update on this:
I’m now closer to what I want to achieve – this code is outputting the category slug:
<?php $category = get_the_category(); echo $category[0]->slug; ?>
I now need to tweak it so that it only echos the category slug for child categories of parent category 5. I’ve tried using the ‘child_of=5’ parameter but can’t get it to work.
Forum: Themes and Templates
In reply to: Query multiple custom post types in single loopDoes anyone have any suggestions for this? I’m still stuck. Thanks!
Forum: Themes and Templates
In reply to: Query multiple custom post types in single loopThanks wspencer, I’ve tried changing at as you suggest but I’m afraid it just crashes the page – no doubt because I haven’t put it in quite right. This is what I now have, incorporating the code you provided above:
<?php query_posts( array( 'post_type' => array( 'post', 'report', 'opinion', bookmark' ), 'cat' => 3, 'showposts' => 5 ) ); ?> <?php while ( have_posts() ) : the_post(); ?> <div class="post_type"> <?php if ( 'post' == get_post_type() ) : ?>FEATURE<?php endif; ?> <?php if ( 'report' == get_post_type() ) : ?>REPORT<?php endif; ?> <?php if ( 'opinion' == get_post_type() ) : ?>OPINION<?php endif; ?> <?php if ( 'bookmark' == get_post_type() ) : ?>BOOKMARK<?php endif; ?> </div> <a href="<?php the_permalink(); ?> "><?php the_title(); ?></a> <div class="excerpt"> <?php echo get_the_excerpt(); ?> </div> <?php endwhile; ?>
Forum: Themes and Templates
In reply to: Get post meta WITH formatting?Solved!
Should anyone else run into this:
Instead of using:
<?php echo get_post_meta($post->ID, ‘YOURFIELDNAME’, true); ?>
Use this:
<?php the_field(‘YOURFIELDNAME’); ?>
That seems to carry over the formatting.
Forum: Plugins
In reply to: Basic PHP variable problem – custom fieldsScrap that last – this is the code I now have. It pulls the posts but the variable isn’t working. I planned to run this loop twice, once for events before ‘now’ and one for events after ‘now.’
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]