olofiano
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: $post = NULL with ajax requestWorks perfectly without the loop. Guess it didn’t solve my question, but the problem is gone anyway.
Thanks for your input, very appreciated!
Forum: Fixing WordPress
In reply to: $post = NULL with ajax requestThank you for you quick replies! OK, it seems I need to go through some basics again ?? I’ll try without the loop and come back when it’s done.
Forum: Fixing WordPress
In reply to: $post = NULL with ajax requestThanks for your input, it is indeed that line of code that gives me the error. However, since I’m trying to use get_posts that is supposed to be located inside the loop I need the $post variable to be “working”. Otherwise the loop will be neglected. Or am I wrong?
I got it to work by using wp_Query, but the reason i don’t want to use this is that I get problems with duplicate posts, as i have multiple loops. This is easily handed with an do-not-duplicate-array of post-ids, but for that part i need $post, which i don’t have. I realize now when writing this that i probably could use get_the_ID() or something similar.
Forum: Fixing WordPress
In reply to: Internal Server Error randomly at wp-admin pageMy problem was that the server was configured in such way that the wp-config and php.ini trick didnt matter. In short: i wasn’t allowed to make any changes ion the server settings.
The way I solved it was that i finally got in touch with the server provider and asked him to increase the php memory. hope this helps, and sorry for my late answer!
Forum: Fixing WordPress
In reply to: Internal Server Error randomly at wp-admin pageIt was the memory that was the issue, and the server wouldn’t let me override it. resolved
Forum: Fixing WordPress
In reply to: Internal Server Error randomly at wp-admin pageOk, ill get back you when i have the logs.
Forum: Fixing WordPress
In reply to: Internal Server Error randomly at wp-admin pageI dont know which error logs you referr to. My problem is that I don’t have any access to anything server-side since my client uses a host without any controlpanel or developing tools. Everything is blocked and the only way i can get any information from them is via email. In short: I don’t have any error logs from the server, as stated in my first post.
If you mean the wordpress error-logging I’m not sure how to make this work but am of course happy for any help with this.
Forum: Fixing WordPress
In reply to: Internal Server Error randomly at wp-admin pageJust made a complete new english installation which works perfectly both front-end and back-end. BUT when i download the swedish language pack and set
define('WPLANG', 'sv_SE');
the problem returns.
Forum: Fixing WordPress
In reply to: Internal Server Error randomly at wp-admin pageDo you mean the errors generated using WP_DEBUG and the @ini_set() ? Like i said, i asked my hosting provider for an error log, but they havnt given it to me yet.
btw, the server uses nginx
Resolved by adding
$gw_lev_fax_var = ''; $gw_lev_mobile_var = ''; $gw_lev_mail_var = '';
before the if statements in the get_reseller() function. Don’t like it though ;P
Made some prints and realized that if i do
echo 'Duplicate?'; the_field('gw_reseller_mobile');
the output is
First reseller
Mobile: +4670738xx
Duplicate? +4670738xxSecond reseller
Mobile: +4670738xx
Duplicate?Third reseller
Mobile: +4670738xx
Duplicate?
..
..and so on. So in fact, the field ‘gw_reseller_mobile’ IS empty for the other posts, but somehow the mobile value from the first post sticks…
NOTE: nvm that the fieldnames differs in function and in template php. Its just for you guys to understand what the names mean. They are in fact identical…
Forum: Plugins
In reply to: [Magic Fields 2] Magic Fields 2.0.1 doesnt show anythingYou can try using the meta_query instead. Something like this:
$args = array( 'post_type' => 'slides', 'meta_query' => array( 'key' => 'slideshow_image', 'value' => 'the value' ) );
This will return all posts from post type slides with meta_key ‘slideshow_image’ and meta_value ‘the value’. After this just use the MF built in functions of getting the fields!
Forum: Plugins
In reply to: [Magic Fields 2] Magic Fields 2.0.1 doesnt show anythingI’m not using magic fields anymore, switched to Advanced Custom Fields. But what you need to do is get the posts from the custom type you created using magic fields. This can be done via the post_type parameter in the get_posts() function.
Then inside the loop use this code for displaying a certain magic field content in a certain place on website:
global $post; //required $temp_post = $post; //if you need $post further down in code $args = array( 'post_type' => 'your custom post type here' , //the post_type created by MF ); $custom_post = get_posts($args); //do something $post = $temp_post;
Hope this helps!
Found the solution here .
Forum: Plugins
In reply to: [Magic Fields 2] Magic Fields 2.0.1 doesnt show anythingresolved