Support

Account

Forum Replies Created

  • For anyone else facing the dilemma of ACF pushing links unpublished posts with the Page Link ACF type, here’s the work around I used.

    The key here is permalinks. If you’re using pretty permalinks (and you should be) published posts will use the pretty permalinks, but unpublished posts won’t.

    So, you can use PHP’s strpos(); to check the variable for specific words in the course permalink. Here’s my example:

    
    <?php // Get the Post ID
    $pid = get_field('course_selection', false, false); 
    // Use that to generate the permalink
    $ppl = get_the_permalink($pid);
    // If the permalink (string) doesn't contain 'post_type' show it, cuz it's using pretty permalinks, and therefore has been published
    if(!strpos($ppl, 'post_type')):	?>
    
    // Your code here 
    
    <?php endif; ?>
    
  • Hey @keithlock – Thanks for the suggestions.

    I was able to fix the issue by uploading a new image. New images worked just fine, but when I changed images (chose new image, reverted to original image) I ran into the same issue.

    I wish I could solve the issue itself, since there are at least a dozen images I’ll have to change, but at this point I’m glad to have any solution.

    Best,
    Adam

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