• Resolved geekloverlz

    (@geekloverlz)


    Hi,
    I know that the plugin creates its pages dynamically. However, I really need to find a way to change the way their template displays. I actually have two main layouts on my website: one for the home page only, another for the other pages. Most of the time, WriteShare chooses to use the frontpage template. Other than that, I’d love to get rid of the sidebar and display a full-width page.
    To sum it all up:
    /content (or in my case, fanfic) is almost fine: it uses a “not frontpage” layout, but still shows the sidebar.
    /write uses a frontpage layout AND shows the sidebar.
    So, please, how can I fix this problem?
    My website is under construction, but here are some links for you to see what I’m talking about:
    https://quai.934.be/write/
    https://quai.934.be/fanfic/

    https://www.ads-software.com/plugins/writeshare/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter geekloverlz

    (@geekloverlz)

    Hi! Me again.
    I’d just like to say that I had a similar issue with buddypress that was really easy to solve:
    * buddypress created pages using the “not frontpage” layout with the sidebar
    * buddypress has a template hierarchy in which buddypress.php is used before page.php
    * all I had to do was paste the code from page-fullwidth_template.php into a file named buddypress.php and upload it into my theme’s folder

    My question, again, is: how can I get WriteShare to use the “not frontpage” + full width layout? Does WriteShare have a template hierarchy, too?

    Thread Starter geekloverlz

    (@geekloverlz)

    Hi! I’m still trying to find a solution and I think I’m coming onto something (remember I’m just a beginner and hopefully I’ll be able to help somebody by posting my progress).
    * I was able to force WriteShare to use a full width template (no sidebar!) for the /write page. Remember that buddypress.php template file I mentioned in the previous post? Well, I changed line 95 of the templates.php file in the WriteShare directory as follows from this:
    return locate_template( array( 'page.php' ) );
    to this:
    return locate_template( array( 'buddypress.php' ) );
    * I still can’t make it use the “not frontpage” layout, though. Any thoughts on that?

    Thread Starter geekloverlz

    (@geekloverlz)

    Last message for today – I’m going crazy here!
    I’m almost sure my problem has to do with body classes and the fact that the write page is a front-end post page or something like that, but I’m just a beginner and I don’t even know what I am supposed to change.
    I’m afraid that after all this work I’ll have to uninstall WriteShare because I can’t figure out how to make it use the “not_frontpage” template. ??
    Please, developers, I’ve already discovered how to display the full-width template. Can you help me with the rest?

    Plugin Author AOS

    (@fandoment)

    Hi, yes, we have several support issues in queue, so please be patient. We will get to it, but it will take some time.

    Thank you.

    Thread Starter geekloverlz

    (@geekloverlz)

    Oh, don’t worry, I kept posting mostly because it might help someone in the meantime.
    Take your time and thank you for the plugin!

    The same principle is used in WriteShare as in BuddyPress.

    Create a /writeshare-templates/ directory in your theme, this will allow you to override any of the WriteShare templates (use the ones from /templates/ as a basis).

    Use the new wpws_default_page_template filter to pass a different base template (instead of array( ‘page.php’ ) you can pass array( ‘page-wpws-template.php’ ) for example.

    Hope this helps.

    Plugin Author AOS

    (@fandoment)

    Marking as resolved.

    Thread Starter geekloverlz

    (@geekloverlz)

    Sorry to bother you again, but unfortunately I couldn’t do it (and it’s completely my fault, I’m sure).
    First of all, thank you Gennady for your help! Here’s what I did:
    * I created the /writeshare-templates/ directory in my theme
    * I created a page-wpws-template.php (based on my theme’s Full Width Template) and placed it in this /writeshare-templates/ directory
    * I changed array( ‘page.php’ ) into array( ‘page-wpws-template.php’ ) in the templates.php file in the WriteShare directory
    Problem is I’m really new at this and I don’t know where to use that new wpws_default_page_template filter you suggested. Can you help me? Am I doing something else wrong? Thank you for your patience.

    writeshare-templates are pulled in automatically if they are detected in /writeshare-templates/

    The wpws_default_page_template filter is used to change the default base template for pages, for example if you want to use ‘my-custom-page-base.php’ in your theme you add the following into your functions.php

    add_filter( ‘wpws_default_page_template’, function( $template ) {
    return array( ‘my-custom-page-base.php’ );
    } );

    this will force writeshare to use that template for all its pages instead of the default page.php template file, you do not have to put this file into /writeshare-templates/ can be in the root of the theme.

    You can request support via e-mail for a more hand-on approach by our team.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Modifying the template of a page created dynamically’ is closed to new replies.