Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter tiptap

    (@tiptap)

    Ok I managed to solve it.

    It seemed the place I was added the rewrite rule kept getting removed. so I moved it to the INIT hook and all seems fine.

    Also it seemed to be caching a lot of the pages so I cleared that also and is now fine.

    I noticed it the rewrite was getting removed by installing the ‘Monkeyman Rewrite Analyzer’ plugin which lists all of them.

    I get the go daddy holding page come up.

    Which normally means your domain hasn’t propagated / setup on their system yet

    I don’t know the response theme, but do you need to set the homepage up in settings?

    ie in the dashboard go to settings->reading and choose the static page you want your homepage to be

    Thread Starter tiptap

    (@tiptap)

    I think I’m almost there with this now.

    I’ve managed to get the post_id into the url of the custom post types post.

    ie mydomain.com/custom-post-type/post_id/post-name/

    add_filter('post_type_link', 'my_post_type_link', 1, 3);
    				function my_post_type_link( $post_link, $post = 0, $leavename = false ) {
    
    					if ( strpos('%post_id%', $post_link) === 'false' ) {
    						return $post_link;
    					}
    					if ( is_object($post) ) {
    						$post_id = $post->ID;
    					} else {
    						$post_id = $post;
    						$post = get_post($post_id);
    					}
    					if ( !is_object($post) || $post->post_type != 'features' ) {
    						return $post_link;
    					}
    
    					//put post ID in place of %post_id%
    					return str_replace('%post_id%', $post_id, $post_link);
    
    				}

    Then in the bit where I setup the post type, i add the following to the slug

    'slug' => '/feature/%post_id%',

    So all i need to do now I think is write a rewrite to remove the /feature part and it should work ‘hopefully’, but no luck with that yet

    Thread Starter tiptap

    (@tiptap)

    Ok I think I have solved it – if there is a better way let me know;

    When registering the post-type i set ‘has_archives’ => true

    then created the template archive-awards.php

    Now I get the correct template being called for ‘/awards/’

    Thread Starter tiptap

    (@tiptap)

    ah ok, yer that sounds good.

    however id want to manage all of them from domain a

    so id log into domain a’s wp-admin, update and add bits and bobs, which appears on all the sites

    Thread Starter tiptap

    (@tiptap)

    great ill give those a shot thanks!

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