Site logo

Archived topic

hook and php

3 replies · Started by Ignacio on August 31, 2018

Viewing posts 1–4 of 4

Hi,

I added a shortcode to the After Content hook. I want it to be at the end of every blog post and it works well.

I have added:
<?php if ( is_single() ) : ?>
[shortocode]
<?php endif; ?>

The problem is that he shows it to me in other cpt. For example, the events generated by the Event Calendar plugin.
I have seen that is_single can be added id, title post...
But how can I make it only in the blog posts?

Regards

OMG !!!

How could I not have seen this!
Perfect, amazing, it's ideal.

Regards

haha, you must have been hiding somewhere :) Enjoy Elements, you will be writing a lot less PHP now. Check out the other articles for Header Elements and Layout Elements.

This archived topic is closed to new replies.