Custom Shortcode – Errors at columns elements: 15(models) : 16(dom)

Posted in: Newspaper
Post count: 3

Hello,

I know what it seems this is doing can be done using the page builder. But I need to create a custom shortcode as I am dynamically getting the content.

I need to create a custom shortcode using the existing shortcodes from the Newspaper theme. But when I add the content and call do_shortcode() I get the error in the Composer/cloud template builder.

Errors at columns elements: 15(models) : 16(dom). The model does not match the content Current state has involved an issue. You could try an UNDO operation (CTRL+Z / CTRL+SHIFT+Z)

Below is a minimum example of the code:

function custom_shortcode() {

$output = do_shortcode('[tdm_block_socials social_rel="nofollow" tds_social="tds_social3" facebook="https://www.facebook.com/TagDiv/"]');

return $output;
}
add_shortcode('te_social_links', 'custom_shortcode');

How can I update this so I do not get the error and can work with Composer. Additionally where can I also find hooks for the other shortcodes so I can dynamically add the values.

Thank you

  • This topic was modified 2 years by innovator.
  • This topic was modified 2 years by innovator.
Post count: 27744

Hello,

Please let me know what you want to do with the shortcode, because the theme has a social icon element.

Thank you!

Post count: 3

Hi Anamaria,

I have a ACF field on posts that have social links related to each page. In this example I am trying to display them on the page, which works fine but I can access the Composer due to the error. I have to comment out the do_shortcode() line change the template then re-enable it.

I have provided a limited version of the code so you can recreate the problem. The shortcode is added via composer to the page template as a ‘Single External Shortcode’ from composer.

Thank you

Post count: 27744

Hi,

Please provide some screenshots and a video to understand exactly what you want to do.

Thank you!

Post count: 22

We have developed in-house a shortcode and want to deploy it in a Block (Say Block 15) on the landing page of Newspaper Default scheme. Can you pl. share a sample code? Assume the name of the shortcode is [ExampleShort]

Post count: 27744

Hi,

You can’t add the shortcode on a block. You can use a column text to use it.

Thank you!

Post count: 22

Thank you. That worked.

Post count: 22

I did add it as Column Text and it works in Laptop/ Desktop: See https://www.pgurus.com. Now see the same thing on a Smartphone, and this shortcode does not show up! 95% of my viewers consume our content on a Smartphone! How do I get it to work on a Smartphone? I am using Newspaper Theme V12.6.2.

Thanks in advance

  • This reply was modified 2 years by Mystic.
Post count: 27744

Hello,

Please let me know what element is set in the column text, and provide some screenshots.

Thank you!

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