WordPress.org

Ready to get started?Download WordPress

Forums

Permalinks Videos Custom Posttype (1 post)

  1. vdweegen
    Member
    Posted 1 year ago #

    Hi Guys,

    I'm currently working on setting up a custom post-type for a video-gallery. (the previous developer started the coding, however never finished it) the gallery is currently operational and the videos are being opened in a PrettyPhoto lightbox. However i'm running into the following problem: The permalinks being created by the posttype are not working. The code is as follows:
    [code]

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $term      = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
    $videos_nr = of_get_option('videos');
    $query     = array(
        'post_type' => 'video',
        'posts_per_page' => $videos_nr,
        'paged' => $paged
    );
    $wp_query  = new WP_Query($query);
    echo '
    <div class="fixed">';
    echo '
      <div class="col-post-media">
        <div class="post-media">';
    while ($wp_query->have_posts()):
        $wp_query->the_post();
        global $post;
        $results = $wp_query->post_count;
        $items_count = 0;
        $items_count++;
    	 //echo "<pre><font style=\"background-color: #000000;\">";
    	 //print_r($post);
    	 //echo "</font></pre>";
        $video    = get_post_meta($post->ID, "video_link", true);
    
        $image_id = get_post_thumbnail_id();
        $cover    = wp_get_attachment_image_src($image_id, 'video-archive');
        echo '
          <div class="media-arc last-p">
            <div class="video-arc-cover bar-arc-video">
    		  ';
    		  if(strpos($post->post_name, '-') !== false)
    		  {
    				echo '<a href="' . home_url().'/video/'.$post->post_name . '">';
    		  }

    [/code]
    The url are correctly being processed and the correct urls are being parsed. However, if I open the links I get a 404. Could anybody point me in the right direction?

Topic Closed

This topic has been closed to new replies.

About this Topic