- This topic has 11 replies, 4 voices, and was last updated 7 years, 7 months ago by Tom.
April 6, 2016 at 7:05 am #184672Nat
How are you? I wanted to add a code to the After Content Hook, but I want to show the result ONLY to the blog posts and to the homepage. In other words, the home page will only show the excerpt and not the content I want to add to the After Content hook. Is that possible?
NatApril 6, 2016 at 7:13 am #184674Nat
Sorry Tom. I figured it out. I had to check “Execute Php”April 6, 2016 at 11:11 am #184742TomLead DeveloperLead Developer
Glad you got it sorted 🙂April 19, 2016 at 2:31 am #187855Vika
Hi, Tom!) Can you tell, please, is it possible to make new widget zone after posts?
My problem: -my site has 4 languages,
-I need widget zone after posts,
-because I want to put there widget “Text”,
-then put there HTML code of my subscribe form.
The problem is I use Polylang and I need to do 4 different widgets on different languages.
You sent me this advise:
There’s no widget under the box, but you could use GP Hooks in the “After Content” hook.
<?php if ( is_single() ) : ?>
Your HTML in here
<?php endif; ?>
Then check the “Execute PHP” checkbox
But it is usefull in case with one language. Is there any way to deal with my problem? 🙁
The illustration there: http://pixs.ru/showimage/widgetpng_7002180_21607769.pngApril 19, 2016 at 5:10 am #187887Roberto Enrique
I think that you can sort that out with:
This thread also might help:April 19, 2016 at 9:12 am #187922TomLead DeveloperLead Developer
Those links Roberto pointed to should all be very helpful.
Instead of widget logic, I would suggest this one though: https://en-ca.wordpress.org/plugins/display-widgets/
Thanks, Roberto! 🙂April 20, 2016 at 2:21 am #188080Vika
Thank you, but this plugins compatible up to 4.3.3 wordpress version and I have 4.4.2. What to do? 🙁
Is it any opportunity to write smth like this:
“After Content” hook.
<?php if ( is_single() ) : ?> <strong><em>Do Arbitrary widget???</em></strong> <?php endif; ?>April 20, 2016 at 2:39 am #188091Vika
or I need PHP hook with condition:
<?php if ( is_single on Russian () ) : ?>
<?php endif; ?>
<?php if ( is_single on English () ) : ?>
<?php endif; ?>
How to write it correct?
*sorry for annoying*April 20, 2016 at 2:47 am #188093Vika
I have different adresses for pages on different languages:
maybe it can be used like condition?…April 20, 2016 at 9:39 am #188149TomLead DeveloperLead Developer
That plugin should work fine on the latest version of WP.
If you’re using the Polylang plugin, then you should be able to do this:
<?php if ( is_single() && 'Russian' == pll_current_language('name') ) : ?> We're on a single post and Russian is the language <?php endif; ?>April 21, 2016 at 1:53 am #188288Vika
Thank you very much guys, Roberto and Tom! It really works!
Instead of only one small point:
this didn’t work:
<?php if ( is_single() && 'Russian' == pll_current_language('name') ) : ?>
<?php if ( is_single() && 'en' == pll_current_language() ) : ?>
hope our solving of this issue will be usefull to somebody else! 🙂
April 21, 2016 at 9:00 am #188364TomLead DeveloperLead Developer
- This reply was modified 7 years, 7 months ago by Tom.
Thanks! I’m sure it will 🙂
- You must be logged in to reply to this topic.