Okay
  Public Ticket #1837461
Can't edit pages
Closed

Comments

  •  2
    ygoddrr started the conversation

    Hi, 

    I am new to Woffice theme.  I just installed one of the demos and tried to edit the page "News" by opening the page through frontend WPbakery Page builder.  However, I can't edit anything.  Do I need to insert the licence info for this page builder?  Or should I edit the page by using a different editor?

    Also how can I customize the fields in "+New Blog Article" (i.e., frontend feature for users to upload their posts) at the bottom of the News page?   I also want to bring that section up at the top once I can use the editor to edit the page. 

    Thank you!

  •  574
    François replied

    Hello, 

    That's because this very specific page is a "Template", which means when you create the page the content doesn't matter as it's overwritten on the PHP side. Like the Dashboard page, only the title matters, the content will get replaced automatically by the Dashboard sidebar on the theme level. See: https://developer.wordpress.org/themes/template-files-section/page-template-files/

    But it should work fine for "normal pages".

    The label can be changed by changing the string in the .po file (localization), see: https://alkaweb.atlassian.net/wiki/spaces/WOF/pages/2228238/Languages  

    You can also change the position by editing this template in your child theme: 

    /woffice-child/page-templates/blog.php 

    And make sure this block:

    $post_create = woffice_get_settings_option('post_create'); 
    if ($woffice_role_allowed): ?>
    ...
    

    Is before the loopsmile.png 

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  2
    ygoddrr replied

    Hello François,

    Thanks for your reply, but I am still confused with what I need to do with your response.

    I installed the child theme, but don't know how to change the child theme.  And I haven't coded PHP before, so I am not even sure where to change and edit the code.

    With that said, can I start creating a normal page and edit it using the editor?  I faced the following questions as I tried to do that.

    1. I noticed that "Frontend Creation" button from WPBakery Page Builder.  However, how can I edit the form (e.g., add and delete the elements inside)?

    2. How can I add that "+New Blog Article" button on a new normal page?

    I need to do a lot of customization to the theme similar to the ones above, and hopefully, there is an easy way to do it.  If not, do I need to learn how to code PHP programming language?

    I appreciate your prompt reply.  Thank you!

  •  574
    François replied

    Hello, 

    Yup, Woffice is highly customizable but you need WordPress PHP skills. They are templates, filters and actions so you can change everything and every behavior, almost. However, we can't do that through the support, we fix issues heresmile.png 

    However, we have some pretty good partnerships with Woffice experts: 

    - French based Woffice agency: https://www.intranet-extranet.wizengo.com/en/homepage/ they'll take care of everything, including training and you'll get someone on the phone, they do any kind of change. 

    - WPKraken: https://wpkraken.io/?ref=alkaweb cheaper but not support / change and mostly for small requests. 

    Please let me know if you need further details here.

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  2
    ygoddrr replied

    Hi Francois,

    Thanks for your reply, but I won't spend thousands of dollars for the outsourcing service.  

    Could you please let me know how I can do the following tasks that I mentioned in the previous message?

    1. I noticed that "Frontend Creation" button from WPBakery Page Builder.  However, how can I edit the form (e.g., add and delete the elements inside)?

    2. How can I add that "+New Blog Article" button on a new normal page?

    Even if it requires the change of the codes, please let me know how I can do that.

    Thank you.

  •  574
    François replied

    Hello,

    Sure, makes sense. 

    1. Can you send me a screenshot please, not if you're mentioning a WP Backery feature or Woffice's frontend button. For Woffice, it's all managed here: 

    woffice/inc/classes/Woffice_Frontend.php
    

    You can add and remove fields from that class but make sure to override it correctly so it's not erased when we push an update. There are also some helpful filters you might want to use to customize this easily.

    2. In your child theme, duplicate woffice/page-templates/blog.php, change the Template Name: Blog to Blog Creation and remove the page's content: 

    <?php // We check for the layout 
                    $blog_layout = woffice_get_settings_option('blog_layout');
                    $masonry_columns = woffice_get_settings_option('masonry_columns');
                    $masonry_columns_class = 'masonry-layout--'.$masonry_columns.'-columns';
                    echo ($blog_layout == "masonry" || isset($_GET['blog_masonry'])) ? '<div id="directory" class="masonry-layout '.$masonry_columns_class.'"-->' : ''; ?>
                    
                        <?php 
                        // THE LOOP :
                        $posts_per_page = woffice_get_settings_option('blog_number');
                        $pagination_slug = (is_front_page()) ? 'page' : 'paged';
                        $paged = (get_query_var($pagination_slug)) ? get_query_var($pagination_slug) : 1;
                        /**
                         * Filter args of the blog posts query
                         *
                         * @param array $args
                         * @param int $paged
                         * @param int $posts_per_page
                         */
                        $args = apply_filters('woffice_blog_query_args', array(
                            'post_type' =--> 'post',
                            'paged' => $paged,
                            'posts_per_page' => $posts_per_page
                        ), $paged, $posts_per_page);
                        $blog_query = new WP_Query($args);
                        if ( $blog_query->have_posts() ) :    ?>
                            <!--?php while ( $blog_query--->have_posts() ) : $blog_query->the_post(); ?>
                                <!--?php // We check for the role : 
                                if (woffice_is_user_allowed()) { ?>
                                    <!--?php if (($blog_layout == "masonry")) {
                                        get_template_part( 'content-masonry' );
                                    } 
                                    else {
                                        get_template_part( 'content' );
                                    } ?-->
                                <!--?php } ?-->
                            <!--?php endwhile; ?-->
                        <!--?php else : ?-->
                            <!--?php get_template_part( 'content', 'none' ); ?-->
                        <!--?php endif; ?-->
                        
                    <!--?php echo ($blog_layout === "masonry" || isset($_GET['blog_masonry'])) ? '</div-->' : ''; ?>
                    <!-- THE NAVIGATION --> 
                    <!--?php woffice_paging_nav($blog_query); ?-->
    

    So you just have the form outputsmile.png

    Please have a nice day. 

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  2
    ygoddrr replied

    Hi Francois,

    Thanks a lot for your reply.

    As you requested, I am adding the screenshots to show what I want.

    • First  I would like to bring the new blog article button to the top (see the first attached picture)
    • Second, I would like to customize the fields in the frontend blog form.  For example, currently the second attached picture shows that the form has Article Title, Article Category, Add Article Thumnail and Article Content.  How can I change these fields?

    Could you please let me know how I can do it step-by-step?  

    Appreciate your help a lot!

    Thanks,

    Jun

    Attached files:  New Blog Article Button.JPG
      Frontend Blog Form.JPG

  •  574
    François replied

    Hello Jun, 

    For the first one, if you use the blog page template, you need to override this file: 

    woffice/page-templates/blog.php
    

    In your child theme. Take this part: 

    <?php
                    /*
                     * FRONT END CREATION
                     */ 
                    // CHECK IF USER CAN CREATE BLOG POST
                    $post_create = woffice_get_settings_option('post_create'); 
                    if ($woffice_role_allowed): ?>
                        
                        <div class="frontend-wrapper box">
                            <div class="intern-padding">
                        
                                <div class="center" id="blog-bottom">
                                    <?php
                                    /**
                                     * Filter the text of the button "New Blog Article"
                                     *
                                     * @param string
                                     */
                                    $new_blog_button_text = apply_filters('woffice_new_blog_article_button_text', __("New Blog Article", "woffice")); ?>
                                    <?php echo'<a href="javascript:void(0)" class="btn btn-default" id="show-blog-create"--><i class="fa fa-plus-square"></i> '. $new_blog_button_text .''; ?>
                                    
                                </div>
                                
                                <?php Woffice_Frontend::frontend_render('post',$hasError); ?>
                                                            
                            </div>
                        </div>
                    
                    <?php endif; ?>
    

    And move it at the beginning of the file. Or right after:

    <!-- START CONTENT -->
    <div id="content">

    That'll do the job just finesmile.png 

    For the second one, it's all in:

    woffice/inc/classes/Woffice_Frontend.php

    You can edit the fields there, you will find filters and to change the fields but you will very likely need to override the whole class in your child theme. See: 
    https://stackoverflow.com/questions/36543877/overriding-classes-and-functions-in-child-theme

    I cannot guide you step by step as it's quite a heavy customization and you need a dev to handle that. We don't do offer customizations through the support. 

    Have a wonderful day.

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  2
    ygoddrr replied

    Thank you so much for the reply.

    For the first one regarding moving up the frontend button to the top, I followed your instruction and uploaded the attached revised blog.php file to my child theme.   I even updated the text in the button as follows:

    <?php
                                    /**
                                     * Filter the text of the button "New Blog Article"
                                     *
                                     * @param string
                                     */
                                    $new_blog_button_text = apply_filters('woffice_new_blog_article_button_text', __("Share your invesetment idea", "woffice")); ?>

    However, the blog page (https://shareinvestmentideas.com/investmentideas/) didn't change anything.

    Just to try the updates differently, I updated the parent theme Blog.php file directly.  Again, the blog page didn't change anything.

    I thought it might be due the cache not being cleared.  So, I cleared my cache on my chrome browser, and I cleared cache on my wordpress, but the page still stays the same.

    Do you know the reason by any chance why the website doesn't change even after I updated Blog.php file?

    Appreciate your help!

    Attached files:  blog.php

  •  2
    ygoddrr replied

    Hi Francois,

    Just wanted to add one more comment to my posting below.  Today, I made some changes to "Woffice_Frontend.php" file and uploaded to the child theme folder "/woffice-child-theme/inc/classes".   The changes have been reflected on the frontend form.

    Now the question is.. why do the changes made to blog.php (attached) not get reflected on the page while other php files seem to work?    As I mentioned in the message below, I tried to make the change to the parent theme blog.php file, and it didn't work either.

    Would you be able to simply upload the attached blog.php in your child folder and see if it is working on your side?

    'Appreciate your help!

    Attached files:  blog.php

  •  574
    François replied

    Hello, 

    Sorry for the delay on this ticket, looking good! Good jobsmile.png 

    The most common reason I see is that your blog page is not using the blog.php template. If it's the default WordPress page, it'll use index.php (which can also be overwritten). 

    Make sure than when you edit your blog page, you have the Page Template set to "Blog" and it's not assigned as the blog page in the WordPress Settings > Reading section, otherwise it'll use index.php. 

    You can also change:

    * Template Name: Blog

      To: 

    * Template Name: Blog 2

    In your template to make sure it's the child one.

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  2
    ygoddrr replied

    Hi Francois,

    Thanks a lot for your reply.  When I put the revised index.php file under Child theme, the page changed.  Thank you!

    I have one more follow-up question...  When I look at the blog page (see the attached screenshot), it currently shows the following items in masonry view: 1) blog title, 2) blog excerpts, 3) category, 4) # of comments, 5) blog date.

    I would like to add more info (e.g., author name, article rating).  Which PHP file and which section should I change?

    Also if you look at the blog details (see the second attached), the page has four sections (1) title, 2) blog info, 3) blog content, 4) user name + thumbs up).  What PHP file should I change for the 4) username and thumbs up?

    Thanks so much for your help!!

    Attached files:  Blog excerpt.JPG
      Blog details.JPG

  •  2
    ygoddrr replied

    Never mind.  I found the relevant php files for the questions below on my own. Thank you!

  •  574
    François replied

    Awesome! Good jobsmile.png 

    Have a nice weekend. 

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/