Best way to add custom shortcode via Composer

Posted in: Newspaper
Post count: 42

Hello,
I’d like to add a custom shortcode content to my homepage created with Composer.
What’s the best way?

Post count: 27744

Hello,

A shortcode can be inserted by using the element called “Column text” or “Text with title”. “Column text” and “text with title” elements have a button called “edit content” and if you click on that button, the WP Editor will open, and you can add some text/code/shortcode there. Close the WP Editor from X, save the changes from Composer and view the page to see the changes.

Thank you!

Post count: 42

Ok thank you. The shortcode must been defined in the functions.php file of the theme, right?

Post count: 27744

Hello,

No. You only need to add it there, but please let me know what shortcode you want to add.

Thank you!

Post count: 42

It’s a custom shortcode made by me in the old theme I used.

Post count: 27744

Can you provide it?

Post count: 42

Sorry, not really. It’s a complex script to get content from other sources (external db). I was just interested to know how to inject it in the page via Composer, thank you.

Post count: 27744

Hi,

Ok, you can try to use that element, or you can try the raw HTML.

Thank you!

Post count: 42

Hello Anamaria,
I followed your instructions using a column text for my custom shortcode. It seems to work fine, but the html generated by the shortcode appears at the top of the page and not in the position where I inserted the column text.

You can see it here https://nuovo.cronachedibirra.it/home-2-2/

I put the column text just before the black “Most popular” box, but its content is rendered at the top of the page. The shortcode only generates an html list (ul, li) and it’s not formatted via CSS.

Post count: 27744

Hi,

Please try to add the code in the raw HTML. Also, is there something in your code that you add to force it to be at the top?

Thank you!

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.