LogoLogo
Back to PageFly.ioVideo Tutorials
English 🇺🇸
English 🇺🇸
  • PageFly Help Center
  • Getting Started
    • Overview
    • Quick start
      • How to Install PageFly
      • How To Use PageFly | Get started in 5 mins
      • How to Create a New Page from PageFly Templates
      • How can I access the PageFly LiveChat?
      • How PageFly work with your Shopify theme?
    • Pricing and billing
      • PageFly pricing plan
      • How PageFly billing work?
      • What happens if I uninstall PageFly?
      • PageFly refund policy
  • Pages & Sections Creation
    • Overview
    • General
      • Setting up PageFly Pages
      • What type of pages that PageFly support?
      • How to use PageFly pages and sections?
      • How to export and import PageFly pages and sections
    • Pages
      • How to create a Homepage with PageFly?
      • How to create a Product page with PageFly
      • How to create a Collection page with PageFly
      • How to create a Blog post page with PageFly
      • How to create a Password page with PageFly
      • How to create a FAQs page with PageFly?
      • How to create a Coming soon page with PageFly
      • How to create an About us page with PageFly
      • How to create a Contact Us page with PageFly
      • How to create a Landing Page with PageFly?
      • How to create A/B testing page with PageFly
    • Sections
      • How to use premade section and saved section to build page?
      • How to create a basic section with image and text
      • How to use parallax effect in a PageFly section?
      • How to create a full-width section in PageFly
      • How to make a sticky section without code in PageFly
  • Page Structure & Elements
    • Overview
    • Editor
      • User interface
        • How to work with PageFly editor?
        • How to work with PageFly on mobile?
        • Page Editor – Element Inspector
        • Page Editor - General Tab
        • Page Editor - Styling Tab
        • How to use Page outline to organize page layout?
        • How to make impressive mobile responsive page?
        • How to use autosave and version history ?
      • Extra Functions
        • How to manage custom option swatches for product variants?
        • How to use Global Styles to customize styles to use for all PageFly pages
        • How to use trash to manage deleted pages, sections, and media files?
        • How to Add Custom Font in PageFly
        • How to manage image and video in PageFly?
    • PageFly Elements
      • Universal Elements
      • Containers
        • Layout
        • Slideshow
        • Tabs
        • Accordion
        • Content List
      • Basic
        • Heading
        • Paragraph
        • Button
        • List
        • Icon
        • Divider
        • HTML/Liquid
      • Media
        • Image
        • Youtube video
        • Vimeo video
        • HTML video
        • Soundcloud
      • Social
        • Instagram feed
        • Facebook like & share
        • Facebook feed
        • Twitter feed
      • Advanced
        • QR code
        • Table
        • Countdown
        • Google map
        • Progress
        • Mailchimp form
    • Shopify elements
      • Custom Content
        • App blocks
      • Product
        • Product Variant Metafield
        • Product list
        • Product details
        • Product media
        • Product title
        • Product vendor
        • Product price
        • Product description
        • Product variant
        • Product quantity
        • Product Add to cart
        • Product view details
        • Product Metafield
        • Dynamic checkout button
      • Collection
        • Collection title
        • Collection image
        • Collection list
        • Collection view details
        • Collection details
        • Collection description
      • Form
        • Customer form
        • Customer form field
        • Customer form button
        • Contact form
        • Contact form field
        • Contact form button
        • Search form
      • Blog posts
        • Blog post list
        • Blog post details
        • Blog post image
        • Blog post title
        • Blog post content
        • Blog post meta
    • Optimization
      • How to use custom code editor to customize your page?
      • Page Analytics
      • How to speed up your Shopify store?
      • How to set up Facebook Pixel to understand the actions people take on website?
      • How to publish PageFly page to Shopify menu navigation?
      • How to use the Zakeke Product Customizer on PageFly pages?
      • How to use Langify to translate my page?
      • How to use Weglot to translate my pages?
      • How to use T Lab to translate PageFly’s page?
      • JSON Template with PageFly
      • How to Optimize Images with TinyIMG in the PageFly editor?
      • How to use Shoplift A/B Testing with PageFly?
      • How to use SEOAnt:AI SEO & Image Optimizer with PageFly?
      • Black Friday Sale Ideas
      • Optimize Pages for CRO with PageFly Elements
      • Optimize Sale On Valentines Day
      • How to set up Christmas Sale Page with PageFly | Best Guide in 2023
      • How to create a Flash sale section - Back to School
      • Optimize Your Store for Mother's Day: Create a Gift Guide with PageFly
    • Main Use Case
      • Align Elements on a Page
      • Direct to Links, Sections, Pop-ups
      • Edit Spacing, Margin and Padding
      • Flex Feature
      • Upload Files to Page
  • Integrations
    • Third-party Elements
      • How to activate integrated third party Shopify apps to use on your pages
      • What apps does PageFly integrate with?
      • Review & Rating
      • Upsell & Cross-sell
      • Badge & Seal
      • Appointment Booking
      • Delivery & Pickup
      • Subscriptions
      • Order Tracking
      • Upload Fields
      • Email Marketing
      • Product Information
      • Push Notifications
      • Referral & Affiliate Marketing
      • Image & Media
      • Loyalty & Rewards
      • Sustainability
      • Gifts
      • Internationalization
      • Advertising
      • Support
      • SMS Marketing
  • FAQ & Troubleshooting
    • Overview
    • FAQs
      • Issues with Shopify themes when using PageFly
      • How we comply with GDPR
      • The URL address of my page
      • PageFly Page editor - FAQs
      • Elements - FAQs
    • Troubleshooting
      • Live site issue
        • Cart Drawer does not Automatically Update
        • Responsive mobile horizontal scroll issue
        • YouTube, HTML Videos do not autoplay issue
        • Page not fully displayed in theme preview mode
        • Can't create locales file
        • Can't create theme.pagefly.liquid
        • How to hide Shopify's Default Product Details
        • PageFly Page List Won't Stop Loading
        • Remove the blank space on top of the page
        • Blog page not updated successfully
        • The page's style is broken
      • Error messages
        • PageFly Page List Won't Stop Loading
        • Page Size Limit
        • Limit elements on a page
        • Unable to import your data
        • Limit image size
        • Unknown error
  • Latest Update
    • PageFly is now compatible with Online Store 2.0
    • PageFly Referral Program
    • PageFly old pricing plan
  • PageFly Affiliate Program
    • Affiliate Success: Understanding what PageFly can do for Merchants
    • Affiliate Success: Dos & Don'ts - Everything to Know about Becoming a Successful PageFly Affiliate
    • Affiliate Success: Frequently Asked Questions
Powered by GitBook
LogoLogo

Product

  • Templates
  • Pricing
  • Happy Customer

Resource

  • Blog
  • Academy
  • Video Tutorials
  • Community
  • Feedback

Partners

  • Our Partners
  • Affiliate Program

Company

  • About Us
  • Careers
  • Privacy Policy
  • Terms of Service

Copyright © 2025 PageFly. All rights reserved.

On this page
  • Overview
  • Requirements
  • How To Access PageFly Custom Code Editor
  • How To Work With PageFly Custom Code Editor
  • Use Cases
  • Frequently Asked Questions

Was this helpful?

Edit on GitHub
  1. Page Structure & Elements
  2. Optimization

How to use custom code editor to customize your page?

Last updated 2 days ago

Was this helpful?

Overview

In this article, you will learn about the and how to use it.

The Custom code editor allows you to insert custom CSS and Javascript code into your page. If you are looking to customize an element or create a new effect on the page, the Custom code editor can help you insert custom code and level up your page design, increasing the conversion rate of your store.

You can even prevent some issues on your page by adding custom code such as sticky sections not working, avoiding blank spaces on top of the pages, etc.

Note: Please note that you should contact us via Live chat if you need to ask any custom code questions.

Requirements

This is an advanced feature that requires knowledge of web design languages such as , CSS, and Javascript. If you do not understand this feature, please avoid using it as it could seriously harm your page.

How To Access PageFly Custom Code Editor

To access PageFly Custom code editor, navigate to the 8th icon on the left toolbar. Click on it to access the Custom code editor.

How To Work With PageFly Custom Code Editor

Learn how to easily add custom code to modify text content and style on your pages.

  • Step 1: View the Custom CSS and Custom Javascript boxes. In the example below, we will add a code to fix the error: Sometimes when you see your pages on the mobile, the page ends up with an undesired extra space to the right. (It slides from the left to the right).

  • Step 2: Click anywhere on the page, it will automatically save the code in the editor

  • The save progress now will run automatically when you add or remove the code

Important:

  • CUSTOM CSS code: You don’t have to place any

  • CUSTOM JAVASCRIPT code: You don’t have to place any <script> tags in this area as they’re already added for your convenience.

  • The Custom code editor only supports JavaScript/ CSS code, so it doesn't allow you to add HTML code.

Use Cases

Fix Sticky Section Doesn’t Work

Remove Blank Space On Top Of The Page

Scroll to Default Product Preview

If you'd like to add a button that lets users quickly scroll to the product preview section on your product page, improving the user experience and navigation, you can do so with the custom code editor. Here’s how:

  1. Add one id for the Button. Example: pf-custom-scroll

  2. Add this custom code to the Custom Javascript

window.onload = function () {
  document.querySelector("#pf-custom-scroll").addEventListener("click", () => {
    var pfDefault = document.querySelector('[data-pf-type="ProductPreview"]');

    pfDefault.scrollIntoView();
  });
};
  1. Add one CSS code to make a smooth scroll

html {
  scroll-behavior: smooth;
}

Note: Scroll behavior: smooth is not supported by Safari.

Make the background image show fully

To ensure your background image displays fully, follow these steps:

  1. Check the width and height of the image.

  2. Calculate this formula: (height/width) * 100. (Example result is: 45)

  3. Add the following CSS:

height: 45vw;

Frequently Asked Questions

1. Can I use custom Code if I don’t have coding knowledge?

This advanced feature requires knowledge of web design languages such as HTML, CSS, and Javascript. If you don’t have coding knowledge, please refrain from using it yourself. You can reach out to us to get assistance from our technical support team.

2. Are there any limitations or restrictions on the type of custom code I can use?

PageFly supports custom code using CSS, Liquid, and JavaScript. If you need to add advanced features, knowledge of these web design languages is essential. Direct HTML code insertion is not supported, and server-side languages are not usable. If you're not familiar with coding, it's best to avoid making custom code changes yourself. Instead, reach out to our technical support team for assistance.

You can use this feature to fix the issue of the sticky section in PageFly not working. Please check our guide .

You can also use this feature to remove the blank space on top of the page (the space between the header and the first section) when you integrate a Shopify free theme, like Debut or Narrative with PageFly. You can check for more details.

here
this article
Custom code editor
HTML