Luis Sacristán
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Paypal paymentsHi
In my experience, PayPal can be a little frustrating to use their API. You can use a plugin that helps you
https://www.ads-software.com/plugins/quick-paypal-payments/
Or perhaps you can add some filters or actions to modify woocommerce to bill the users what you need. I think it can be easier.
Hope it helps you
Forum: Developing with WordPress
In reply to: REST API with geolocation queriesHi
They are constants, I don’t know their meaning, I took the query from internet long time ago
Hi Devendra
Every plugin is different, some plugins let you change their forms, others don’t.
Which plugin do you need to change?
Forum: Fixing WordPress
In reply to: How to move the footer downHi
Try to set footer position to absolute and bottom to 0px and add some margin bottom to the page to avoid overlap content and footer.
Here you have and example
https://codepen.io/cbracco/pen/zekgx
Hope it helps
Forum: Fixing WordPress
In reply to: png over video pluginYou should ask your client for an example of what they want.
Perhaps parallax.js could help you
Forum: Fixing WordPress
In reply to: An easier way to create a thumbnail for a embeded video site?Hi
You can use thumbnails sizes
https://codex.www.ads-software.com/Post_Thumbnails#Add_New_Post_Thumbnail_Sizes
If you add a new size you have to rebuild them
https://es.www.ads-software.com/plugins/regenerate-thumbnails/
Hope it helps you
Forum: Fixing WordPress
In reply to: png over video pluginHi
Perhaps it is difficult to find a theme that have what you need.
You can do it in your theme using a container layer with a background image showing the phone and inside it the video. You must put the video in the place of the phone box.
<div class="video_container"> <video> </div>
And the CSS
.video_container { background: url(...) no-repeat; padding: 50px 100px; /* depends of the background */ }
Hope it helps
Forum: Developing with WordPress
In reply to: Redirect to homepage instead of profile pageHi
You have to use the filter
‘login_redirect’add_filters( 'login_redirect', 'my_login_redirect', 10, 3); function my_login_redirect ($redirect_to, $requested_redirect_to, $user ) { return home_url(); }
Hope it helps
Forum: Developing with WordPress
In reply to: Truly Minimal Featured ImageHi
What do you mean with different images? Different image content or different sizes?
The featured image should be the same because it’s set in the dashboard
Forum: Developing with WordPress
In reply to: How To Add Code Only in HomepageHi
If you want to add code in bottom of the screen (whole page), not in the bottom of the page content, you must modify the footer.php file. Add a sidebar in the footer but you should use is_front_page too:
<?php if(is_front_page()) { dynamic_sidebar( 'sidebar-home-footer' ); } ?>
And in your function.php
function my_widget_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'yourtheme' ), 'id' => 'sidebar-home-footer', 'description' => __( 'Add widgets here to appear in your home footer sidebar.', 'yourtheme' ), 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'my_widget_init' );
Hope it helps
Hi
It seems you are using a RegExp that is not well-formed.
Try to add a debug_print_backtrace() before line 231 in wp-includes/class-wp.php to find where the error is produced
Hope it helps
Forum: Fixing WordPress
In reply to: How to track down and remove MalwareHi,
First I should try to re-install WordPress again because the malware could change WP files.
If it doesn’t work I will try to search for the file. Do you have access to a SSH console in your hosting? You can execute this:
find . -name '*.php' -exec grep -l 'fromCharCode' {} \;
It will return the files with the malware code.Hope it helps
- This reply was modified 8 years ago by Luis Sacristán.
Forum: Developing with WordPress
In reply to: REST API with geolocation queriesHi
The only way I know is to create a MySQL procedure:
CREATE PROCEDURE geodist (IN mylat decimal(18,12), IN mylon decimal(18,12), IN dist float) BEGIN declare lon1 float; declare lon2 float; declare lat1 float; declare lat2 float; set lon1 = mylon-dist/abs(cos(radians(mylat))*69); set lon2 = mylon+dist/abs(cos(radians(mylat))*69); set lat1 = mylat-(dist/69); set lat2 = mylat+(dist/69); SELECT p.*, 3956 * 2 * ASIN(SQRT( POWER(SIN((mylat -lat.meta_value) * pi()/180 / 2), 2) +COS(mylat * pi()/180) * COS(lat.meta_value * pi()/180) *POWER(SIN((mylon - lon.meta_value) * pi()/180 / 2), 2) )) as distance FROM wp_posts as p, wp_postmeta lat, wp_postmeta lon WHERE p.ID = lat.post_id and lat.meta_key = 'latitude' and p.ID = lon.post_id and lon.meta_key = 'longitude' and lon.meta_value between lon1 and lon2 and lat.meta_value between lat1 and lat2 and post_status = 'publish' having distance < dist ORDER BY Distance; END
Supposing you have a post meta with key ‘latitude’ and other one with key ‘longitude’
Then you should call the procedure:
global $wpdb; $posts = $wpdb->query($wpdb->prepare('call geodist(?, ?, ?)', $lat, $lon, $dis));
I didn’t test, I just port from a CodeIgniter project to WordPress, but it should
Hope it works
Forum: Developing with WordPress
In reply to: Sticky responsive navigationHi
I love Codrops scripts:
https://tympanus.net/codrops/2015/10/21/page-stack-navigation/
https://tympanus.net/codrops/2014/09/16/off-canvas-menu-effects/
https://tympanus.net/codrops/2013/04/19/responsive-multi-level-menu/What should you do?
You have the burger icon with the menu inside a layer:
<div class="menu_container"> <a href="#" class="menu_button">Menu icon</a> <div class="menu"> <ul> <!-- Your menu --> </ul> </div> </div>
With this CSS:
.menu_container { position: fixed; } .menu_container .menu { display: none; }
Finally you should toggle the menu when the burger is clicked:
jQuery(document).ready(function() { jQuery('.menu_button').click(function() { jQuery('.menu').toggle(); } }
Hope it helps you
Hi Devendra
I think you mean create your own capability, you have to use add_cap
$role = get_role( 'author' ); $role->add_cap('purge_varnish');
https://codex.www.ads-software.com/Function_Reference/add_cap
Then you have to check if the user or role has this capability:
$user->has_cap('purge_varnish')
https://codex.www.ads-software.com/Class_Reference/WP_User#has_cap.28.24cap.29