Add text to the top of page in wordpress năm 2024

One of the things I love about WooCommerce is the ability to modify the plugin without touching the source code. WooCommerce is built with hundreds of action and filter hooks that allow you to change almost anything about WooCommerce. On a recent WooCommerce project, I need to Add a Message at Top or Bottom of WooCommerce Checkout Page.

It’s very easy to add a message at the top or bottom of the WooCommerce checkout page. The same goes for the Cart and Account page.

Important: If you don’t want to message to appear on the Order Received page, see . You will need to add code to your theme’s functions.php file.

One of the things I love about WooCommerce is the ability to modify the plugin without touching the source code. WooCommerce is built with hundreds of action and filter hooks that allow you to change almost anything about WooCommerce. On a recent WooCommerce project, I need to Add a Message at Top or Bottom of WooCommerce Checkout Page.

To add a Message at the top of the WooCommerce checkout page

It’s very easy to add a message at the top or bottom of the WooCommerce checkout page. The same goes for the Cart and Account page.

  1. From the WordPress admin screen, click Pages in the left menu. WordPress displays a list of pages.
    Add text to the top of page in wordpress năm 2024
  2. Click on the Checkout page to open it.
  3. On the Checkout page, you will see the following shortcode: [woocommerce_checkout] This shortcode displays the checkout page. Do Not Delete the Shortcode
  4. You can enter text above or below the [woocommerce_checkout] shortcode and it will appear above or below the Checkout page content.
    Add text to the top of page in wordpress năm 2024
    WooCommerce Checkout Page Classic Editor
    Add text to the top of page in wordpress năm 2024
    WooCommerce checkout page Gutenberg editor.
  5. Click Update to save our changes.
  6. Click View Page to view your changes. Should should see the text you entered at the top of bottom of the Checkout page.
    Add text to the top of page in wordpress năm 2024
    Message at the top of the checkout page.
    Add text to the top of page in wordpress năm 2024
    Message at the bottom of the checkout page.
  7. To add text at the top of bottom of the Cart or Account page, repeat the procedure above except open the Cart or Account page and add text above or below the page’s shortccode.

To add a PHP or Javascript at the top of the WooCommerce checkout page

In order to add PHP or Javascript at the top of bottom of the WooCommerce Checkout page, you will need to use a WooCommerce action.

The blog archive pages aren’t editable by normal means, since they’re “special” WordPress pages. Sorry, but that’s how things are.

There are a few ways you can achieve this. -Blocksy Pro’s Content Blocks feature -Elementor Pro which has a template replacement feature -Editing the archive template manually, but this requires coding knowledge.

Hope this points you in the right direction.

Thanks.

Hmm? I’m not talking about blog archive… Just when you go to the main page, i want to have some presentation text above the blog posts. So, that’s not possible at all without those methods you mention, or?

Hey @sectobrawler99

Can you post the website’s URL so I can check if the page is an archive or not?

Thanks.

@cteduard ok. Done.

  • This reply was modified 2 years ago by sectobrawler99.

Hey @sectobrawler99

Yep, the homepage is an archive.

You could try something. Try removing the blog archive as the main homepage, create a separate page with your content that you want, and at the end of the page, add the shortcode block with the [blocksy_posts] shortcode. Here’s a short explanatory video — https://www.youtube.com/watch?v=6hVUlto_a1o

Thanks.

Brilliant! Another Blocksy-thread resolved! 😀

@cteduard wait… how do i “remove” the blog as an archive the easy way? I ask because on the video, i do not get the “Edit Page” to appear for some reason.

  • This reply was modified 2 years ago by sectobrawler99.
  • This reply was modified 2 years ago by sectobrawler99.

Hello? I still do not how to do this…

Hello @sectobrawler99

First off, apologies for the late reply, but we are not active during the weekends.

In regards to that, you can change it from the WordPress Dash -> Settings -> Reading section. Then assign the homepage as the newly created “blog” page and use the instructions I gave you.

How do you add text to the header in WordPress?

From your WordPress Dashboard, go to the Appearance > Customize > Header > Header Top Bar section. Underneath the Left Content/Right Content options, you can use the dropdown menu to select one from the Text/HTML, Menu and Widget.

How do I overlay text in WordPress?

One way to add text on top of an image in WordPress is by using the Cover block. You can use this block to show any image and then type text over the image. This makes the Cover block perfect for creating hero images, headers, and banners.

How do I add text to a WordPress page?

Adding or writing text automatically creates a Paragraph block. You can also click the + Block Inserter icon and search for “paragraph”. Click it to add the block to the post or page. Adding a Paragraph block using the + Block Inserter icon.