Archived topic
After Content Hook
11 replies · Started by Nat on April 6, 2016
Hey Tom,
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?
Thanks,
Nat
Sorry Tom. I figured it out. I had to check "Execute Php"
Glad you got it sorted :)
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.
Like this:
<?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.png
I think that you can sort that out with:
https://wordpress.org/plugins/widget-shortcode/
and
https://wordpress.org/plugins/widget-logic/
This thread also might help:
https://wordpress.org/support/topic/polylang-different-index-for-english-version?replies=2
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! :)
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; ?>
or I need PHP hook with condition:
<?php if ( is_single on Russian () ) : ?>
my HTML-1
<?php endif; ?>
<?php if ( is_single on English () ) : ?>
my HTML-2
<?php endif; ?>
etc.
How to write it correct?
*sorry for annoying*
I have different adresses for pages on different languages:
/blog/
/blog/ru/
/blog/id/
/blog/ms/
maybe it can be used like condition?...
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; ?>
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') ) : ?>
I used:
<?php if ( is_single() && 'en' == pll_current_language() ) : ?>
hope our solving of this issue will be usefull to somebody else! :)
Thanks! I'm sure it will :)
