Я пытаюсь установить ссылку на другие страницы Wordpress с помощью поля повторителя плагинов ACF (заранее настраиваемого поля). У меня есть этот код в моем front_page.php:PHP Wordpress ACF Ссылка на страницу
// Product Grid Repeater
$grid = get_post_meta(get_the_ID(), 'product_grid', true);
// Check if acf/custom field data exists
if($grid) {
?>
<div class="product-grid text-center">
<h3>Our Product Lineup</h3>
<ul id="productgrid" class="large-block-grid-4 medium-block-grid-2 small-block-grid-2 effect-2" data-equalizer>
<?php
// loop through the rows of data
for($i = 0; $i < $grid; $i++) { // Custom Count/Loop through rows
// Important: Notice the _preceding and trailing_ underscores
// for $hero_image Set image return value to array and use a variable to test if photon works by using echo $image['url']
$image = (int) get_post_meta(get_the_ID(), 'product_grid_' . $i . '_product_image', true); // Subfield Name: gallery_slide_image, Type: Image
$name = get_post_meta(get_the_ID(), 'product_grid_' . $i . '_product_name', true); // Subfield Name: gallery_slide_title, Type: Text
$type = get_post_meta(get_the_ID(), 'product_grid_' . $i . '_product_type', true); // Subfield Name: gallery_slide_title, Type: Text
$link = esc_html(get_post_meta(get_the_ID(), 'product_grid_' . $i . '_product_link', true)); // Subfield Name: gallery_slide_link, Type: Page Link
?>
<li>
<a href="<?php echo $link; ?>">
<div class="grid-outline" data-equalizer-watch>
<div class="product-grid-img-wrap">
<?php echo wp_get_attachment_image($image, 'full'); ?>
</div>
<span class="type"><?php echo $type ?></span>
</div>
</a>
</li>
<?php
} // CLOSE for
?>
</ul>
</div>
<?php
} //CLOSE if($grid)
, но когда я иду нажимать на ссылки, они идут к идентификатору, а не URL/ссылку. У меня есть ощущение, что это с разделом $link = esc_html(get_post_meta(get_the_ID(), 'product_grid_' . $i . '_product_link', true)); // Subfield Name: gallery_slide_link, Type: Page Link
, но я действительно не уверен, что его изменить.
Я не знаю PHP, поскольку я беру на себя веб-сайт для дизайнера, который покинул компанию - и теперь я единственный дизайнер! Заранее спасибо за вашу помощь!
Итак, я изменил ссылку html из на и ссылки теперь РАБОТАЮ, но я все еще хочу, чтобы он сказал website.com/this-page-here и NOT website.com/?p=123. Благодаря!! – llentz