• Resolved lydiarose

    (@lydiarose)


    Hi,

    I created events that could have parents pages by editing em-posts.php in the main plugin folder. However, when it updated, it wiped this all. I’ve tried adding the file to my child theme, but it still only looks for it within the main plugin folder, unlike the templates.

    Is there a way to make it permanent?

    Also, when it got wiped, all the pages starting redirecting, rather than 404ing. Now I can’t get them to stop redirecting to a 404 – how do I get rid of all the redirects? They seem hard coded?

    Thanks
    Lydia

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter lydiarose

    (@lydiarose)

    Hi,

    All the redirects are set i just resaved the permalink settings and it all worked. Just need to know how to make the parent pages permanent. I presume a snippet will work?

    This is the bit updated for your reference

    LINE 118

    $event_post_type_supports = apply_filters('em_cp_event_supports', array('page-attributes','custom-fields','title','editor','excerpt','comments','thumbnail','author'));
    	$event_post_type = apply_filters('em_cpt_event', array(
    		'public' => true,
    		'hierarchical' => true,
    Thread Starter lydiarose

    (@lydiarose)

    any further thoughts on this?

    Thread Starter lydiarose

    (@lydiarose)

    Hi,

    I managed to figure this out and add it as a snippet, so it shouldn’t be updated.
    I use code snippets plugin to add snippets but assume it can be added to theme function too.

    <?php
    function modify_event() {
        if ( post_type_exists( 'event' ) ) {
    
            /* Give event hierarchy (for house plans) */
            global $wp_post_types, $wp_rewrite;
            $wp_post_types['event']->hierarchical = true;
            $args = $wp_post_types['event'];
            $wp_rewrite->add_rewrite_tag("%event%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=event&name=");
            add_post_type_support('event','page-attributes');
        }
    }
    add_action( 'init', 'modify_event', 1 );

    Thanks
    Lydia

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

The topic ‘Parent Events’ is closed to new replies.