Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter tanuki1986

    (@tanuki1986)

    Thank you for your reply @thomasplevy, I ended up reinstalling everything from scratch. The problem seem to be the permalink structure. It is now set to “Plain” and all the redirection is working just fine. However, when I switch to “post name” the redirection for “lost password” and after enrollment stop working.
    I think I will just leave it on “plain” as it’s working and that install of WordPress is in a subdirectory and just being used for lifterlms allowing me to use the theme understrap that was conflicting with lifterlms for the main site and using divi with lifterlms for the academy site in the subdirectory. I would have preferred to get lifterlms to work with understrap but couldn’t find how to solve the conflict. Thank you for the link I’ll check what’s on there. Take care.

    Thread Starter tanuki1986

    (@tanuki1986)

    @thomasplevy don’t know if the problem is related but when clicking on lost password, I’m getting a page not found as well. https://lavoixducorps.eu/academy/

    I did navigate to LifterLMS -> Settings -> Accounts
    lost password is set to lost-password.

    I did this as well https://lifterlms.com/docs/how-to-flush-wordpress-rewrite-rules-or-permalinks/

    Still the same problems.

    After enrollment to a course, I get redirected to a page not found and when clicking on lost password link as well.

    Thread Starter tanuki1986

    (@tanuki1986)

    @thomasplevy anything on this, please ?

    Thread Starter tanuki1986

    (@tanuki1986)

    Thank you @thomasplevy for your reply.
    As a matter of fact, yes I do have another question.
    I still have the problem that I posted here

    The website is hosted at this IP

    Someone on stackoverflow advised getting to know the dev tools to find where the issue is coming from.
    I followed a basic course on udemy but still don’t know how to proceed to find how to solve this.

    I can see on your github that someone was assigned to the case, so thank you and I hope to have a solution soon or some kind of direction to follow.

    Thread Starter tanuki1986

    (@tanuki1986)

    Thank you @saurabhshukla for taking the time to write such an extensive reply.
    I kept working on this since my post and what I end up doing is:

    – create child-theme/loop-templates/content-course.php and child-theme/loop-templates/content-lesson.php

    <?php
    /**
     * Partial template for content in single-course.php
     *
     * @package understrap
     */
    
    // Exit if accessed directly.
    defined( 'ABSPATH' ) || exit;
    ?>
    
    <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
    
    	<header class="entry-header">
    
    		<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    
    	</header><!-- .entry-header -->
        <div class="container">
            <div class="row">
                <div class="col-8 mx-auto pb-3">
                    <?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
                </div>
            </div>
        </div>
    	
    
    	<div class="entry-content">
    
    		<?php the_content(); ?>
    
    		<?php
    		wp_link_pages(
    			array(
    				'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
    				'after'  => '</div>',
    			)
    		);
    		?>
    
    	</div><!-- .entry-content -->
    
    	<footer class="entry-footer">
    
    		<?php edit_post_link( __( 'Edit', 'understrap' ), '<span class="edit-link">', '</span>' ); ?>
    
    	</footer><!-- .entry-footer -->
    
    </article><!-- #post-## -->

    – create a single-course.php and single-lesson.php with the code from the understrap sidebar right template.

    <?php
    /**
     * Template Name: Right Sidebar Layout
     *
     * This template can be used to override the default template and sidebar setup
     *
     * @package understrap
     */
    
    // Exit if accessed directly.
    defined( 'ABSPATH' ) || exit;
    
    get_header();
    $container = get_theme_mod( 'understrap_container_type' );
    ?>
    
    <div class="wrapper" id="page-wrapper">
    
    	<div class="<?php echo esc_attr( $container ); ?>" id="content">
    
    		<div class="row">
    
    			<div
    				class="<?php if ( is_active_sidebar( 'right-sidebar' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"
    				id="primary">
    
    				<main class="site-main" id="main" role="main">
    
    					<?php while ( have_posts() ) : the_post(); ?>
    
    						<?php get_template_part( 'loop-templates/content', 'course' ); ?>
    
    						<?php
    						// If comments are open or we have at least one comment, load up the comment template.
    						if ( comments_open() || get_comments_number() ) :
    							comments_template();
    						endif;
    						?>
    
    					<?php endwhile; // end of the loop. ?>
    
    				</main><!-- #main -->
    
    			</div><!-- #primary -->
    
    			<?php get_template_part( 'sidebar-templates/sidebar', 'right' ); ?>
    
    		</div><!-- .row -->
    
    	</div><!-- #content -->
    
    </div><!-- #page-wrapper -->
    
    <?php get_footer(); ?>

    then in the Guttenberg editor

    for each course

    <!– wp:llms/course-information /–>

    <!– wp:llms/pricing-table /–>

    <!– wp:llms/course-progress –>
    <div class=”wp-block-llms-course-progress”>[lifterlms_course_progress]</div>
    <!– /wp:llms/course-progress –>

    <!– wp:llms/course-continue-button –>
    <div class=”wp-block-llms-course-continue-button” style=”text-align:center”>[lifterlms_course_continue_button]</div>
    <!– /wp:llms/course-continue-button –>

    <!– wp:llms/course-syllabus /–>

    for each lesson

    <!– wp:llms/lesson-progression /–>

    <!– wp:llms/lesson-navigation /–>

    It seems to work, the courses and lessons are showing with the sidebar.

    There is only something a bit weird about the button “mark as complete” displaying below the lesson video.

    When I’m logged in, the button is showing whether I’m seeing the page as myself, a visitor or a student, however, when I logout and view the lesson page the button isn’t displaying but there’s a message “No HTML was returned.“

    I will take the time to dig into your reply as it seems that the solution you describe is different from what I have done.

    Do you think that the way I found is a viable option?

    Thread Starter tanuki1986

    (@tanuki1986)

    There is 2 conversion methods that are operational if I understood your question correctly.
    Those are cwebp and Gd extension.

    Thread Starter tanuki1986

    (@tanuki1986)

    I commented out those lines and sudo systemctl restart nginx.
    Then Convert test image (show debug)
    again 404 not found ??

    Thread Starter tanuki1986

    (@tanuki1986)

    Thank you @nuevaya for trying to help me.
    sorry, I don’t understand what I should show you.
    When I click the convert test image (show debug)
    I just get a 404 not found nothing else.

    Thread Starter tanuki1986

    (@tanuki1986)

    @nuevaya was it what you asked when you asked to show the log?
    Any other ideas on how to get this to work, please?

    Thread Starter tanuki1986

    (@tanuki1986)

    @nuevaya If what you are asking is cat /var/log/nginx/error.log

    2019/07/11 10:50:11 [emerg] 31497#31497: “listen” directive is not allowed here in /etc/nginx/sites-enabled/mysite.be:77

    Thread Starter tanuki1986

    (@tanuki1986)

    Thank you @nuevaya for your reply, I’m not sure I’ve done it correctly as there is two

    server{ in my file so here’s how look my file after adding your code

    `server {
    root /var/www/mysite.be;
    index index.php index.html index.htm index.nginx-debian.html;
    server_name mysite.be https://www.mysite.be;

    location / {
    # try_files $uri $uri/ =404;
    try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
    deny all;
    }

    location = /favicon.ico { log_not_found off; access_log off;
    }

    location = /robots.txt { log_not_found off; access_log off; allow all; }
    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
    expires max;
    log_not_found off;
    }

    location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
    add_header Vary Accept;
    expires max;
    if ($http_accept !~* “webp”){
    break;
    }
    try_files $uri.webp /wp-content/plugins/webp-express/wod/webp-on-demand$
    }

    location ~* ^/?wp-content/.*\.(png|jpe?g)\.webp$ {
    expires max;
    try_files $uri /wp-content/plugins/webp-express/wod/webp-realizer.php?w$
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mysite.be/fullchain.pem; # managed$
    ssl_certificate_key /etc/letsencrypt/live/mysite.be/privkey.pem; # manag$
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    }

    server {
    if ($host = https://www.mysite.be) {
    return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = mysite.be) {
    return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    server_name bobeauspa.be https://www.mysite.be;
    return 404; # managed by Certbot

    }

    I then did

    sudo systemctl restart nginx

    in wp dashboard settings>webp express> save settings > convert test image (show debug) and unfortunately got 404 not found again

    Thread Starter tanuki1986

    (@tanuki1986)

    Found the solution in a last desperate attempt..

    .wpmenucartli {
    @extend .my-auto;
    }

    Thread Starter tanuki1986

    (@tanuki1986)

    Thank you for your reply,

    I tried as well but I always got an empty array as output

    function albums_endpoint( $request_data ) {

    // setup query argument
    $args = array(
    ‘post_type’ => ‘albums’,
    ‘posts_per_page’=>-1,
    ‘numberposts’=>-1
    );

    // get posts
    $posts = get_posts($args);

    // add custom field data to posts array
    foreach ($posts as $key => $post) {
    $posts[$key]->acf = get_fields($post->ID);
    $posts[$key]->link = get_permalink($post->ID);
    $posts[$key]->image = get_the_post_thumbnail_url($post->ID);
    $posts[$key]->gallery = acf_photo_gallery(‘GalleryPlugin’, $post->ID);

    }
    return $posts;
    }

    // register the endpoint
    add_action( ‘rest_api_init’, function () {
    register_rest_route( ‘albums/v1’, ‘/albums/’, array(
    ‘methods’ => ‘GET’,
    ‘callback’ => ‘albums_endpoint’,
    )
    );
    });

    {
    “ID”: 33,
    “post_author”: “1”,
    “post_date”: “2019-01-05 18:45:06”,
    “post_date_gmt”: “2019-01-05 18:45:06”,
    “post_content”: “”,
    “post_title”: “The first test album”,
    “post_excerpt”: “”,
    “post_status”: “publish”,
    “comment_status”: “closed”,
    “ping_status”: “closed”,
    “post_password”: “”,
    “post_name”: “the-first-test-album”,
    “to_ping”: “”,
    “pinged”: “”,
    “post_modified”: “2019-01-10 10:48:14”,
    “post_modified_gmt”: “2019-01-10 10:48:14”,
    “post_content_filtered”: “”,
    “post_parent”: 0,
    “guid”: “https://gyuto.local/?post_type=albums&p=33&#8221;,
    “menu_order”: 0,
    “post_type”: “albums”,
    “post_mime_type”: “”,
    “comment_count”: “0”,
    “filter”: “raw”,
    “acf”: false,
    “link”: “https://gyuto.local/albums/the-first-test-album/&#8221;,
    “image”: “https://gyuto.local/wp-content/uploads/2019/01/lightscape-775397-unsplash.jpg&#8221;,
    “gallery”: []
    }

    Same problem here,

    function albums_endpoint( $request_data ) {

    // setup query argument
    $args = array(
    ‘post_type’ => ‘albums’,
    ‘posts_per_page’=>-1,
    ‘numberposts’=>-1
    );

    // get posts
    $posts = get_posts($args);

    // add custom field data to posts array
    foreach ($posts as $key => $post) {
    $posts[$key]->acf = get_fields($post->ID);
    $posts[$key]->link = get_permalink($post->ID);
    $posts[$key]->image = get_the_post_thumbnail_url($post->ID);
    $posts[$key]->gallery = acf_photo_gallery(‘ACF_FIELD_NAME’, $post->ID);
    }
    return $posts;
    }

    // register the endpoint
    add_action( ‘rest_api_init’, function () {
    register_rest_route( ‘albums/v1’, ‘/albums/’, array(
    ‘methods’ => ‘GET’,
    ‘callback’ => ‘albums_endpoint’,
    )
    );
    });

    API return ==

    [
    {
    “ID”: 33,
    “post_author”: “1”,
    “post_date”: “2019-01-05 18:45:06”,
    “post_date_gmt”: “2019-01-05 18:45:06”,
    “post_content”: “”,
    “post_title”: “The first test album”,
    “post_excerpt”: “”,
    “post_status”: “publish”,
    “comment_status”: “closed”,
    “ping_status”: “closed”,
    “post_password”: “”,
    “post_name”: “brouillon-auto”,
    “to_ping”: “”,
    “pinged”: “”,
    “post_modified”: “2019-01-05 20:39:26”,
    “post_modified_gmt”: “2019-01-05 20:39:26”,
    “post_content_filtered”: “”,
    “post_parent”: 0,
    “guid”: “https://gyuto.local/?post_type=albums&p=33&#8221;,
    “menu_order”: 0,
    “post_type”: “albums”,
    “post_mime_type”: “”,
    “comment_count”: “0”,
    “filter”: “raw”,
    “acf”: {
    “album_title”: “The first test album”
    },
    “link”: “https://gyuto.local/albums/brouillon-auto/&#8221;,
    “image”: false,
    “gallery”: []
    }
    ]

    Can someone help siknoidas (@siknoidas) and I ??

    Thanks

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