Articles of functions

Unable to login using username

In my website i have signup and sign form.And also I exposes the web services for the signup and sign in form. Flow of web as well as mobile application are as follow: For every signup the registered users are receiving an activation link Below is the code responsible for sending the activation link: // […]

Filter the query ONLY for the search results page

I am trying to customize the search results for a generic search, but only if it’s using the search.php template. I have other searches on my site, and I don’t want this filter interfering with them. Everything works on the following code, except for is_page_template(‘search.php’). Once I enter that line of code as a condition, […]

Generating Responsive Background Image Sizes in PHP

Im trying to generate responsive background images for my page header, using a modified version of this gist, but I cant get it to work correctly, and Im not sure if the issue is with wp_get_attachment_image_srcset, wp_calculate_image_sizes or the loop itself. Here’s my code: Responsive Image Size Attributes function adjust_image_sizes_attr( $sizes, $size ) { $width […]

Add Custom Background Properties to Customizer

I’ve just added a second background image upload with the intent of using in the footer: $wp_customize->add_setting( ‘tcx_background_image’, array( ‘default’ => ”, ‘transport’ => ‘postMessage’ ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, ‘tcx_background_image’, array( ‘label’ => ‘Footer Background Image’, ‘settings’ => ‘tcx_background_image’, ‘section’ => ‘custom_options’ ) ) ); I’m wondering how to include the preset, image […]

get_next_posts_link not working without parameter max_num_pages

I have a custom search page (searchpage.php) using pagination, and I am tring to add lines like below dynamically to my header.php inside <head></head> tag for better pagination SEO. <link rel=”prev” href=””> <link rel=”next” href=””> While doing this, I have used below code mentioned here in functions.php. <?php function rel_next_prev(){ global $paged; if ( get_previous_posts_link() […]

admin-ajax.php + load-scripts.php hanging for minutes

My issue is that when I do a simple Admin Dashboard change, like updating a post or page, I sometimes wait up to 10 minutes for the request to finish. I have tried restarting the process and my server many times; the only way it works is if I wait all 10 minutes or so […]

All sites themes functions.php have been changed

all of the themes functions.php have been changed for the sites on my web hosting server. Because I couldn’t copy it here without making it look ok, the code is here: Is this legit? The core functions.php doesn’t have it. Can plugins make changes to the files outside their currently directory? For example, can […]

Keyword checking in Gravity Forms

In Gravity Forms I’d like to include a small keyword checker that is checking the user’s message for “spammy” words and stops sending the entry to the admin. For this a hidden field changes it’s value. I have this code included in my functions.php so far function strpos_arr($haystack, $needle) { if(!is_array($needle)) $needle = array($needle); foreach($needle […]

How to create a php variable using WordPress the_title() function

I want to create a php variable which will use the the_title function: So if the title of the post is “Style” the variable will name will be $style and if the post title is “Dog” the variable name will be $Dog. Is it possible? I tried ${the_title()}; But it echoes the title. My goal […]

Word Press – Dynamic Content

I am looking for an easy to manage CMS and WordPress would definitely meet this criteria. However my website needs to have dynamic process in it. Within a log-in area, I am planning a process where my clients need to give feedback to certain questions concerning business needs, etc. Based on this input I am […]