WordPress.org

Ready to get started?Download WordPress

Forums

Pagely MultiEdit
[Plugin: Page.ly MultiEdit] Make it run for Page & Custom template post (2 posts)

  1. Donquiweb
    Member
    Posted 2 years ago #

    Hi,

    you're 2 latest version doesn't allow to show the tabs on Page and default posts or custom template post (ex: A new section Projects in the blog).

    Change these lines :

    // if default template.. assign var to page.php
    $post->page_template == 'default' ? $post->page_template = 'page.php' : '';
    $templatefile = locate_template(array($post->page_template));

    and add this code :

    if ($post->page_template) {
    $post->page_template == 'default' ? $post->page_template = 'page.php' : '';
    $templatefile = locate_template(array($post->page_template));
    }
    else if (get_post_meta($post-$ID, 'custom_post_template', true)){
    $post->is_post_template == 'default' ? $post->is_post_template = 'single.php' : '';
    $templatefile = locate_template(get_post_meta( $post->ID, 'custom_post_template', true ));
    }

    Hope it will help someone,
    Laurent

    http://wordpress.org/extend/plugins/pagely-multiedit/

  2. aedanemu
    Member
    Posted 1 year ago #

    This would not work for me for single posts using the default single.php template.

    if ($post->page_template) {
            $post->page_template == 'default' ? $post->page_template = 'page.php' : '';
            $templatefile = locate_template(array($post->page_template));
        }
        else if (get_post_meta($post-$ID, 'custom_post_template', true)){
            $post->is_post_template == 'default' ? $post->is_post_template = 'single.php' : '';
            $templatefile = locate_template(get_post_meta( $post->ID, 'custom_post_template', true ));
        }
        else {
            $post->is_post_template == 'default' ? $post->is_post_template = 'single.php' : '';
            $templatefile = TEMPLATEPATH . "/single.php";
    
        }

    i.e. I just added another else statement without a conditional because anything that isn't a page or a post using a custom template is a post using the default single.php template.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic