rel="sponsored" for custom field URL

Support MB Custom Post Type rel="sponsored" for custom field URL

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #49030
    MartinaMartina
    Participant

    I have a metabox custom field type "URL." This is output via views "wp-block-button__link."

    How can I add rel="sponsored" to this field? Without installing an affiliate plugin?

    #49033
    PeterPeter
    Moderator

    Hello Martina,

    Thanks for reaching out.

    How do you output the field URL value? Please share some screenshots of this.

    When you output the field value with PHP code, you can insert the attribute into the HTML tag as well. Here is an example:

    $url = rwmb_meta( 'url_field_id' );
    echo "<a href={$url} rel='sponsored'>output URL field</a>";

    Please check this screenshot https://imgur.com/Ltdu2B5
    and follow the documentation https://docs.metabox.io/displaying-fields-with-code/

    #49038
    MartinaMartina
    Participant

    Hi Peter,

    thanks for your reply. I was just about to change something in my views and try it out when I noticed that the save button has been removed. The license has expired, but I should still be able to edit existing views, right? Instead, where the save button used to be, there is now a message about an expired license.

    Now I'm really confused, because your FAQ says:

    What happens when my license expired?
    The product will continue to work after your license expired. You are free to continue using the product if you like, but you will not receive support and updates for the product any longer.

    How do I save now a change to an existing view?

    I output all custom fields for this CPT as views. The shortcode is then integrated into the respective article.
    I output the custom field URL in the views as follows:

     <div class="my-class"> 
    <a class="wp-block-button__link" href="{{ post.xurl_gg }}">go to extern Website</a>
      </div>
    

    best regards, Martina

    #49041
    PeterPeter
    Moderator

    Hello,

    As I can understand, the view template still works well on your site, just except for the editing. Is that right? So in order to edit the template and customize more, please renew the license or purchase a new one and activate the license key on your site.

    Thanks.

    #49060
    MartinaMartina
    Participant

    Hi Peter,
    too bad, I didn't know that existing views couldn't be edited. I've solved the problem using a plugin for now.
    Thanks.

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