Ashraful Islam Joy
Ashraful Islam Joy

Reputation: 51

How to fix this fatal error of php Fatal error: Uncaught Error: Call to undefined function nm_blog_get_ajax_content()?

Image of the output in the browser

I am working on a project offline. I have a file called index.php. Now I want to launch in a browser sp that I can edit it.

But When I try to launch the index.php file by vs code editor the browser show this error. Fatal error: Uncaught Error: Call to undefined function nm_blog_get_ajax_content() in C:\Users\Joy\Downloads\Compressed\minimalist-theme\Theme Files\savoy\savoy\index.php:1 Stack trace: #0 {main} thrown in C:\Users\Joy\Downloads\Compressed\minimalist-theme\Theme Files\savoy\savoy\index.php on line 1

The index.php file is this:

<?php nm_blog_get_ajax_content(); // AJAX: Get blog content only, then exit ?>
<?php
  global $nm_theme_options;
  
  $show_categories = ( $nm_theme_options['blog_categories'] ) ? true : false;
  $categories_class = ( $show_categories ) ? '' : ' nm-blog-categories-disabled';

  $blog_page = nm_blog_get_static_content();
?>
<?php get_header(); ?>

<div class="nm-blog-wrap<?php echo esc_attr( $categories_class ); ?>">
  <?php if ( $blog_page ) : ?>
    <div class="nm-page-full">
      <div class="entry-content">
        <?php echo do_shortcode( $blog_page->post_content ); ?>
      </div>
    </div>
  <?php endif; ?>
  
  <?php if ( $show_categories ) : ?>
    <div class="nm-blog-categories">
      <div class="nm-row">
          <div class="col-xs-12">
            <?php echo nm_blog_category_menu(); ?>
          </div>
      </div>
    </div>
  <?php endif; ?>
  
  <?php get_template_part( 'template-parts/blog/content' ); ?>
</div>

<?php get_footer(); ?>

My aim is to launch in the local host of my browser that I couldn't do. Can anyone help me, please?

Upvotes: 1

Views: 1516

Answers (1)

video-reviews.net
video-reviews.net

Reputation: 2926

You need to include the file where the nm_blog_get_ajax_content() function is stored.

Something like this yet you will need to change the path to match your filename and path which contains this function

<?php require_once('/path/to/functions/file.php'); ?>

Upvotes: 1

Related Questions