Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy button does not work #315

Open
JlaDuoBao opened this issue Apr 12, 2024 · 10 comments
Open

Copy button does not work #315

JlaDuoBao opened this issue Apr 12, 2024 · 10 comments

Comments

@JlaDuoBao
Copy link

I have set up a copy button, which displays normally on the editing interface, but the copy button is not displayed on the publishing interface. Is this related to my topic? Or am I missing any plugins?
image
image

@JlaDuoBao
Copy link
Author

Okay, I have identified the issue, which is due to the theme

@KevinBatdorf
Copy link
Owner

Hey thanks for reporting (even if it's the theme). Could you provide details on the fix? Maybe I could account for it in the plugin, or if you still need help fixing it let me know

@JlaDuoBao
Copy link
Author

Hey thanks for reporting (even if it's the theme). Could you provide details on the fix? Maybe I could account for it in the plugin, or if you still need help fixing it let me know

No, I only know that this is related to the theme. I resolved this issue after changing the theme. But since I haven't studied any relevant programming languages, I don't know the cause of the problem, and I'm sorry.

@KevinBatdorf
Copy link
Owner

Ah ok. What's the theme name? I can take a look.

Or if you want to enable the other theme just send me a url to your site and I'll check it.

Or if you're happy with the new theme that's fine too.

@JlaDuoBao
Copy link
Author

Ah ok. What's the theme name? I can take a look.

Or if you want to enable the other theme just send me a url to your site and I'll check it.

Or if you're happy with the new theme that's fine too.

This is the theme of not working properly : https://github.com/kannafay/iEmo

@TCBW-KOD
Copy link

I experienced the same issue and resolved it by changing the theme. Here is the link to the non-functioning theme: https://github.com/justid/InlineAMP.

@TCBW-KOD
Copy link

I managed to display the code correctly by removing remove_all_actions('wp_head') and add_filter('use_block_editor_for_post', '__return_false', 10) in the original theme's functions.php. However, the copy button isn't functioning properly. Strangely, everything works as expected in Gutenberg's preview and editor interfaces, but not in the visitor interface.

@TCBW-KOD
Copy link

I discovered the issue: the theme uses wp_footer() exclusively under conditions such as being in customize preview or when a user is logged in, as shown below:

<?php 
    if (is_customize_preview() || is_user_logged_in()) {
        wp_footer(); 
    }
?>

I removed this conditional restriction, and now everything functions as expected.

@TCBW-KOD
Copy link

By the way, great plugin—I really love the theme options!

@KevinBatdorf
Copy link
Owner

Hey thanks for checking back in. If you want to remove wp_footer() you could load the JS script manually, but you probably want that loaded anyway as it's loading some important stuff there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants