rebekahford
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Making specific custom post type items into taxonomy termsI have fixed this using the excellent advanced custom fields plugin which I was already using.
Forum: Fixing WordPress
In reply to: Making specific custom post type items into taxonomy termsSorry! That should read “obviously if I use a taxonomy term link query it will return an archive list of all the scripts related to that story and the story page itself rather than just a link to that original story item”
Forum: Themes and Templates
In reply to: adding is_category to single.phpI’ll try in_categiry though as this might work
Forum: Themes and Templates
In reply to: adding is_category to single.phpYes I’m well aware of the codex as I’ve been developing WordPress sites for many years. I just need to know if there’s a way around this
Forum: Fixing WordPress
In reply to: Two single.php templates (not category ones) in one theme?Hi Gabriel
I had to go with another option and filter the page using css to hide some content depending on whether it was an overlay or a flat window page in the end but would be interested to know how it’s done.
regards
Rebekah
Forum: Fixing WordPress
In reply to: Excluding category links in category.phpsorry wrong code example:
<li> Courses include: <?php //finds the categories relevant to the post foreach((get_the_category()) as $category) { if( $category->name=='University'|| $category->name=='University Level of Study'|| $category->name=='University Location'|| $category->name=='Vocational Location'|| $category->name=='Language Location' ) continue; $category_id = get_cat_ID( $category->cat_name ); $category_link = get_category_link( $category_id ); echo '<a href="'.$category_link.'">'.$category->cat_name.'</a>'; } ?> </li>
Forum: Fixing WordPress
In reply to: can't parse link in a custom fieldfixed it! i’m a moron and made a typo, so obvious!!!
Forum: Fixing WordPress
In reply to: Adding code to the category links andglad it helped. i always try and post a solution if i get one, i’m hoping it means people will help me as well ??
Forum: Fixing WordPress
In reply to: Two single.php templates (not category ones) in one theme?Hi
Thanks for that but that doesn’t really sort my issue out as I need to call the page in the overlay dynamically by calling get_permlink as all the thumbnails are generated randomly and on refreshing the page.So for instance I have something like this in the loop on the HP and in my category.php template
<?php query_posts(array('orderby' => 'rand', 'category_name' => 'All', 'showposts' => 4)); if (have_posts()) : while (have_posts()) : the_post(); ?> <li id="post-<?php the_ID() ?>" class="<?php veryplaintxt_post_class() ?> <?php foreach((get_the_category()) as $category) {echo $category->category_nicename. ' ' ;} ?>"> <a href="<?php the_permalink() ?>?height=450&width=820&modal=true" title="<?php printf(__('%s', 'veryplaintxt'), wp_specialchars(get_the_title(), 1)) ?>" class="thickbox"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { // the current post lacks a thumbnail echo 'This post ia missing a thumbnail!'; } ?> </a> </li> ...
this would call in the overlay version of whatever post it was.
I just wondered if I could have more than one single.php which could somehow be called dynamically using variations of get_permalink
Forum: Fixing WordPress
In reply to: Thickbox not pulling in content in Internet ExplorerIt turns out that IE won’t pull in any ajax requested content that contains scripting which is my problem
Forum: Fixing WordPress
In reply to: Thickbox not pulling in content in Internet ExplorerOn further investigation it seems that the page will show in iframe mode rather than modal but this is no good for me. any ideas why it would show in iframe and not modal view in IE?
Forum: Fixing WordPress
In reply to: controlling random posts on catgory templatesThat worked a treat! Thank you so much!! do you want a curly wurly as a thank you?
Forum: Fixing WordPress
In reply to: controlling random posts on catgory templatesthanks i’ll try that ??
Forum: Fixing WordPress
In reply to: Adding random comment excerpts to a random posts loopfixed it! it’s me i’m an idiot and have rearranged my code to this…
` <!– start comment array –>
<?php query_posts(array(‘orderby’ => ‘rand’, ‘category_name’ => ‘All’, ‘showposts’ => 3, ‘offset’=>4)); if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$comment_array = array_reverse(get_approved_comments($wp_query->post->ID));
$count = 1;
if ($comment_array) {
foreach($comment_array as $comment) {
if ($count++ <= 1) {
?>
<li id=”post-<?php the_ID() ?>” class=”text <?php veryplaintxt_post_class() ?>”>
<a href=”<?php the_permalink() ?>?KeepThis=true&height=450&width=820&modal=true” title=”<?php printf(__(‘%s’, ‘veryplaintxt’), wp_specialchars(get_the_title(), 1)) ?>” class=”thickbox”>
<?php comment_excerpt(); ?>
</a>
</li>
<?php } } } ?>
<?php endwhile; endif; ?>
<!– end comment array –>`Forum: Fixing WordPress
In reply to: Adding random comment excerpts to a random posts loopI have got this to work but have a little problem. I have the first post loop going ok with 4 random thumbnail posts. Then after this I have another loop with 3 posts but outputting an array of approved comments. However when it calls a post with no comment it’s displaying an empty box. I need to add a php conditional to say something like ‘if there is a comment display a comment,else display nothing but i wonder if there’s a more efficient way of structuring the following code to do this than wrapping it around the <?php $comment_array =… part of the following.
Any suggestions welcome and chocolate will be forthcoming ??
<!-- start comment array --> <?php query_posts(array('orderby' => 'rand', 'category_name' => 'All', 'showposts' => 3, 'offset'=>4)); if (have_posts()) : while (have_posts()) : the_post(); ?> <li id="post-<?php the_ID() ?>" class="text <?php veryplaintxt_post_class() ?>"> <a href="<?php the_permalink() ?>?KeepThis=true&height=450&width=820&modal=true" title="<?php printf(__('%s', 'veryplaintxt'), wp_specialchars(get_the_title(), 1)) ?>" class="thickbox"> <?php $comment_array = array_reverse(get_approved_comments($wp_query->post->ID)); $count = 1; if ($comment_array) { foreach($comment_array as $comment) { if ($count++ <= 1) { ?> <?php comment_excerpt(); ?> <?php } } } ?> </a> </li> <?php endwhile; endif; ?> <!-- end comment array -->