

Plugin settings screen
Sticky Copy Button for Code Blocks automatically adds a floating copy button to each <pre><code> block on your website.
It provides convenient front-end copying for developers, readers, and tutorial users.
This plugin is light, fast, and highly customizable:
No dependencies such as Prism or Highlight.js are required.
The following explains every option in the plugin settings page.
Adjust vertical position (top offset in px)
Moves the button up or down relative to the top of the code block.
Use positive or negative values to fine-tune vertical alignment.
Adjust horizontal position (right offset in px)
Moves the button left or right by adjusting how far it sits from the right edge of the code block.
Use positive or negative values to fine-tune horizontal alignment.
These values help fine-tune button alignment to avoid overlapping with theme elements.
Copy button label
The label shown normally (default: “Copy”).
Label after copying (2 seconds)
Once the text is copied, the button temporarily displays this label.
Default: “Copied”.
Button size (8–36 px)
Controls the font size of the button.
Padding is automatically adjusted based on this value.
Button text color
Hex color of button text.
Button background color
Hex background color.
When copying, the plugin automatically swaps the text and background colors for visual feedback.
However, if the background is transparent, only the text color is swapped.
Always transparent background
If enabled:
– The button background always becomes transparent.
– Only text + border remain visible
Enable
Must be checked for the value to apply.
Code block max height (px)
Sets a maximum height (minimum: 100px).
Content taller than this becomes scrollable.
This prevents long code blocks from stretching your page layout.
Display Line Numbers (Enable)
Shows simple line numbers next to each line. You can also fine-tune the position of the line numbers (offset adjustment is available).
Notes:
– Line height is unified for consistency.
– Theme-specific code styling is preserved.
– Line wrapping is forcibly disabled.
This is a built-in lightweight alternative to syntax-highlighter libraries.
You can add any custom CSS to adjust:
Optionally, you can enable “Add !important to CSS declarations automatically” to force your custom styles to take effect even when the theme’s CSS has higher specificity.
Usable Selectors (CSS) :
<pre> element).line-numbers The container holding the line numbers
Example:
.copy-code-btn {
font-family: "Comic Sans MS", cursive;
font-weight: 700;
border: none;
}
Note: Do not include any comments.
If you find this plugin useful and would like to support its development,
you can make a voluntary donation via PayPal.
Your support helps keep this plugin maintained and improved.
Thank you!
PayPal: https://www.paypal.me/Kasuga16