Forum Replies Created

Viewing 15 replies - 1 through 15 (of 25 total)
  • Thread Starter joropress

    (@joropress)

    Thank you very much! Excellent support! Resolved!

    Thread Starter joropress

    (@joropress)

    Thank you – this works for me, but what should I add/change in this code in order to automatically add the post title as a title of the link to the post? I need to replace “Link-to-the-post” with the actual post title in this snippet:

    add_filter( 'fep_filter_message_before_send', 'fep_cus_send_url', 999 );
    
    function fep_cus_send_url( $message ) {
        if( empty( $message['message_content'] ) || $message['post_parent'] )
        return $message;
    
        $message['message_content'] .= '<blockquote class="wp-embedded-content">';
        $message['message_content'] .= '<a href="';
        $message['message_content'] .= esc_url( $_SERVER['HTTP_REFERER'] );
        $message['message_content'] .= '" target="_blank">Link-to the-post</a>';
        $message['message_content'] .= '</blockquote>';
        
        return $message;
    }
    Thread Starter joropress

    (@joropress)

    One last thing – I forgot to mark it as RESOLVED and now this is going to be fixed : )

    Thread Starter joropress

    (@joropress)

    I needed to change this line:

    array( 'menu_order' => 1 ),

    with this:

    array( 'menu_order' => 0 ),

    and it worked perfect!

    Thank you Greg for everything!

    Problem solved! And this is my review ??

    Thread Starter joropress

    (@joropress)

    That would do the trick, but it looks like something goes wrong when the code is being executed. The browser-site-tab just stops working for a couple of minutes. The whole site stops working for this period. No matter the browser – tried with Firefox, IE and Chrome. Same result. There are no additional errors when debugging.
    It looks like it works because after some time when I run again the browser the checkbox is unchecked. What could cause this time delay?

    Thread Starter joropress

    (@joropress)

    Brilliant! That really solved the problem! Thank you for the time spent on this topic!
    But I realized that there is one more thing that needs some attention. I need to uncheck the Featured Ads checkbox that stays checked when a paid Ad (after expiration) for some reason is renewed as a Free Ad. Otherwise the Free Ad would still look like a Paid one with the only difference that will not be shown in the Carousel Slider due to the removed Vip tag.
    Is there a way to do this final thing?

    Thread Starter joropress

    (@joropress)

    Hi,
    is there any progress?

    Thread Starter joropress

    (@joropress)

    The standard Bank Transfer method.

    Thread Starter joropress

    (@joropress)

    Hi,
    I have some small errors in my site but they really don’t affect in this case.
    I know this for sure because during the debugging process I temporary cleared all the errors by not using some code snippets in order to see if this solves the problem but it doesn’t. The tag still do not add on renewal.

    I noticed that the tag is not added on renewal initially but is being added if for example I put the renewed Ad to the status of “pending” again and after that goes back to “completed” manually. So by thinking out of the box I think that if there is a code that could add this second turning between “pending” and “completed” status this would solve my problem. Do you know such a code?

    Lets summarize – it perfectly works on free Ads turned to paid and on paid Ads renewed before they have expired. It doesn’t work only if an expired Ad is renewed.

    By the way – if I change it on both places the previous error occurs but if changed only to the second place (378 line) there is no more error message. So I use it that way.

    • This reply was modified 6 years, 9 months ago by joropress.
    • This reply was modified 6 years, 9 months ago by joropress.
    Thread Starter joropress

    (@joropress)

    Hi,
    After changing the line I don’t see a fatal error in debug mode like before.
    There are 2 instances (on 300 and 378 row) of this line in my-site\wp-content\plugins\wpadverts\addons\payments\includes\admin-pages.php should I change both?

    The problem still occurs. On Ad publish everything works fine and the tag is added automatically, then on Ad Expire the tag is removed automatically but on Ad Renewal – the Ad gets renewed but the tag is not added again.

    Thread Starter joropress

    (@joropress)

    Ok, so here is how this effect could be achieved, having in mind that default number of columns in my case is set to 2 in the WP Adverts Core:

    1. I use a child list.php template as shown here
    https://wpadverts.com/documentation/child-themes-and-templates/

    2. In wpadverts/includes/shortcodes.php change this line of code:

    if( $switch_views && in_array( adverts_request( "display", "" ), array( "grid", "list" ) ) ) {

    to this:

    if( $switch_views && in_array( adverts_request( "display", "" ), array( "grid", "grid3", "list" ) ) ) {

    then just below this code:

    if( $display == "list" ) {
            $columns = 1;
        }

    add:

    if( $display == "grid3" ) {
            $columns = 3;
        }

    3. Open the child template of list.php and below this line:

    <?php if($switch_views): ?>

    add this:

    <a href="<?php echo esc_html( add_query_arg( "display", "grid3" ) ) ?>" class="adverts-button-small adverts-switch-view" title="View in 3 columns grid"><span class="adverts-square-icon adverts-icon-th"></span></a>

    Now in your Advert’s page you should have a 3rd button changing the grid dynamically to 3 columns.

    4. It would be a good idea to backup the shortcodes.php file otherwise it could be lost during next WP Adverts update.

    That’s it!
    Using the same method could be added another button changing the view to 4 columns grid if needed. The only difference would be that you must use an image for the grid instead of a FontAwesome icon because there is no such an icon yet : )

    Thread Starter joropress

    (@joropress)

    It looks like there are 2 errors connected to this – the first one is:

    Notice: Undefined variable: payment in my-site\wp-content\plugins\wpadverts\addons\payments\includes\admin-pages.php on line 378

    This is what I have on line 378 of the admin-pages.php file. You should see the same if you check the original file of the WPAdverts plugin. I didn’t change anything in this file. Is it possible to be a kind of a bug?

    do_action("adverts_payment_".$status_new, $payment);

    and the second:

    Catchable fatal error: Argument 1 passed to tag_an_advert() must be an instance of WP_Post, null given in my-site\wp-content\themes\store-child\functions.php on line 1030

    This is what I have on line 1030:

    function tag_an_advert( WP_Post $payment ) {

    and this is a line from this function:

    add_action("adverts_payment_completed", "tag_an_advert");
    function tag_an_advert( WP_Post $payment ) {
        $type = get_post_meta( $payment->ID, "_adverts_payment_type", true );
        if( $type && ! in_array( $type, array( "adverts-pricing", "adverts-renewal" ) ) ) {
            return;
        } 
        $object_id = get_post_meta( $payment->ID, "_adverts_object_id", true );
        wp_set_object_terms( $object_id, "vip", "post_tag", true );
    }
    • This reply was modified 6 years, 9 months ago by joropress.
    Thread Starter joropress

    (@joropress)

    Done! It works! ??
    Is it ok if I share my customization here so someone else could use it if needed?

    Thread Starter joropress

    (@joropress)

    Same result. It doesn’t work on renewal. There’s no tag added after Ad’s renewed. It works only when posting the Ad. I wonder whether I use the right way to remove the tag or there’s a conflict coming out of this?

    wp_remove_object_terms( $post_id, 'vip', 'post_tag' );

    I’m not sure if this is somehow connected but I noticed that on Payment Status bulk update it shows white/blank screen. And this is shown only when updating to the status: “Completed”. I have no problems to change at bulk the Ad’s status to any other except this one. At the same time everything works fine when I change the status to “Completed” not using the bulk option.

    I think this is not a memory issue because I have changed the memory to 256MB using this line in my wp-config.php file:

    define( 'WP_MEMORY_LIMIT', '256M' );

    So I am not sure what is going on – any ideas?

    Thread Starter joropress

    (@joropress)

    Thank you Greg!
    Actually your help, combined with the prays I used, gave me the desired result!
    It works!
    Resolved!

Viewing 15 replies - 1 through 15 (of 25 total)