Bohdan Shila
Forum Replies Created
-
Forum: Plugins
In reply to: [WP YouTube Lyte] Generate thumbnail URL in PHPThanks! I used that and that’s my final solution if someone needs it too:
//Custom YouTube thumbnail add_filter('lyte_match_thumburl','lyte_my_own_thumburl'); function lyte_my_own_thumburl($thumb) { if (is_singular('post')) { $thumb = get_the_post_thumbnail_url(get_the_id(), 'entry-body-size'); } return $thumb; } //Preload thumbnail add_action('wp_head', function () { if (is_singular('post')) { ?> <link rel="preload" href="<?php echo get_the_post_thumbnail_url(get_the_id(), 'entry-body-size') ?>" as="image" type="image/jpg"> <?php } });One last question: I understand that the ID has to be numeric, right? I tried it with numeric values and it works great. But is there some way to make it work with strings?
It partially works but when I refresh the page it still adds a +1 to all sections:
https://share.getcloudapp.com/P8uYQJ66Here is my code:
if( have_rows('contenido') ) { while ( have_rows('contenido') ) : the_row(); ?> <section id="<?php if(get_sub_field('css_id')){the_sub_field('css_id');} ?>"> <?php echo do_shortcode('[wp_ulike id="'.get_sub_field('css_id').'"]'); ?> </section> <?php endwhile; endif;i’m using the shortcode for now but it could use the function if its necessary.
An example of my code:
if( have_rows('contenido') ) { while ( have_rows('contenido') ) : the_row(); ?> <section> <?php echo do_shortcode('[wp_ulike]'); ?> <!-- More stuff inside --> </section> <?php endwhile; endif;Hey @alimir, thanks for the answer! Is there some documentation about how can I use this custom ID functionality in my code?
- This reply was modified 6 years, 5 months ago by Bohdan Shila.
Forum: Plugins
In reply to: [WP User Manager - User Profile Builder & Membership] Retrieve user meta dataYeah! Works perfectly. Thanks!
Forum: Plugins
In reply to: [WP User Manager - User Profile Builder & Membership] Retrieve user meta dataThanks for answering! No, that code isn’t working in functions.php
The filter is correct, if I use some random string in return, it changes my metatitle, but I want to insert profile’s full name in the meta title, so I need to get that data from WPMUM somehow.
Just need the correct way to retrieve that profile user’s ID, so the $data->user->ID part is the one is not correct.
For example if I use get_current_user_id() instead of $data->user->ID, it works “well” but it uses current logged user ID, not the current profile user ID.
- This reply was modified 6 years, 7 months ago by Bohdan Shila.
- This reply was modified 6 years, 7 months ago by Bohdan Shila.
Oh great! It was actually excluded from search and now it works perfectly. Thanks!
¡Hello!
Yes, I actually used this function and it works well for Twitter but when I try to share the post in Facebook, it shares the home page and when I try it with +Google it says “invalid URL”.