Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter ermilis

    (@ermilis)

    Thanks for your reply!

    In regards to your question:
    correct, I can verify that there are existing posts in the custom post type trees with the custom field popularity with a numeric value below 10.

    Any other idea or change I could try?

    I tried to understand this article by ACF on how to query posts by custom fields (within a custom post type), but couldn’t get it to work, unfortunately.

    Thanks for your effort.. really appreciate it

    Thread Starter ermilis

    (@ermilis)

    Thanks! It now does not throw any error any longer. But the actual list shows no values – instead it throws the “no results message”. πŸ™

    However, I know and have double-checked that there are a few custom posts matching the criteria (of having a popularity value < 10).

    Any other idea? Sorry for bugging you..

    I tried to find the exact query via query monitor that uses WP_Query->get_posts and found the following:

    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
    FROM wp_posts
    INNER JOIN wp_postmeta
    ON ( wp_posts.ID = wp_postmeta.post_id )
    WHERE 1=1
    AND ( ( wp_postmeta.meta_key = 'popularity'
    AND wp_postmeta.meta_value < '10' ) )
    AND wp_posts.post_type = 'trees'
    AND ((wp_posts.post_status = 'publish'))
    GROUP BY wp_posts.ID
    ORDER BY 1
    LIMIT 0, 50 /* From [www.trees.com/beliebte-hunderassen/] in [/nas/content/live/trees/wp-content/plugins/wp-show-posts/wp-show-posts.php:383] */
    Thread Starter ermilis

    (@ermilis)

    Thanks, for your reply.

    I just tried your suggestion and changed the code to:

    add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
        if ( 4566 === $settings['list_id'] ) {
            $args['meta_query'] = array(
                array(
                    'key' => 'popularity',
                    'value' => 10,
                    'compare' => '<',
                )
            );
        }
    
        return $args;
    } );

    However, the result is:

    Your PHP code changes were rolled back due to an error on line 30 of file wp-content/themes/generatepress_child/functions.php. Please fix and try saving again.
    
    Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed in wp-includes/class-wp-hook.php on line 305 and exactly 2 expected in wp-content/themes/generatepress_child/functions.php:30
    Stack trace:
    #0 wp-includes/class-wp-hook.php(305): {closure}(Array)
    #1 wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array)
    #2 wp-content/plugins/wp-show-posts/wp-show-posts.php(383): apply_filters('wp_show_posts_s...', Array, Array)
    #3 wp-content/plugins/wp-show-posts/wp-show-posts.php(570): wpsp_display('3864', '')
    #4 wp-includes/shortcodes.php(356): wpsp_shortcode_function(Array, '', 'wp_show_posts')
    #5 [internal function]: do_shortcode_tag(Array)
    #6 wp-includes/shortcodes.php(228): preg_replace_callback('/\\[(\\[?)(wp_sho...', 'do_shortcode_ta..

    Any idea of what to do?

    Thanks for your help!

    Thread Starter ermilis

    (@ermilis)

    I would really appreciate your help in this, @lapzor – thank you!

    I have now tried this code (via the snippets plugin), still with no success:

    add_action( 'wp_footer', 'sign_up_tracking' );
    function sign_up_tracking(){
    ?>
    	<script>
    	mc4wp.forms.on('subscribed', function(form) {
    	// GTM Data Layer push
    	window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event' : 'Sign-up', 'name' : form.name + ' ID: ' + form.id });
    	});
    	</script>
    <?php
    };
    • This reply was modified 4 years, 8 months ago by ermilis. Reason: Added latest code
    Thread Starter ermilis

    (@ermilis)

    Hi Lap – Thanks for the fast reply!

    I did just now via the plugin “Snippets“.

    And I did it like this: see screenshot.

    add_action( 'wp_footer', function () { ?>
    <script type="text/javascript">
    mc4wp.forms.on('subscribed', function(form) {
       window.dataLayer = window.dataLayer || [];
       window.dataLayer.push({ 'event' : 'Sign-up', 'form' : form.name + ' ID: ' + form.id });
    });
    </script>

    However, when I look in the source code (after signing up and seeing a successful thank you message), it just shows in “plain text” – without the values filled. Like this:

    <script type="text/javascript">mc4wp.forms.on('subscribed', function(form) {
       window.dataLayer = window.dataLayer || [];
       window.dataLayer.push({ 'event' : 'Sign-up', 'form' : form.name + ' ID: ' + form.id });
    });</script>

    I am using the Bimber WordPress template, which adds the sign up form via a widget (that shows a success message without reloading the page).

    Any thoughts on what I can do? Thank you…

    • This reply was modified 4 years, 9 months ago by ermilis. Reason: added code
    • This reply was modified 4 years, 9 months ago by ermilis.

    Hi team,

    I am facing the same issue. Within the Google SERP results those symbols show up as: “Nature's”. What should we do?

    Thanks,
    Alex

    Same here. What are our options?

    Issues found with your Review Snippet markup

    Dear Search Console site owner,

    Google systems show that your site is affected by 27 instances of Review Snippet markup issues. This means that your Review Snippet markup might not appear as rich results in Google Search.

    Agree, could we get a statement whether s2member is still alive. 11 months and no update. Might consider a plugin switch, if I don’t hear back as my business relies on s2member.

    Thanks & a happy New Year to all of you!

    • This reply was modified 7 years, 4 months ago by ermilis.
Viewing 8 replies - 1 through 8 (of 8 total)