[Resolved] After Content Hook

Home Forums Support [Resolved] After Content Hook

Home Forums Support After Content Hook

  • This topic has 11 replies, 4 voices, and was last updated 8 years ago by Tom.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #184672
    Nat

    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

    #184674
    Nat

    Sorry Tom. I figured it out. I had to check “Execute Php”

    #184742
    Tom
    Lead Developer
    Lead Developer

    Glad you got it sorted ๐Ÿ™‚

    #187855
    Vika

    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

    #187887
    Roberto Enrique
    #187922
    Tom
    Lead Developer
    Lead 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! ๐Ÿ™‚

    #188080
    Vika

    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; ?>
    #188091
    Vika

    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*

    #188093
    Vika

    I have different adresses for pages on different languages:

    /blog/
    /blog/ru/
    /blog/id/
    /blog/ms/

    maybe it can be used like condition?…

    #188149
    Tom
    Lead Developer
    Lead 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; ?>
    #188288
    Vika

    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! ๐Ÿ™‚

    • This reply was modified 8 years ago by Tom.
    #188364
    Tom
    Lead Developer
    Lead Developer

    Thanks! I’m sure it will ๐Ÿ™‚

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.