Forum Replies Created

Viewing 15 replies - 1 through 15 (of 27 total)
  • Thread Starter rebekahford

    (@rebekahford)

    I have fixed this using the excellent advanced custom fields plugin which I was already using.

    Thread Starter rebekahford

    (@rebekahford)

    Sorry! 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”

    Thread Starter rebekahford

    (@rebekahford)

    I’ll try in_categiry though as this might work

    Thread Starter rebekahford

    (@rebekahford)

    Yes 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

    Thread Starter rebekahford

    (@rebekahford)

    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

    Thread Starter rebekahford

    (@rebekahford)

    sorry 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>
    Thread Starter rebekahford

    (@rebekahford)

    fixed it! i’m a moron and made a typo, so obvious!!!

    Thread Starter rebekahford

    (@rebekahford)

    glad it helped. i always try and post a solution if i get one, i’m hoping it means people will help me as well ??

    Thread Starter rebekahford

    (@rebekahford)

    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

    Thread Starter rebekahford

    (@rebekahford)

    It turns out that IE won’t pull in any ajax requested content that contains scripting which is my problem

    Thread Starter rebekahford

    (@rebekahford)

    On 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?

    Thread Starter rebekahford

    (@rebekahford)

    That worked a treat! Thank you so much!! do you want a curly wurly as a thank you?

    Thread Starter rebekahford

    (@rebekahford)

    thanks i’ll try that ??

    Thread Starter rebekahford

    (@rebekahford)

    fixed 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 –>`

    Thread Starter rebekahford

    (@rebekahford)

    I 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 -->
Viewing 15 replies - 1 through 15 (of 27 total)