We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • in reply to: Sticky posts: issue + how-to style as featured post #29407
    P
    Participant

    Hi Tom,

    Thank you for the follow-up. Adjusting the WP Query does not seem like a reasonable option, indeed.
    For the time being, we’ll adopt the workaround solution with two lists: one for the sticky post and another for the featured with a filter on categories. We’ll need to just adjust the layout but that’s straightforward.
    I’ll close this ticket. Thanks for your time.
    Best

    in reply to: Sticky posts: issue + how-to style as featured post #29133
    P
    Participant

    Hi Elvin,

    I went further into this and, after testing/deactivating several other things without success, i started from scratch with a clean install (see below). IMHO I think there is an issue with WPSP, in that the sticky property seems to be ignored by WPSP when i select for specific categories to constrain the posts displayed in a list. Maybe something with the underlying query construction?

    I’ve tried a few variations and, at least in my staging environment, i can consistently recreate this issue. I can even have a list with the issue next to one without the issue, using the same posts 🙂 I also checked this against the client’s website setup&data and my assessment of the issue holds. In your example website, given the video you shared, you are not filtering for specific categories. If you do, do you also see the sticky post dropping off the top position?

    For testing, I created a clean install of WP 5.7 with GeneratePress, WPSP and WPSP Pro. I created 3 post categories and 3 posts, one for each category. I created 2 lists: one without the filter for categories, where the older sticky post stays on top as desired; and another with the filter, where the sticky property is ignored. I don’t want to publish the link to the page here. How can i send it to you directly, if you need it?
    As a side note, in both cases the “featured” styling can be applied, as you had indicated.

    Please have a look and let me know if you find the same issue. Since we need to be able to filter for categories in this list, and also use the “sticky” post and “featured” styling, it would be great if this issue could be solved.

    Thank you in advance. Best,
    Paulo

    in reply to: Sticky posts: issue + how-to style as featured post #28999
    P
    Participant

    Hi Elvin,

    Thank you for the quick follow-up.
    Your sandbox link has likely changed and i can only see one article, but that’s ok – I assume it all works normally 🙂

    Regarding the sticky issue: i still can’t get it to work correctly on this site. I’ve re-checked and, for this particular list, the shortcode used has no extra args and there is no applicable php snippet in functions.php. There are a few extra snippets that target other lists, but they all specify the action by id; i expect this is not a cause.
    If i use the “Posts” block from Kadence Blocks, the sticky post stay on top of the list even if there are newer ones.
    I’ll try a partial rebuild in a staging site and go through other potential sources: deactivate all php snippets, side-effect from another plugin (like autooptimize), hosting settings. I’ll get back to you in case the issue persists.

    Regarding Question 1: i could not see it in the sandbox link. Still, maybe i need to restate my question as “with the options given by WPSP Pro, can i keep a sticky post at the top of the list AND apply the “featured post” look to it even when the sticky post is not the most recent one?” Previous forum threads indicated “no” but your answer says “yes”.

    As for Questions 2: thanks, i agree. I would simply add the extra styling in the “custom.css”.

    Best regards,
    Paulo

    in reply to: PHP version of shortcodes with multiple parameters #24528
    P
    Participant

    Hi Elvin,

    Thanks for the link. That was all i needed and it worked perfectly!

    Great support, as always.

    Wish you all a good holiday season and start of 2021!

    Cheers,
    Paulo

    in reply to: PHP version of shortcodes with multiple parameters #24464
    P
    Participant

    The example above was cleaned, funnily enough 🙂

    Just for clarity: The “&” is replaced by & (“&” followed by the ampersand HTML code). This leads to the problem described above. I understand this is not WPSP’s flaw, rather WordPress’ beahviour.

    Best regards.

    in reply to: Adjusting results for display and autoplay in carousel #23667
    P
    Participant

    Thank you once again. I’m not quite sure i get the full implication of your answer but i get the gist of it 🙂

    Since having the conditions inside the add_filter does not work, would it help to define the function custom_excerpt_length before calling the add_filter?

    In the function, we could define the custom excerpt length if the post is in a given WPSP list and if it’s the latest published one (as in “if ( 0 === $wp_query->current_post )”); otherwise, the normal excerpt would be applied. I’ve tried fiddling with the code but this is above my know-how.

    It could be a question for stack exchange but i’m not sure how much the solution is dependent on any given specificity of WPSP (ie interaction with the different WP classes, etc).

    Thanks in advance,
    Paulo

    in reply to: Adjusting results for display and autoplay in carousel #23623
    P
    Participant

    Dear Tom,

    Thank you for the follow-up and suggestion.
    The first question is solved, but the excerpt length one unfortunately not.

    I’ve tried the suggested code but it changes the excerpt length for all the posts in the list, not just the featured post (as desired). Upping the priority to 1000 did not make a difference. I had also replaced the ); ) { with ); { by at the end of line two as it threw a validation error.

    For now, i simply added a manual excerpt to the featured post, but it would be preferable to have the automatic behaviour in place, if possible.

    Would it help if i give you access to the dev site?

    I really appreciate your continued support! Best,
    Paulo

    in reply to: Adding & styling linkedin icon #23621
    P
    Participant

    Hi Tom,

    Thanks. I’ll follow that path since i’m using GeneratePress Pro on this particular website.
    We can close this ticket.

    Thank you to you and Elvin,
    Paulo

    in reply to: Adding & styling linkedin icon #23439
    P
    Participant

    Hi Elvin,

    I’ll rephrase the last question: how can i load the same custom meta “linkedin-profile”, created via ACF for all posts of a specific category, and make it show in the individual post entries?
    I’ve tried re-using the above code, by adjusting the if clause to look for posts matching the desired category, but i can’t produce the correct code…

    Thanks in advance,
    Paulo

    in reply to: Adjusting results for display and autoplay in carousel #23437
    P
    Participant

    Hi Elvin,

    Thank you once again for the replies. I would be thankful if i could have your help still, since there are a couple of issues.

    Regarding questions #1 and #3: it works, but when i apply it but it makes the carousel only show one item/post “per slide”, instead of the 3 per slide that i had defined in the properties of the list. I added an if clause to apply it only to a specific carousel; the problem happens with or without the if clause:
    add_filter( ‘wpsp_carousel_args’, function( $args ) {
    if ( 1477 === $settings[‘list_id’] ) {
    $args[‘autoplay’] = false;
    return $args;
    }
    } );

    Regarding #2, there seem to be 2 problems with the code you suggested:
    – On the one hand, it does not change the length of the excerpt, at all. I replaced the “123” for the list_id and tried different values for the “return” value. No visible effect.
    – On the other hand, it does not see to correctly restrict (match?) the first if condition just to the featured post. I replaced the “global $wp_query” expression with a simple echo “message”, to see if and where it would show up. Result: all the posts in the list showed that message between title and excerpt, not just the featured one. I’ve tried to dig into the plugin code to see how it is marked, but it goes past my know-how to find a solution 🙁

    Any idea on how to proceed? I’ve tried to combine your suggestion with the function suggested in WordPress’s Code reference, but no luck either:

    function mytheme_custom_excerpt_length( $length ) {
    if ( 1496 === (int) $settings[‘list_id’] && $settings[‘featured_post’] ); {
    global $wp_query;

    if ( 0 === $wp_query->current_post ) {
    return 10; // Whatever the length you need for the first post.
    }
    }

    return $length;
    }
    add_filter( ‘excerpt_length’, ‘mytheme_custom_excerpt_length’, 999 );

    Thank you in advance and best regards,
    Paulo

    in reply to: Adding & styling linkedin icon #23098
    P
    Participant

    Hi Elvin,

    Thank you for your previous suggestion. I ended up implementing the code below in the functions.php file:

    /* Add linkedin button in WPSP listing*/
    add_action( ‘wpsp_after_content’, function( $settings ) {
    if ( 10 === $settings[‘list_id’] ) {
    $meta = get_post_meta( get_the_ID(), ‘linkedin_profile’, true );
    if ( $meta ) {
    echo ‘<span><span class=”screen-reader-text”>%4$s</span></span>‘;
    }
    }
    } );

    I tried to use the fonts loaded with WPSP Pro, hoping i could load the linkedin icon, but i could not make it work. As such, i installed the FontAwesome plugin to get that icon, and ended up using the “fa” classes plus a custom “linkedin-button” for the styling. It’s maybe a bit overkill for just one icon 🙂

    I have one additional question, if i may: how can i load the same icon in the individual post entries? If it’s out of scope for this forum, just let me know!
    Thank you once again and best regards!

    in reply to: Adding & styling linkedin icon #22885
    P
    Participant

    Hi Elvin,

    Thank you for your reply.
    I tried your instructions (see below). Before that, i also thought of a couple of possible alternatives. Maybe you have some thoughts on it?
    – I thought of using the “Lightweight social icons” plugin from Tom, thinking it would be simple. However, i could not get it to show in the WPSP view so i dropped it.
    – After looking at the plugin code, i also thought of simply extending the ” Show social sharing buttons” options by replicating and adapting the existing structure in the code. However, this would be lost with the next upgrade so i also dropped it 🙁

    Following your instructions, I’ve started by using the ACF plugin to create an extra field called “linkedin__profile” (Type “Link”), to be used and displayed only in Posts of a certain category. The plugin also allows to assign a css class, which is handy.
    Since i’m using a child theme, I’ve added the php snippet above into the functions.php file, adapted as such:

    add_filter( ‘after_setup_theme’, function(){
    remove_action( ‘wpsp_after_content’, ‘wpsp_add_social_sharing’, 10 );
    add_action( ‘wpsp_after_content’, function(){echo get_field(‘linkedin__profile’);
    }, 10 );
    });

    However, i’m still not managing to display it correctly in the WPSP view (or in the single post itself, but that’s another thing). It either shows “Array” or the url as plain text. I’ve seen this mentioned in this thread Custom fields, so i’m checking that more carefully since i’m not very experienced in this part 🙂

    That’s is all for now. Thank you for your time and help,
    Paulo
    I’ll add the css through the “Customize > Additional CSS” path.

    in reply to: Define CSS style based on post category #22882
    P
    Participant

    Dear Elvin,

    Thank you, that’s perfect! I had overlooked that class selector since i was looking further down in the markup.

    I’ve managed to do what i wanted by specifying the correct selector but i also add to apply “!important” at the end of the property value. In my case:

    article.category-[slug] .wp-show-posts-inner {
    border: 1px solid #371497 !important;
    }

    You can close this one. Thanks and best,
    Paulo

Viewing 13 posts - 1 through 13 (of 13 total)