ianpullens
Forum Replies Created
-
Forum: Plugins
In reply to: [Shortcode in Menus] stops working on 404 pageThanks for the tip on is_404()
Yeah I did more testing and your plugin is indeed working fine. For some reason it’s
wp_login_url()
specifically that does not want to load on 404. No idea why.I ended up doing it in a less procedural way and it gets the job done.
// Add shortcode for login link with return URL function setup_loginreturn() { //only add permalink if not 404 if ( is_404() ){return '/login'; } else { return wp_login_url(get_permalink()); } } add_shortcode( 'loginreturn', 'setup_loginreturn' );
Forum: Plugins
In reply to: [Shortcode in Menus] stops working on 404 pagesure. I’m glad you’ve found that it’s working. So I’m sorry that it may be my configuration. here is that code for that shortcode:
// Add shortcode for login link with return URL function setup_loginreturn() { //only add permalink if not 404 if (strpos ($_SERVER ['REQUEST_URI'] , '404' )){ $return_url = ''; } else { $return_url = get_permalink(); } return wp_login_url($return_url); } add_shortcode( 'loginreturn', 'setup_loginreturn' );
but even without the 404 condition in there, when the function was simply
return wp_login_url();
It still didn’t work.
- This reply was modified 5 years, 7 months ago by ianpullens.
- This reply was modified 5 years, 7 months ago by ianpullens.
Forum: Plugins
In reply to: [DD Last Viewed] Nothing showing upSorry to open this back up but I only just not got back to working on this issue.
I don’t think that was my issue as setting the number of items to show made no difference. I currently have it set to 10. I’ve also excluded the test pate we are viewing on.
Any other ideas?
Here is a screenshot of my widget settings:
https://dev-sandbox-is-web.pantheonsite.io/wp-content/uploads/2018/01/Screen-Shot-2018-01-16-at-5.24.27-PM.png- This reply was modified 6 years, 10 months ago by ianpullens.
ditto… any luck with this?
Forum: Plugins
In reply to: [Posts 2 Posts] Rest APII desperately need this too! did you figure it out?
Thank you for responding so quickly.
I think I understand but I’m still quite new at this.This is what I’m using right now: (inside of a function that first checks the post type and then saves after looking for my field data.)
foreach ( get_post_custom_values( 'wpcf-my-parent-field') as $key => $parent_field_value ); $child_field = $parent_field_value);
In this above code example, I’m not calling on the
$post_id
after the key forget_post_custom_values
… yetAssuming my parent post-type is “city” I tired this but I’m doing something wrong. Sorry for bing so novice…
$parent_id = '_wpcf_belongs_city_id'; foreach ( get_post_custom_values( 'wpcflmy-parent-field', $parent_id) as $key => $parent_field_value ); $child_field = $parent_field_value);
`