WordPress.org

Ready to get started?Download WordPress

Forums

Post Tags and Categories for Pages
Effecting my Events Calendar (3 posts)

  1. Fi Fi P
    Member
    Posted 7 months ago #

    Great plugin and all works smoothly for me except it is somehow changing the a tags on my Events Manager calendar. The code below is for a div on my homepage that shows some details for my 'Hire' page.
    If I change 'post_type'=>'page' to 'post_type'=>'post' then the calendar goes back to normal but my details from the Hire page don't show? Has anyone a solution for this?!

    <div id="block1"><div id="block1-title">HIRE US</div>
    <?php
    
    $args = array('post_type'=>'page', 'tag_id'=>32, 'posts_per_page'=>1);
    
    $myposts = get_posts( $args );
    foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
    <div class="postpic"><?php echo get_the_post_thumbnail($page->ID, 'homepage-thumb'); ?></div>
    <div class="postname"><strong><a>"><?php the_title(); ?></a></strong></div>
    <div class="postexcerpt"><?php
      $excerpt = get_the_excerpt();
      echo string_limit_words($excerpt,15);
    ?></div>
    <div class="more-linkhm"><a>"</a>More</div>
    <?php endforeach;
    wp_reset_postdata();?>
    </div>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum's parser.]

    http://wordpress.org/plugins/post-tags-and-categories-for-pages/

  2. Fi Fi P
    Member
    Posted 7 months ago #

    You can ignore the above problem, the issue was my permalink for the more tag:

    <div class="more-linkhm">"More</div>

    Do you know the permalink I need to make the word More a link to the featured post?

  3. curtismchale
    Member
    Plugin Author

    Posted 7 months ago #

    If you're using it inside a WP_Query loop then the_permalink would work fine. If you have access to the post_id then you'd use get_permalink( $post_id ) which calls the post permalink given the post_id.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.