Adding a Core file that was edited into child theme directory


  • Mitchell
    Newbie
     
    60 points

    I edited framework/class/class_layout.php to add a two lines of code
    <meta property=”fb:app_id” content=”MY APP KEY HERE” />
    so this don’t error
    Share App ID Missing in facebook debugger.
    I tried to add it to the child theme in the same directories framework/class and it’s not picking it up first. (not Working)

    Thanks
    Mitch


    Prag
    Prag
    Newbie
     
    36 points

    Core files in the child theme folder is not picking up for child theme. we have to use hooks and filter to make the alternatives to core theme output. (but original core theme have to have hooks to make update)

    But you just can use default wordpress action hook ‘wp_head’ for this.

    1) Go to your child theme folder.
    2) Open the file called functions.php
    3) Add the following code and save the file. (Modify the meta tags name and content as required before saving)


    function add_meta_tags() {
    echo '<meta property=”fb:app_id” content=”MY APP KEY HERE” />';
    }
    add_action('wp_head', 'add_meta_tags');

    Thanks,
    Prag.

    Theme customization and custom development.
    Contact:  customizationworks@gmail.com
    


    Mitchell
    Newbie
     
    60 points

    Thank You so much for that
    Mitch



    Mitchell
    Newbie
     
    60 points

    Not working got errors in debug
    Extraneous Property Objects of this type do not allow properties named '”fb:app_id”'.
    Share App ID Missing The 'fb:app_id' property should be explicitly provided, Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog.
    Parser Mismatched Metadata The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input properties that were not seen in the parsed result: '”fb:app_id”'


    Josh
    Josh
    Super Guru
     
    12,955 points

    Hello Mitchell,
    Have you tried adding the code under Theme Setup >General Setup >Custom css >Footer Styles



    Mitchell
    Newbie
     
    60 points

    It shows but in share debug in:
    Based on the raw tags, we constructed the following Open Graph properties
    and is showing blank for fb:app_id
    In the view source in browser it shows correctly

    In show all warrings in debug
    Warnings That Should Be Fixed

    Extraneous Property
    Objects of this type do not allow properties named '”fb:app_id”'.
    Share App ID Missing
    The 'fb:app_id' property should be explicitly provided, Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog.
    Parser Mismatched Metadata
    The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input properties that were not seen in the parsed result: '”fb:app_id”'

    I used https://developers.facebook.com/tools/debug/sharing/


    Josh
    Josh
    Super Guru
     
    12,955 points

    Am referring to this code <meta property="fb:app_id" content="MY APP KEY HERE" />

    Have you tried adding the code under Theme Setup >General Setup >Custom css >Header Styles



    Mitchell
    Newbie
     
    60 points

    O OK Sorry
    Did it showing twice now

    I put <meta property=”fb:app_id” content=”382668488486042″ />
    It shows twice
    this is in source
    <meta property=”fb:app_id” content=”382668488486042” /><meta property=”fb:app_id” content=”382668488486042″ />

    Error in debug:

    
    Extraneous Property
    Objects of this type do not allow properties named '”fb:app_id”'.
    Parser Mismatched Metadata
    The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input properties that were not seen in the parsed result: '”fb:app_id”'

    this is raw tags

    meta name="twitter:card" content="summary" />
    <meta name="twitter:description" content="Includes message board, technical notes, modification and parts information, and links." />
    <meta name="twitter:title" content="Drake List - Ham Radio Stop Amateur Radio Directory" />
    <meta name="twitter:site" content="@Hamradiostop" />
    <meta name="twitter:image" content="https://www.hamradiostop.com/wp-content/uploads/2017/01/cropped-HRS_Sq_Logo.png" />
    <meta name="twitter:creator" content="@Hamradiostop" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta property="”fb:app_id”" content="”382668488486042”" />
    <meta property="fb:app_id" content="382668488486042" />
    <meta property="og:url" content="https://www.hamradiostop.com/listings/drake-list/" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Drake List" />
    <meta property="og:description" content="Includes message board, technical notes, modification and parts information, and links." />
    <meta property="og:image" content="https://www.hamradiostop.com/wp-content/uploads/2017/01/wlt_screenshot_cache/170105/7f/7f6ec3d1e2e4b2d5c078799e945225d4.jpg" />
    <meta property="og:image:width" content="700" />
    <meta property="og:image:height" content="700" />
    <meta name="msapplication-TileImage" content="https://www.hamradiostop.com/wp-content/uploads/2017/01/cropped-HRS_Sq_Logo-270x270.png" />


    Josh
    Josh
    Super Guru
     
    12,955 points

    Remove the other codes you had added before.



    Mitchell
    Newbie
     
    60 points

    I did even cleared cache
    very strange
    I even check if I had the site connected to cloudflare and its not took it off when I switched themes



    Mitchell
    Newbie
     
    60 points

    Found it the doubling was from the original info I put into the _function.php in the child theme.
    After a lot of testing All three methods did not work keep getting the error.
    then I decided to test the original way directly in the main theme core file edit and it works that way so now I must remember to edit those files on upgrades unless of course @mark put it in the core files since we all need it anyway and put a setting in setting for our app ID for it.
    @Mark please put it in core.

    Mitch


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

You must be logged in to reply to this topic.