It had something to do with hiding the dashboard function for loggedin users.
function disable_dashboard() {
if (!is_user_logged_in()) {
return null;
}
if (!current_user_can('administrator') && is_admin()) {
$link = get_author_posts_url( get_current_user_id() );
wp_redirect($link);
exit;
}
}
add_action('admin_init', 'disable_dashboard');
i remvoed this now and its working 🙂
Hi Thomas,
It is working but when i am make more columns with the builder (like a new row with a 1 column layout) then i get again a same value on that box.
How can i make it so every box in every get_row_layout on the page get a unique number?
Hi Thomas,
That is sadly not working. If i have 2 columns next to each other then i get the same values in both columns like:
field-class-1 —– field-class-1
field-class-2 —– field-class-2
field-class-3 —– field-class-3
And not like:
field-class-1 —– field-class-4
field-class-2 —– field-class-5
field-class-3 —– field-class-6
Hi John,
Great that is doing the job, thank you for your help.
Hi John,
I get no output? Do i something wrong? I have not changed the iframe content in the textarea but i dont get the src value.
<?php
$value = get_sub_field('embed_iframe', false);
if (preg_match('/src="([^"]+)/', $value, $matches)) {
$url = $matches[1];
} ?>
Hi John,
It’s not a oEmbed field but a textarea. It’s for placing a Google Map on the site but i want to put the iframe tags around it myself so i only need the url(src) of the iframe.
@dacgarz the width i already did (see the row under the red lined box) but that was not how i wanted it. But i have made my own plugin so i can make it look like i want. 🙂
That did the job! The format is just good it’s just some font names and thats it!
I made from the echo:
<?php foreach ($values as $value) {
echo '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=' . $value .':100,300,400,500,700,900">';
}
?>
And every font load in so that is working nice now!
Big thank you John!
Hi John,
Thank you for your anwser! I did your first option and i only get the word array back in the echo so i did something wrong.
Is it possible to show you some code here and that not everybody can see it?
Hi John,
It’s so that a user can select a font (Google Font) and i can load it in the Googlefonts url:
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=here the value">
But a user can do it with all different elements so thats why i don’t need double values in that loop.
Hi John,
I am not a advanced php guy but i need to duplicate the loop again (first option) to make it work you say? I get the value now, thats good :-). But i was thinking maybe it was easier with way less PHP code.
Other question: i get the values now… But how can i check if their is a duplicate value in that loop and that all the duplicated will be removed/not showing.
What i now get:
Cat, Cat, Dog, Rat, Mouse, Rat, Cat, Dog, Mouse
But what i want to see:
Cat, Dog, Rat, Mouse
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.