• Resolved PC1271

    (@pc1271)


    On the blog post admin panel, there’s no way to change the template for the blog post. At least, I don’t see it.
    I would like to show most blog posts full width or without sidebar. For some others, it would be nice to have a left or right sidebar. The standard post template or a custom made template with different sidebar.

    I know how to create a custom templates, but if there’s no way to assign them to the blog post, there’s not much sense in creating a custom template.

    So, my question is: how can I assign a template for individual blog posts?

    https://www.ads-software.com/plugins/wp-blog-and-widgets/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    Once you install the plugin, You can see the “Blog” tab in the left menu side.

    To create a blog page kindly go to page section and create a page with any name say: Blog and add the shortcode.

    Page template is given by your theme. Kindly check when you are adding the shortcode in a page, check your theme templete in the right side after the update button.

    Thread Starter PC1271

    (@pc1271)

    Hi,

    Maybe my question wasn’t clear to you. Let me try to elaborate.

    From your answer, I understand that you are solely talking about the blog page where the shortcode is added. That is in fact a regular page and it is indeed possible to change the template to be full width, right or left sidebar or even a custom template, which I have implemented. It’s not this page I’m having a problem with. The blog page is using my custom page template.

    I’m having a problem with the template which is used for a single post (after clicking the ‘Read More’ button on the blog page.
    It should be possible to assign a post template for a new blog post (via Add Blog from your plugin menu). Only if that is possible I can create a consistent page layout for both the blog page and the pages where a single blog post is shown.

    Regards,
    Patrick

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    This blog plugin use your theme single.php file to display the single post, Same layout use by WordPress Post section to display the single article.

    Can you please send us your website link so that we can understand your issue in little bit more details.

    Thread Starter PC1271

    (@pc1271)

    Hi,

    This is a direct link to the blog page on my website: https://www.persawa.be/euro-2016-frankrijk/euro-2016-blogpagina/

    You will notice that this page sits within a section of the website, dedicated to the coming Euro 2016 football event. It was my intention to show all pages related to this section in a similar layout with their own sidebar.
    However, as you stated in your answer above, the single blog post is using the standard single post template that comes with the theme I’m using (a child theme from Dazzling).
    I would like to overrule that template for the blog posts related to Euro 2016. The Euro 2016 which should not appear in the standard blog page, should be easily recognizable as being part of the Euro 2016 section.

    At this time the Euro 2016 section is almost ready, but not yet publicly announced. That’s why the links to this section are still somewhat hidden.
    You will notice that the pages not related to Euro 2016 use the standard template that came with my theme.
    This is a link to the ‘standard’ blog page: https://www.persawa.be/persawa-blog/

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    You mean to say that you want to overwrite the single.php (Displaying single blog post) for “Euro 2016 Blogpagina”.

    I am little bit confused ??

    Thread Starter PC1271

    (@pc1271)

    Hi,

    I hope you checked the links I sent you?
    In the EK 2016 blog page (which uses a custom page template for all Euro 2016 pages), you should have seen 3 blog posts.
    When you click on the link ‘Lees Verder’ for one of the 3 posts, the post is opened in the standard single post template, loosing all context with the special Euro 2016 section of the website.

    Once the single blog post opens, the user no longer sees the Euro 2016 navigation menus. This complicates navigation for the common user. Try to look at this through the eyes of a user who is only interested in the Euro 2016 section of the website. When they click on a blog post in that section they want to stay in that section. Perhaps after reading a full post, they want to read another post, but the navigation to the main Euro 2016 blag page is no longer visible. They would have to click on the back arrow in their browser, which is a bit an inconvenient and not user friendly way of navigating.

    To answer your question, I don’t want to overwrite the standard single post template; I simple want the blog posts (from the category Euro 2016) to use their own custom post template.

    In a standard post (via New Post), it is possible to choose the single post template: full width, left or right sidebar, no sidebar.
    When I create a blog post (via Add Blog from your plugin menu), I don’t see the option to choose a template. Just compare to the standard Add Post admin panel with the admin panel used by your plugin to create a new blog post.

    Maybe if I could send you a screen capture of the admin panels, it would be clearer for you? How can I send you a screen capture?

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    Ok i got an idea now. You want blog single post in the same design and layout as its shown in EK 2016 So that user can user can navigate on the EK 2016 navigation menu(Green background color) just above the blog post.

    For example of user click on any blog post, Blog single post should open in the same layout just below the EK 2016 navigation menu(Green background color) . Kindly meke me correct me if i am wrong.

    awesome screenshot is the browser extension. With the help of this extension you can send us screenshot.

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Can you please send us code of custom page template for Euro 2016 page

    Thread Starter PC1271

    (@pc1271)

    Yes, this time you’ve got the idea! ??

    Here’s the page template code.

    Filename: page-euro-2016.php

    <?php
    /**
     * Template name: Euro 2016
     *
     * This is the template that displays all pages for the section Euro 2016.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package dazzling
     */
    
    get_header(); ?>
        <div class="euro-banner">
            <img src="https://www.persawa.be/wp-content/uploads/2016/03/UEFA_Euro_2016_logo.png" alt="UEFA Euro 2016 logo" />
        </div>
        <body <?php body_class( $class ); ?>> 
    
    	<div id="euro-primary" class="content-area col-sm-12 col-md-9 pull-right">
    		<main id="euro-main" class="site-main" role="main">
    		    <div id="euro-nav">
                    <?php wp_nav_menu( array('menu' => 'euro-2016' )); ?>
                </div>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php get_template_part( 'content', 'page' ); ?>
    
    				<?php
    					// If comments are open or we have at least one comment, load up the comment template
    					if ( comments_open() || '0' != get_comments_number() ) :
    						comments_template();
    					endif;
    				?>
    
    			<?php endwhile; // end of the loop. ?>
    
    		</main><!-- #main -->
    	</div><!-- #primary -->
    
    <?php get_sidebar('euro-2016'); ?>
    <?php get_footer(); ?>

    Is it ok when I send a screenshot by regular e-mail, to the info@… address on your website?
    I cannot send attachments here.

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Ok

    Create a copy of this file and rename that file with the name
    single-blog_post.php

    Also remove the template name from top and check.

    Thread Starter PC1271

    (@pc1271)

    It’s working!

    Thanks for your help.

    Note however, that this is a ‘one time’ solution, meaning, it will only work for the Euro 2016 section.
    What if I want to create a new section, say World Championship 2018 (Russia). This will require a different single post template with it’s own dedicated navigation menu.
    With the solution as implemented at this time, I cannot let the blog posts for that new section use another template then the one it’s using now for the Euro 2016 section.

    To make that possible, I guess you’ll have to extend the admin panel for the blog posts to include a template switching mechanism, similar to the one that can be used for regular posts. At this time, although the custom post template has a name, that name isn’t used anywhere. It would be useless to create another copy with a different name, since there’s no way to link to blog posts to the Euro 2016 template or the WC 2018 template.

    Luckily we have almost 2 years to find a solution for this! ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Template of blog post cannot be changed’ is closed to new replies.