Home Forums Themes Support Frames Theme functions.php + Search Results

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13131
    Philfree23
    Supported

    Hello,

    I treid to post this to another open thread but I could not upload the answer.

    So here again, I hope you can help!

    Best regards,
    Philip

    Hi,

    sorry for my late reply!

    When I post the code to the functions.php in the theme folder I get a critical error and the page is not available anymore.

    I want to get rid of the 404 errors and I want to get rid of search results showing pages that I don’t have on my site

    eg:

    Ut wisi enim ad minim veniam

    philipfricker.de
    https://philipfricker.de › ut-wisi-e…
    ·

    I think it’s important people see themselves in film, but it’s even more important they see people they maybe don’t know as well. Fusce eget malesuada eros.

    or

    https://philipfricker.de/person/

    ( I don`t have a site called “person” on my WordPress)

    Functions.php:

    This is the functions.php I uploaded (could you please help me?)

    Thank you very much!

    <?php
    /**
    * @package HaruTheme
    * @version 1.0.0
    * @author Administrator <admin@harutheme.com>
    * @copyright Copyright (c) 2017, HaruTheme
    * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
    * @link http://harutheme.com
    */

    // Load the HARU theme framework, all functions for theme will in includes folder in framework folder
    require get_template_directory() . ‘/framework/haru-framework.php’;

    // Remove plugin flag from redux. Get rid of redirect
    if ( ! function_exists( ‘haru_remove_as_plugin_flag’ ) ) {
    function haru_remove_as_plugin_flag() {
    ReduxFramework::$_as_plugin = false;
    }
    add_action( ‘redux/construct’, ‘haru_remove_as_plugin_flag’ );
    }

    if ( ! function_exists( ‘haru_add_theme_support’ ) ) {
    function haru_add_theme_support() {
    add_theme_support( ‘html5’, [ ‘script’, ‘style’ ] );
    }

    add_action( ‘after_setup_theme’, ‘haru_add_theme_support’ );
    }

    add_action( ‘template_redirect’, ‘haru_redirect_video’ );

    function haru_redirect_video() {
    if ( is_singular( ‘haru_video’ ) ) :
    wp_redirect( home_url(), 301 );
    exit;
    endif;
    }

    // Disable revslider notice.
    if ( function_exists( ‘rev_slider_shortcode’ ) ) {
    add_action( ‘admin_init’, ‘haru_disable_revslider_notice’ );
    }

    function haru_disable_revslider_notice() {
    update_option( ‘revslider-valid-notice’, ‘false’ );
    }

    // Remove Contact Form 7 auto p
    add_filter( ‘wpcf7_autop_or_not’, ‘__return_false’ );

    // https://stackoverflow.com/questions/66611705/getting-notice-is-wordpress-wp-scriptslocalize-was-called-incorrectly
    add_filter( ‘doing_it_wrong_trigger_error’, ‘__return_false’, 10, 0 );

    if ( ! function_exists( ‘haru_redirect_404_to_homepage’ ) ) {

    add_action( ‘template_redirect’, ‘haru_redirect_404_to_homepage’ );

    function redirect_404_to_homepage(){
    if ( is_404() ):
    wp_safe_redirect( home_url(‘/’) );
    exit;
    endif;
    }

    #13153

    Hi,
    Thanks for contacting us and choosing our product!
    Please note when your topic included too much URL, it will automatic got blocked as SPAM.
    First of all it seems you purchased our theme a long time ago and your support time may expire.
    If it has expired you need to renew to continue to get support.
    To check your support time you can do it here: https://harutheme.com/envato-tools/purchase-verify.php

    If you want to customize functions.php you should do it via child theme by install frames-child.zip from the package
    As we see from the code above this may cause error:

    if ( ! function_exists( 'haru_redirect_404_to_homepage' ) ) {
    
        add_action( 'template_redirect', 'haru_redirect_404_to_homepage' );
    
        function redirect_404_to_homepage(){ // this line error need the same function name
           if ( is_404() ):
                wp_safe_redirect( home_url('/') );
                exit;
            endif;
        }

    You are missing function name you need to change from redirect_404_to_homepage to haru_redirect_404_to_homepage.
    About person slug it come from Archive page of person custom post type. So you list to listing all posttype that you don’t want to use.
    We’ll check and have a solution for you but please check your support time first.
    Hope this helps!

    ***
    Regards,
    HaruTheme

    • This reply was modified 1 month ago by admin.
    • This reply was modified 1 month ago by admin.
    #13172
    Philfree23
    Supported

    Hi,

    thanks for getting back to me.

    My support is still active.

    Concerning person slug:
    I have deleted all the posttytpes. Hope this will help to get rid of the wrong search results.

    Concerning 404 errors:

    Shall I switch to frames child theme? Will all the customization and work remain?

    I am not so familiar with php.
    Could you do that for me? I will pay for it separately.

    Thanks for your help!

    Best regards,
    Philip

    #13173

    Hi,
    Can you please list all things you want to do?
    Example: remove slug of post type,…
    We’ll check them for you.
    If the issue in the range of support we’ll do it for you free,
    Tf it’s customize we’ll estimate the time and price for it.

    ***
    Regards,
    HaruTheme

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

You must be logged in to reply to this topic.