Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter tina_tech

    (@tina_tech)

    I’ll try to explain it better:
    On the top of the page I want to show one post who is a post type “Diggsite” and has the taxonomy “Place”.

    Under the post type I wanr to show all posts (uses the standard “post” post type in WP) who has the taxonomy “Place”, except post who belong to the post type “Diggsites” (so that it doesn’t show a dublicate of the one on the top of the site).

    Additional info: There are about 50 different Diggsites, and everytime somebody posts a regular post (blog post) they link it to the Diggsite they belong to. So the page I’m working on is a page that first shows some info about the Diggsite (post type= Diggsite) and then shows all the blog post written that belongs to the Diggsite.
    The url looks something like this: domain.com/Place/this-is-a-diggsite

    Thread Starter tina_tech

    (@tina_tech)

    Additional info: The featured post also has a post meta field, ‘_pts_featured_post’

    Thread Starter tina_tech

    (@tina_tech)

    Thanks for your quick reply!

    I now have following: http://paste.thomasmyrman.com/516288261bc83 but I really have no idea how the args works (it doesn’t output anything)…

    the post type now has a featured class if that helps…

    Thread Starter tina_tech

    (@tina_tech)

    There is no post id, because as you can see it’s an archive page (which lists out different post who all have individual post ids)…

    Thread Starter tina_tech

    (@tina_tech)

    I tried switching to the standard permalink option, but what is the url of the post type then?

    I have now added 'rewrite' => array( 'slug' => 'lenke', 'with_front' => false ), but as you can see it’s still the same…

    Thread Starter tina_tech

    (@tina_tech)

    This is from functions.php:

    add_action( 'init', 'register_cpt_lenker' );
    
    function register_cpt_lenker() {
    
        $labels = array(
            'name' => _x( 'Lenker', 'lenker' ),
            'singular_name' => _x( 'Lenke', 'lenker' ),
            'add_new' => _x( 'Legg til ny', 'lenker' ),
            'add_new_item' => _x( 'Legg til ny lenke', 'lenker' ),
            'edit_item' => _x( 'Rediger lenke', 'lenker' ),
            'new_item' => _x( 'Ny lenke', 'lenker' ),
            'view_item' => _x( 'Se lenke', 'lenker' ),
            'search_items' => _x( 'Søk lenker', 'lenker' ),
            'not_found' => _x( 'Ingen lenker funnet', 'lenker' ),
            'not_found_in_trash' => _x( 'Ingen lenker funnet i papirkurven', 'lenker' ),
            'parent_item_colon' => _x( 'Parent Lenke:', 'lenker' ),
            'menu_name' => _x( 'Lenker', 'lenker' ),
        );
    
        $args = array(
            'labels' => $labels,
            'hierarchical' => false,
            'description' => 'Alle interne og eksterne lenker til ulike rapporter/publikasjoner/ressurser.',
            'supports' => array( 'title', 'excerpt' ),
            'taxonomies' => array( 'category', 'lenketyper' ),
            'public' => true,
            'show_ui' => true,
            'show_in_menu' => true,
            'menu_position' => 20,
    
            'show_in_nav_menus' => true,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'has_archive' => true,
            'query_var' => true,
            'can_export' => true,
            'rewrite' => array( 'slug' => 'lenke' ),
            'capability_type' => 'post'
        );
        register_post_type( 'lenker', $args );
    }

    I have tried different permalinkssetting, but the result is the same… I have tried all the suggestions in this thread but the result is the same.

Viewing 6 replies - 1 through 6 (of 6 total)