[Support request] Hook element not showing anymore

Home Forums Support [Support request] Hook element not showing anymore

Home Forums Support Hook element not showing anymore

  • This topic has 5 replies, 2 voices, and was last updated 4 years ago by Leo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1213127
    Edera di V.D.

    Hi,

    I am new about wordpress and about generalpress, I installed it a couple of days ago.
    I have two questions that I couldn’t find solution in the forum.

    (1) this morning I create a hook that showed a button, with this code

    <?php
    $custom_field = get_post_meta( get_the_ID(), ‘mycustomfield’, true );
    ?>
    “>Start

    I set the display rules on all articles and it was ok.
    Now I excluded some articles from the display rule and it doesn’t show anymore on no article.

    (2) I tried to create a shortcut with Elements > Hook > custom hook
    But I can’t understand how to show it in my posts or pages.
    I continue to show the text of the shortcode without executing it.

    Thanks a lot

    #1213224
    Leo
    Staff
    Customer Support

    Hi there,

    Can you do this first so I can inspect the code better and eliminate any caching errors?
    https://www.screencast.com/t/wgLhb3ftU

    1. Sounds like a display rules error. Can you show a screenshot of the display rules?

    You can use a service like this to upload a screenshot:
    https://postimages.org/

    2. Did you check to Execute shortcode?
    https://docs.generatepress.com/article/hooks-element-overview/#settings

    #1213282
    Edera di V.D.

    Hi,
    here the settings:

    link-quiz is a custom field that I use also in an other element header.

    [url=https://postimg.cc/z36nPcQ4][img]https://i.postimg.cc/z36nPcQ4/Schermata-2020-03-28-alle-19-01-39.png[/img][/url]

    [url=https://postimg.cc/FfrcL5fk][img]https://i.postimg.cc/FfrcL5fk/Schermata-2020-03-28-alle-19-01-44.png[/img][/url]

    [url=https://postimg.cc/hJ2m8yxy][img]https://i.postimg.cc/hJ2m8yxy/Schermata-2020-03-28-alle-19-01-55.png[/img][/url]

    2. I tried both checked, unchecked, I really can’t understand how to do

    #1213461
    Leo
    Staff
    Customer Support

    1. So just to make sure, everything shows correctly if you don’t add any exclusions in display rules?

    2. If you are using shortcode in the hooks element then execute shortcode needs to be checked.

    If that doesn’t work, can you test if the shortcode executes in regular page content?

    #1218154
    Edera di V.D.

    Before answer I tried again, I duplicated the hook and set the display rule: All articles without exclusion, and it worked.

    A note, I don’t know if it can be useful: when I duplicated the the hook I got this error
    [url=https://postimg.cc/fSxxDQ6K][img]https://i.postimg.cc/zvQpwJ79/Schermata-2020-03-29-alle-10-49-40.png[/img][/url]

    but when I saved it worked well, despite this message, and after I saved the error disappeared.

    #1218664
    Leo
    Staff
    Customer Support

    That’s weird. Let us know if it shows up again.

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