How to insert a shortcode programatically in an article

Posted in: Newspaper
Post count: 11

Hi,

I am trying to automatically insert the following short-code in an article each time I click on NEW ARTICLE.

<strong><?php echo do_shortcode('[gallery]'); ?></strong>

Which file should I be modifying ?

Thanks,

Ka Sangoyah

  • This topic was modified 8 years by ksangoyah.
Post count: 11

I finally figured it out. It’s done through the loop-single.php file. It works great. No need to manually insert the short-code.

Post count: 25

Hi,
i using this code on single.php to showup images on my post (automaticaly)
But, if i click this image i will go to image url.
Can you tell me how i can show images, but if i click images. i will be go to attachment pages.
sorry with my english.
Thanks

Post count: 22421

A gallery in our theme will always open in a lightbox. Sorry but there is no simple way to making gallery images link to the attachment page. Please do not use galleries if you need attachment pages.

Thank you!

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