Support » Fixing WordPress » Permalinks Videos Custom Posttype

  • 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:

    $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()):
        global $post;
        $results = $wp_query->post_count;
        $items_count = 0;
    	 //echo "<pre><font style=\"background-color: #000000;\">";
    	 //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 . '">';

    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?

  • The topic ‘Permalinks Videos Custom Posttype’ is closed to new replies.