Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #1039160

    Hello,

    I can’t add code to my child theme and I can’t find the solution. The code (for Facebook Pixel and Adsense) I tried to insert, I found here in this forum, so it should be correct. But it shows an error message. What should I do? And how can I attach an image so you can see the message?

    Thanks in advance.
    Best wishes
    Lina

    #1039783

    Hey linaschneider,

    What code are you trying to add and where? Please try to be as specific as possible. If you need to post screenshots then you can upload to a service like Google Drive, Dropbox, Imgur, Snaggy etc and then link to them here.

    Best regards,
    Rikard

    #1040432

    Hey Rikard,

    thank you for your reply. I tried to add the code for the Facebook Pixel and Adsense (see private content).

    Best wishes,
    Lina

    #1040607

    Hi Lina,

    Thanks for that. I can’t see anything wrong with your functions though, what exactly is not working after adding them?

    Are you referring to the error message in the screenshot? If so, did you try to add your code using FTP instead? That is a WordPress error message, so it’s not theme related.

    Best regards,
    Rikard

    #1040608

    Hi again,

    I see that you are trying to add shortcode in the second function, is that deliberate or are you only looking to add the script? Should the scripts be added to the header or the footer of the page?

    Best regards,
    Rikard

    #1045085

    Hey,

    thanks for your reply. How do I add code using FTP (what is that anyway)?
    In the description of Adsense and Facebook, it says that the code should be added to the header. But when I tried to find the location of the header using this forum, several threads said to add it to the functions.php in the way I did. So what is the correct way to add the Facebook Pixel and Adsense Code?

    Best regards,
    Lina

    #1045088

    Hi Lina

    Just stumbled upon your thread here.

    How do I add code using FTP (what is that anyway)?

    FTP means File Transfer Protocol, see https://de.wikipedia.org/wiki/File_Transfer_Protocol for details.
    You can code (I would rather say edit a file) by uploading it via FTP into your theme or child theme folder within the themes folder. You can get your FTP credentials over your hoster PixelX (use SFTP if possible, that is more secure).

    Best,
    Michael

    #1045534

    Hi Lina,

    I’m not sure if you need any further help on the topic? Please let us know if you do. Thanks @michaelh for helping out :-)

    Best regards,
    Rikard

    #1046952

    Hey,

    thank you for your messages, but my original question remains the same: What is the right code for the Facebook Pixel and Adsense? I’m sorry if you already answered this but I still don’t understand.
    Where exactly can I find my FTP credentials over the hoster PixelX? I couldn’t locate them yet. What code am I supposed to upload via FTP? In the Child Theme editor, I don’t see any options to upload anything.

    Best,
    Lina

    #1048121

    Hi,

    1.) You can get the FB pixel code from the facebook events manager panel:

    // https://www.facebook.com/events_manager/

    Once you got the code, you can either add it in the functions.php or install this plugin:

    // https://wordpress.org/plugins/code-snippets/

    Code example: https://pastebin.com/1fTgCStq

    Make sure to update these lines because it contains your account’s pixel id:

    fbq('init', '1233443242343454');
    

    noscript:

    src="https://www.facebook.com/tr?id=1233443242343454&ev=PageView&noscript=1"
    

    2.) Where do you want to place your google ads? You can add it in a text block, code block, a widget or create a custom shortcode for it. Please post your adsense code in the private field.

    3.) You should contact your hosting provider for the FTP account.

    Best regards,
    Ismael

    #1049379

    Hi Ismael,

    thanks for your reply.
    Unfortunately, the same error code is shown again when I try to add the code from the pastebin (with my Pixel ID) to the functions.php. I don’t know what I’m missing. Why can’t I add anything to the functions.php? :/ So I had to install the plugin, which worked.

    I have a much bigger problem now though because I can’t edit my pages anymore! The page building doesn’t work like it used to and a lot in the WP backend looks different. The preview of the page is sometimes correct, but live it differs. One example is this page: https://www.linaschneider.ch/angebote/angebot-3-entfaltung/ In the preview it looks (almost) correct, but live there is nothing.
    I read in the forum that the theme needs to be up to date, but I can’t find out how to update the theme to 4.5.1 ( see the private content). Since this forum was closed for a long time, I need your help urgently!

    Thanks
    Lina

    • This reply was modified 5 years, 11 months ago by linaschneider.
    #1049763

    Hi,

    Did you remove the previous filter before adding the new one? Please post the WP and FTP details in the private field so that we can check the codes.

    Best regards,
    Ismael

    #1050081

    Hi Ismael,

    thanks for your reply but I don’t really understand. Which filter should I remove and where? Where do I find the WP and FTP details so you can check it? Could you please explain in detail, preferably with screenshots?

    I posted the link to the screen recording of the page in the private fields. As you can see there is content on the page and the preview shows it (almost) correctly. But live the page is empty: https://www.linaschneider.ch/angebote/angebot-3-entfaltung/

    Best wishes
    Lina

    #1050113

    Hi Lina

    I will try to help you partly as I can’t see the private content. Your question:

    Where do I find the WP and FTP details so you can check it?

    I don’t know what you mean by “WP details”, but as for FTP you can get your credentials over your hoster PixelX (use SFTP if possible, that is more secure), as I already stated in my post from December 14.

    Thanks and cheers
    Michael

    #1050449

    Hello Michael,

    thanks for your message. Since I couldn’t locate the FTP credentials, I contacted my hoster and am still waiting for their reply.
    It’s really frustrating that I can’t use my website properly since the WP update and the answers I receive here just raise more questions.

    Best wishes
    Lina

    #1050451

    Hi Lina

    Sorry to hear that you could not locate your FTP credentials within your hosters panel.
    How about switching to a Swiss hoster such as Cyon? They do a great job and it is really easy to find all the information you need.

    What kind of other questions do you have in mind?
    Please let me know if I can help you somehow.

    Liebe Gruess
    Michi

    #1050871

    Hi,

    The site is running on a very old version of the theme, version 3.8. You have to upgrade to version 4.5.2 and switch to the advance layout builder. The page is using the new block editor and that is why it’s blank.

    Best regards,
    Ismael

    #1051986

    Hi Ismael,

    I know it’s an outdated version that’s why I asked you how to update it on the 2nd of January. At the Enfold Child Options it says it’s the latest version…
    In the private content, you can find my login. I hope that’s what you need to access the page and find out what’s wrong.

    Best wishes
    Lina

    #1052305

    Hi,

    Sorry I missed that information. You can’t update from that version automatically because it’s still using the deprecated version of the update script, so you have to do it manually via FTP. Here’s how:

    // https://kriesi.at/documentation/enfold/install-enfold-theme/#reinstall-or-update-using-ftp

    A short read about updating:

    // https://kriesi.at/archives/the-complete-guide-to-updating-enfold

    Best regards,
    Ismael

    #1053853

    Hello Ismael,

    thanks. MichaelH could help me out and fixed the website! So you can close the ticket. :)

    Best regards
    Lina

    #1053896

    Hi,

    Great! Thanks to @MichaelH. Have a nice day.

    Best regards,
    Ismael

Viewing 21 posts - 1 through 21 (of 21 total)
  • You must be logged in to reply to this topic.