4:16 am
July 1, 2017
Hi. it's hard to get help by email so I write here. can anyone know the solution known?
How to save these variables to a custom field.
Login to see the quote
I don't have a problem to save this array to tags of post.
I do.
Login to see the quote
and by custom php code cyberseo plugin add this array to the tags. but i don't know why is don't save it to the custom field - is always empty.
Login to see the quote
I would like to get a custom field with will be listed
language by decimal like i get when I get tags added to post.
maybe is a code the reverse job. and save the tags generated at the beginning with the post again to the custom field?
tnx for help.
4:32 pm
July 1, 2017
>As I said, you should you the “Custom Fields” box as it explained in the manual
no, you do not understand me.
After all, it is obvious that I have to use custom fields.
example
<person>
<person_detail_1>aaa</person_detail_1>
<person_detail_2>bbb</person_detail_2>
</person>
and person->person
this is the work base over xml I wrote that the problem is that it's written to array!
i give you copy paste from mysql.
a:2:{i:0;s:6:"aaa";i:1;s:4:"bbb";}
my question was:
how to convert this variable to get remove of this array and save everything in custom fields after the decimal. " aaa, bbb "
why? because yoast sees this variable as array. and does not display it.
the only thing I need is to rewrite this variable from the array to one after the comma. but not array.
thank you in advance, I hope you understand me now.
tnx
2:45 pm
July 1, 2017
Hi can you look on this code?
if (isset($post['custom_fields']['appearance']) && is_array($post['custom_fields']['appearance'])) {
$post['custom_fields']['appearance_low'] = implode(', ', $post['custom_fields']['appearance']);
$post['custom_fields']['appearance_cap'] = ucwords(strtolower(implode(', ', $post['custom_fields']['appearance'])));
}
is save me a appearance if is array in two places in appearance_low and appearance_cap .... but
what if appearance is not a array ? i need add a else? and where i need add a else or just don't add else and operate on only a custom field (main from plugin settings)
tnx.
3:40 pm
July 1, 2017
The problem is when in the age field there is only one value then the rewrite (implode) adds "comma" and I have something like ", blond" saved in the custom field. And I do not know how to get rid of this comma.
I thought that first I will add rewrite variables to uppercase letters and then the plugin will check in custom php but that's how it does not want to work.
(first) wrote a haircolour in ucwords
$post['custom_fields']['haircolor_t'] = ucwords(strtolower($post['custom_fields']['haircolor']));
after it....
check if haircolor is array and wrote two times haircolor_e and haircolor_t
if (isset($post['custom_fields']['haircolor']) && is_array($post['custom_fields']['haircolor'])) {
$post['custom_fields']['haircolor_e'] = implode(', ', $post['custom_fields']['haircolor']);
$post['custom_fields']['haircolor_t'] = ucwords(strtolower(implode(', ', $post['custom_fields']['haircolor'])));
}
I don't know how to keep (don't implode when value is not array. and I wast tinking a this code is ok but no.
tnx. for help
magneto664 said
Hi can you look on this code?if (isset($post['custom_fields']['appearance']) && is_array($post['custom_fields']['appearance'])) {
$post['custom_fields']['appearance_low'] = implode(', ', $post['custom_fields']['appearance']);
$post['custom_fields']['appearance_cap'] = ucwords(strtolower(implode(', ', $post['custom_fields']['appearance'])));
}is save me a appearance if is array in two places in appearance_low and appearance_cap .... but
what if appearance is not a array ? i need add a else? and where i need add a else or just don't add else and operate on only a custom field (main from plugin settings)
Just add these two lines of code after yours:
Login to see the code
Most Users Ever Online: 541
Currently Online:
20 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
ninja321: 84
s.baryshev.aoasp: 68
Freedom: 61
Pandermos: 54
MediFormatica: 49
B8europe: 48
Member Stats:
Guest Posters: 337
Members: 2817
Moderators: 0
Admins: 1
Forum Stats:
Groups: 1
Forums: 5
Topics: 1627
Posts: 8280
Newest Members:
igor.buzaev, jeremyboucher, lthompson2709, MAC, duty3canada, backlinkmoroccoAdministrators: CyberSEO: 3913