Support

Account

Home Forums General Issues Get the $attachment_title and set that as post title/slug…

Unread

Get the $attachment_title and set that as post title/slug…

  • Hi there,

    I hope you guys can help me out of my struggle…

    I’m fairly new when it comes to customizing and coding on WordPress(learning everyday).

    What i’m trying to achieve is, get the $attachment_title and set that as post title/slug…

    I’ve diged into the documentation of Advanced Custom Fields but it doesn’t make me any wiser, it all seems Chinese to me..

    So far I was able to set up a custom field “Image” and added this into my functions.php

    $image = get_field('image');
    $size = 'full'; // (thumbnail, medium, large, full or custom size)
    
    if( $image ) {
    
    	echo wp_get_attachment_image( $attachment_title );
    
    }

    How to I go from here to set the attachment_title to the WordPress post title and the slug?

    I hope you guys can help me out, or guide me in the right direction…

    Thank you for taking your time to read this

    Cheers,

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.