How to pass username in affiliate link in wordpress website

I need to pass current logged in user in wordpress website as SUBID in the affiliate link as follows. Affiliate link format is like below. https://affiliatenetwork.com/track?id=myuserid&url=https://nike.com&subid={subid} I want to pass current logged in user as a subid in above link. I have written below code in functions.php. if ( is_user_logged_in() ) { $userName = get_current_user_id(); } <----Need code here to pass $userName as subid ( mentioned in above link).------> Please help.
Category: Web

Any way to use a custom Parameter for vimeo embed without using an iframe?

I am trying to get some oembed parameters attached to my Vimeo clips. I tried to get it going using the following two instructions: Passing Parameters to a Vimeo link in a WordPress Custom Field - LimeCanvas.com Any way to use a custom parameter for YouTube embed without using an iframe - WordPress.SE.com Unfortunately what works for YouTube won't work for Vimeo, as the returning URL has no such string as ?feature=oembed that I can make str_replace work on. It …
Category: Web

Warning at top of website & top menu gone

This warning has appeared at the top of our website, and our top menu bar has disappeared: Warning: call_user_func_array) expects parameter! +~ be a valid callback, function 'smartwp_remove_wp_block_library_css' not found or invalid function name in /home/customer/www/stpetersmedford.org/public_r includes/class-wp-hook.php on line 307 I don’t know how to decipher this message nor how to fix the problem. Are the two things related (disappearance of top menu, this warning)? Thank you for any help.
Category: Web

Passing values through url for checkbox fields with same name to get?

Look to this images For example chose "Ajna" then select "Residential and Hotel Apartment" after click Search Properties => I need to show items that have these categories <ul id="actionslist" class="dropdown-menu filter_menu" role="menu" aria-labelledby="adv_actions"> <li role="presentation" data-value="all">Project Types</li> <?php // Get Projects $tab_terms_types = array(); $terms_types = get_terms( 'property_action_category', array( 'hide_empty' => false, ) ); foreach( $terms_types as $single_term_type ){ $args_types = array( 'post_type' => 'estate_property', 'author' => -1, 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_key' => 'prop_featured', 'orderby' => …
Category: Web

Passing a parameter to a permalink

I'm trying to create permalinks for a page that currently has parameters passed to it. The site was set up by somebody else and I'm not familiar with Wordpress I have various pages which have URLs of the form /events/single-event/?u_name=<event_name>/ e.g. /events/single-event/?u_name=Hippy I would like to be able to access these various pages via /<something>/<event_name>/ where I'm not too fussy about what <something> is. <something> can have a slash in it if required. I've had a go at setting this …
Category: Web

what exactly is the "order"-parameter in pandas interpolation?

what exactly is the "order"-parameter in pandas interpolation? it is mentioned in the doc: ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘spline’, ‘barycentric’, ‘polynomial’: Passed to scipy.interpolate.interp1d. These methods use the numerical values of the index. Both ‘polynomial’ and ‘spline’ require that you also specify an order (int), e.g. df.interpolate(method='polynomial', order=5).
Category: Data Science

Changing WP_Query params with url Query Var

:) I've used WP_Query to display there posts (travels) here http://boost19.delavec.si/wordpressP/produkti/ So... I've got this WP_Query that is looping through my custom posts <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> <?php $loop = new WP_Query( array( 'post_type' => 'product', 'meta_key' => 'product_price', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'posts_per_page' => 4, 'paged' => $paged) ); ?> <?php while( $loop->have_posts() ) : $loop->the_post(); ?> <div class="av_one_third" style="display: inline-block; width: 20%; margin-bottom: 3%; text-align: center; margin-left: 3%;"> <div class="card rounded-0 …
Category: Web

Pass post title as URL parameter

On my site/blog, I have one landing page, through which I collect all ‘Consultation Requests’ – let’s call it: http://example.com/conso-request/ On every page/post of the site is a navigation link, with the text ‘Request Information’. For each page/post that CTA appears, I want it to have a unique URL which passes the post/page title to my landing page, e.g. http://example.com/conso-request/?xxx=my-great-post I've got the element id to work with btw. What's the best way to accomplish this?
Category: Web

How to use endpoint, but remove/rewrite endpoint base?

I've been messing around with rewrites and query_var to generate some listings, for example: ~/my-page/?my_var=1 ~/my-page/?my_var=2 ~/my-page/?my_var=3 After perusing StackExchange and the interwebs a bit, it seems that the overwhelming consensus is that add_rewrite_endpoint is the way to go. As such, I've implemented the following: function wpd_add_my_endpoint(){ add_rewrite_endpoint( 'my_var', EP_PAGES ); } add_action( 'init', 'wpd_add_my_endpoint' ); This yields the following URIs based on the ones I mentioned previously: ~/my-page/my_var/1 ~/my-page/my_var/2 ~/my-page/my_var/3 However, I would like to strip out the 'endpoint …
Category: Web

How to get a page url segment on wordpress?

I've created a regular wordpress page named "user" which is using a custom template. This page is supposed to be called like so: www.site.com/user/<ID> Is it possible to get the ID segment of the URL programmatically? The goal is to show the details of the user that belongs to the given ID. When testing, that part of the URL is always removed. If I request the URL www.site.com/user/123 the page is redirected to: www.site.com/user Thanks in advance.
Category: Web

What is the difference between model hyperparameters and model parameters?

I have noticed that such terms as model hyperparameter and model parameter have been used interchangeably on the web without prior clarification. I think this is incorrect and needs explanation. Consider a machine learning model, an SVM/NN/NB based classificator or image recognizer, just anything that first springs to mind. What are the hyperparameters and parameters of the model? Give your examples please.
Category: Data Science

Create URL with parameter for JQuery toggle status

Inherited a theme and cannot contact the original developer. In the site, there are toggles so that users can switch between English and Spanish versions of the content. The toggle JS is included in a theme file under assets and read as such: $('.js-spanish-toggle').on('click', function() { $(this) .find('button') .toggleClass('active'); $(this) .parents('.spanish-container') .toggleClass('is-spanish'); }); Is there a way I can alter that to create URL parameters that can be used to automatically specify the Spanish version should be active? It always …
Category: Web

Different url to same page (with dynamic content)

I have a custom php script that in a specific page of my wordpress website is generating a dynamic content (ie. page "mysite.com/citydetail" that will load a list of places specific for that city). The script is very simple, the source page (ie. "mysite.com) has a link to "mysite.com/citydetail" passing some parameters (via POST form). The page retrieves the parameters and, after a query into my database, print the content page. I would like to avoid to have the same …
Category: Web

Pulling a parameter out of the URL of a WP link without "?" or being sent to a different page

I have a specific requirement that my referral link be as simple as possible to type in manually (customer base is very low skilled) while simultaneously referring to an employee number who was responsible for the referral. So, the referral links need to look like: www.domain.com/referral/1555 Where "1555" is the employee ref number who sent this referral link, and it's the employee ref number that I'll be taking out of the URL. I'm using PHP snippets to deal with loading …
Category: Web

Accidently changed the GUID

I accidently executed: UPDATE yemnc_posts SET guid = REPLACE(post_content, 'domainA', 'domainB'); instead of UPDATE yemnc_posts SET guid = REPLACE(guid, 'domainA', 'domainB'); How can I undo this? Is this even possible? What could be a solution? Hope you can help me :)
Category: Web

Unable to display multiple parameters from url by javascript through shortcodes

From our CRM I can generate URL's for customers that includes parameters. I want to use the information stored in this parameters to show dynamic content to the customers. Example: www.example.com/page/?firstname=John&lastname=Doe&age=22 I need to display this information as the following: Firstname: John Lastname: Doe Age: 22 For this I used the following code in my functions.php <?php function dynamicParameters($atts){ //Allow to call a parameter within a shortcode $a = shortcode_atts( array( 'dynamic' => ''), $atts); //Store the parameter in variable …
Category: Web

Reduce Training steps for SSD-300

I am new to deep learning and I am trying to train my SSD-300 (single shot detector) model which is taking too long. For example even though I ran 50 epochs, it is training for 108370+ global steps. I am using the default train_ssd_network.py file from the official github repo: https://github.com/balancap/SSD-Tensorflow The command I ran for training: !python train_ssd_network.py --dataset_name=pascalvoc_2007 epochs= 50 --dataset_split_name=train --model_name=ssd_300_vgg --save_summaries_secs=60 --save_interval_secs=600 --weight_decay=0.0005 --optimizer=adam --learning_rate=0.001 --batch_size=6 --gpu_memory_fraction=0.9 --checkpoint_exclude_scopes =ssd_300_vgg/conv6,ssd_300_vgg/conv7,ssd_300_vgg/block8,ssd_300_vgg/block9,ssd_300_vgg/block10,ssd_300_vgg/block11,ssd_300_vgg/block4_box,ssd_300_vgg/block7_box,ssd_300_vgg/block8_box,ssd_300_vgg/block9_box,ssd_300_vgg/block10_box,ssd_300_vgg/block11_box How can I change the training steps …
Category: Data Science

Add custom parameter to REST API request of a custom post type?

I registered a custom post type called wasb_message with show_in_rest set to true and rest_base set to 'messages' so the resource is reachable at endpoint https://mydomain/wp-json/wp/v2/messages (using the WP_REST_Posts_Controller class). The custom post type has a custom meta field called wasb_status with an integer value, how can I add a custom parameter so when I do a get request to endpoint https://mydomain/wp-json/wp/v2/messages?status=2 I retrieve messages with wasb_status equal to 2 without register a new route? I read this code reference …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.