Support

Account

Forum Replies Created

  • Last Update: Now Works.

    I am uncertain as to why precisely or if I missed something important. However, for anyone reading this I installed the plugin “Classic Editor” and then redid the from group and now it works. I am not sure if it’s a requirement to have Classic Editor, maybe it is and I just haven’t read it in the guide or installation things etc. But it now works.

  • Third update:

    So I have no idea what is wrong or how to fix it. But it is now obvious that the actual problem is that the <?php $hero = get_field("hero");?> doesn’t actually get any values at all.

    I did this for simplicity:

    <?php $txt = "Hello world!";?>

    And then added it to the code html part as such:

    <h5><b><?php echo $txt ;?></b></h5>

    And it does come up as “Hello World” so it does work. Meaning the issue is that for some reason ACF groups doesn’t work or at least isn’t somehow connected meaning it doesn’t retrieve any values at all.

  • Second Update:

    After I did this code: <?php $hero = get_field("hero");?>

    I put in this code as seen on: https://www.advancedcustomfields.com/resources/get_field/
    To check if there are any values at all. Again I am new to this, ACF and PHP so I am hoping I did this part correctly.

    if( $hero ) 
    {
    echo $hero;
    } 
    else 
    {
    echo "empty";
    }
    ;?>

    By doing this, at the top of the page, below the header and above the section (see first post), it showed a gray bar with the word “Empty”. Meaning no values are being returned? So what am I doing wrong?

  • So update:

    There was a section that wasn’t working on the site and now it does. The errors that were listed above I fixed by changing:

    wp_register_script("jquery", get_template_directory_uri() . "/plugin-frameworks/jquery- 
     3.2.1.min.js", array(), 1, 1);
     wp_enqueue_script("jquery");
    

    To:

    
    wp_register_script("jQuery", get_template_directory_uri() . "/plugin-frameworks/jQuery-3.2.1.min.js", array(), 1, 1);
    wp_enqueue_script("jquery");
    

    Basically the same except the “jquery” needs to be “jQuery” with a capital Q. However the php part is still not showing anything. I can honestly say that I am not even sure the get_field(“hero”); is getting any results back at all. Not sure how to check it either.

  • Fair enough, but the header part works so I know PHP in itself works right?

    Nothing comes up or happens when I do the <?php print_r($hero); ?>, what is supposed to happen? I now also noticed when I inspect that it says an error to the far right (using Google Chrome):

    
    scripts.js?ver=1:46 Uncaught TypeError: $ is not a function
        at panelAccordian (scripts.js?ver=1:46)
        at scripts.js?ver=1:89
        at scripts.js?ver=1:138
    
    DevTools failed to load SourceMap: Could not load content for http://localhost/wpone/wp-content/themes/ThirdTheme/plugin-frameworks/maps/swiper.jquery.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
    DevTools failed to load SourceMap: Could not load content for http://localhost/wpone/wp-content/themes/ThirdTheme/plugin-frameworks/bootstrap.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
    DevTools failed to load SourceMap: Could not load content for http://localhost/wpone/wp-content/themes/ThirdTheme/plugin-frameworks/bootstrap.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
    
    

    Why did this happen? Is this related?

    This is my functions.php:

    
    <?php
    
        function load_stylesheets(){
            
            // Everything from the Luigis template
            wp_register_style("font", get_template_directory_uri() . "/fonts/beyond_the_mountains-webfont.css", array(), 1, "all");
            wp_enqueue_style("font");
            
            wp_register_style("bootstrap", get_template_directory_uri() . "/plugin-frameworks/bootstrap.min.css", array(), 1, "all");
            wp_enqueue_style("bootstrap");
    
            wp_register_style("swiper", get_template_directory_uri() . "/plugin-frameworks/swiper.css", array(), 1, "all");
            wp_enqueue_style("swiper");
            
            wp_register_style("ionicons", get_template_directory_uri() . "/fonts/ionicons.css", array(), 1, "all");
            wp_enqueue_style("ionicons");
    
            wp_register_style("styles", get_template_directory_uri() . "/common/styles.css", array(), 1, "all");
            wp_enqueue_style("styles");
    
            // This is a custom stylesheet of CSS that you can use to override anything of the above.
            wp_register_style("custom", get_template_directory_uri() . "/custom.css", array(), 1, "all");
            wp_enqueue_style("custom");
    
        }
    
        add_action("wp_enqueue_scripts", "load_stylesheets");
    
        function load_js() {
            
            wp_register_script("jquery", get_template_directory_uri() . "/plugin-frameworks/jquery-3.2.1.min.js", array(), 1, 1);
            wp_enqueue_script("jquery");
            
            wp_register_script("bootstrapjs", get_template_directory_uri() . "/plugin-frameworks/bootstrap.min.js", array(), 1, 1);
            wp_enqueue_script("bootstrapjs");
    
            wp_register_script("swiperjs", get_template_directory_uri() . "/plugin-frameworks/swiper.js", array(), 1, 1);
            wp_enqueue_script("swiperjs");
    
            wp_register_script("scriptsjs", get_template_directory_uri() . "/common/scripts.js", array(), 1, 1);
            wp_enqueue_script("scriptsjs");
    
            wp_register_script("customjs", get_template_directory_uri() . "/customjs.js", array(), 1, 1);
            wp_enqueue_script("customjs"); 
        }
    
        add_action("wp_enqueue_scripts", "load_js");
    

    Did I do something wrong here? I am very lost..

Viewing 5 posts - 1 through 5 (of 5 total)