A function is a sequence of program instructions that perform a specific task. It is packaged as a unit that can be used wherever the according task should be performed.

learn more… | top users | synonyms (2)

0
votes
0answers
11 views

Using AJAX to execute function but require_once top of functions.php no loading?

I'm using AJAX to post a registration form. The fields are sent to a function within functions.php. After a successful registration on the WP site, the fields are also sent to QuickBooks. The ...
0
votes
0answers
12 views

advance email configuration

i set up a site using wordpress and woocommerce. my question is can i send New Order email to different recepients based on the user selection on checkout page. Ex:- if i had 5 (x,y,z,a,b) sellers ...
0
votes
0answers
14 views

Adding custom field to permalink structure

I have a wordpress site that uses a custom post type 'external-projects'. Within that custom post type there is a custom field 'director'. What I am trying to do is rewrite the permalinks to include ...
0
votes
1answer
16 views

wordpress Shortocode running twice?

I developed a plugin for my citrus payment gateway.I created a shortcode to manage it. It was running absolutely fine some days ago.Now I don't know who changed what, now that shortcode is running ...
0
votes
0answers
13 views

Return search for custom post type name

It is easy to write code that will only return posts from a certain custom post type. However, I haven't been able to find a way to return posts that search for the actual name of the custom post ...
0
votes
1answer
18 views

Wordpress function only executes once

I am trying to create a redirect for my authors so that when they login (and access the admin area) they are directed to the posts page instead of the Wordpress dashboard. I found a function that ...
0
votes
0answers
22 views

Loop only displaying one post

After a WordPress update the following code started only displaying one post on the page. I thought something was deprecated so I updated the parts I was sure about. But I'm still getting pretty much ...
0
votes
0answers
6 views

My customizer's setting doesn't set to the default and needed to click the control's “Default” button before it'll be set

Here's my sample customizer's setting and control: $wp_customize->add_setting( 'themename_img', array( 'type' => 'theme_mod', 'default' => ...
0
votes
0answers
15 views

Using Isotope in WordPress portfolio

I'm trying to create a custom post type portfolio and use Isotope for filtering according to categories but I'm not doing something right. I've loaded scripts in my header.php, created a custom post ...
1
vote
1answer
74 views

expire wordpress user posts

I'm trying to make classified WordPress theme and I need to make users posts expire date plus show that date into the post. Users only allowed to publish their posts in post-types not as ordinary ...
0
votes
2answers
25 views

custom post with loading script per single post

I read many Q&As here on SO...(and elsewhere but they don't count...lol) I think I follow the rules of WP.org but still it does not load the scripts. Scenario: Custom template for post in Php: ...
0
votes
0answers
15 views

CSS not displaying

I found function for numbe pagination but when I trying to view the CSS thru Inspect element, the CSS for that pagination is not displaying. Even If I change the CSS style, its not working. How to ...
0
votes
1answer
15 views

getExcerpt: Make ellipsis appear only if character limit is reached

I have a function called getExcerpt that displays the first 140 characters of an excerpt and after that, an ellipsis appears. The call in my template is like this: <?php echo get_excerpt(140); ...
0
votes
0answers
6 views

Save the outputted image into the Media Library, with a different filename and extension

For example, I have this "/image.php" file in my "/theme-directory": header ('Content-Type: image/png'); $im = @imagecreatetruecolor(120, 20) or die('Cannot Initialize new GD image stream'); ...
0
votes
1answer
33 views

I am Looking to append URL Parameter to all URLs

I am trying to add URL parameter to all the URLs of Wordpress website. This is for tracking affiliate sales by tracking links. E.g. I have put a link on another website ...
0
votes
0answers
7 views

Custom Search Function adds Results to Navigation

I've added a custom search function on my site that allows terms of a custom taxonomy to be searched as well as the normal content. The function works just how it should, but when you get to the ...
0
votes
1answer
48 views

Adding javascript to functions.php causes problems with my template

I want a "Read on" link that moves to another part of the page when clicked. I understand the HTML bit and I have even used some nice scrolling. It works. But when implemented breaks part of my ...
1
vote
1answer
57 views

How to store the_title() into a variable to reutrn the value, not just echo it

I have a loop, and need to pass one more argument through it. I need to get the current page's single post title, and then use that as the value. I tried going about it like this: $tagz = ...
0
votes
0answers
15 views

Add Custom fields to Quick Edit posts2posts

i am using posts2posts to connect 2 post types,and add custom field for each relation (many to many). I am looking for Quick Edit Option, here is my function <?php p2p_register_connection_type( ...
1
vote
1answer
34 views

Add custom function to a theme with child theme's functions.php

I am using a theme Indigo and have it working fine, in a child theme configuration. I want to add a custom function. Unlike the child style.css, I have read that you don't need to import the parent ...
0
votes
0answers
16 views

How to block specific external link without plugin

I want to block www.anafile.com - this site, in my WordPress blog site. When any user use this link in any blog post, on clicking "Publish" button, I want to block them posting or warn them. How can ...
-2
votes
0answers
23 views

Condition based on membership [closed]

My website about buy a membership VIP,SLIVER and GOLD click here I want to put condition to choose only one of the 3 type membership how and where I put ?
0
votes
0answers
20 views

Default Terms in Custom Taxonomy for Custom Post Types

I am using the below code to automatically assign a custom taxonomy (my_tax_name under my_tax taxonomy) to a custom post type (my_cpt) so that when I publish a post without assigning it any taxonomy, ...
0
votes
1answer
42 views

Scrape external webpage for first image and add it to new post

I'm looking for a way to scrape an external page for its first/best/largest image and insert a copy of that image as the featured image of a new post on my Wordpress site. The way that I was hoping ...
1
vote
0answers
19 views

How to change permalink to include custom post type

Is there a way to add custom post type to permalinks with a plugin or otherwise? This is what I am trying to accomplish: mysite.com/projects/food/burgerking mysite.com/projects/wine/cherryvineyard ...
0
votes
0answers
26 views

Define an extra field for all pages (with no plugin?)

I usually use WP Types define custom fields, post types, ... But I have a theme a little bit overloaded of plugins, so I would like to define this field for (all) the pages in functions.php if ...
0
votes
1answer
14 views

Wp Ecommerce Reposition Product Page Product Thumbnail Image

i want to reposition the product thumbnail of the wp ecommerce plugin product page product images. the default thumbnail function of wp doesnt seem to work add_image_size( 'product-thumbnail', 225, ...
0
votes
1answer
22 views

Alternative functions for mysql_free_result and mysql_ping in wordpress functions

what are the alternative function for mysql_free_result and mysql_ping in WordPress functions , does WordPress function provides all the functions like php ? is it necessary to Free result memory for ...
1
vote
0answers
20 views

mysql_real_escape_string() vs. esc_sql() in WordPress

Does mysql_real_escape_string() and esc_sql() in WordPress both do the same work? I tried following the following: $fetch_row='<p>And again for single posts</p>' echo ...
0
votes
1answer
23 views

wp_delete_attachment

Im' trying to delete all attachments of a custom post type on post deletion using the before_delete_post hook. It works ok except that if I add another function to override the upload dir it doesn't ...
0
votes
0answers
18 views

Function to draw random image from specified category destroys site logic - why?

I'm trying to create a function in my child theme's functions.php file that will draw a linked image on every page. The link has to have a class, and the image must also have a class. The image is ...
0
votes
1answer
35 views

How do I register a new settings page? [closed]

I need to be able to create a new settings page, one that will act as a list of information for the user. However, I am unable to find how to do this, can someone point me in the right direction for ...
0
votes
0answers
3 views

Dynamically PHP-generated content and SEO [migrated]

So I'm using a function in my functions.php file to add some text to all my posts. I was wondering if that will be used by Google when they index my website, and how that will affect my SEO ratings. ...
0
votes
0answers
29 views

preg_replace to switch urls

I've searched everywhere here and I just can not find the right setup; I'm trying to take a url and replace it with a non functional url... for example; CURRENT HTML URL STRUCTURE <a ...
0
votes
0answers
22 views

Extract and amend variables from 'like' plugin and put into visual meter gauge plugin

I am trying to extract the total number of likes associated with different posts from the WTI Like Post Pro wordpress plugin, then subtract the number of unlikes and feed this total into a meter gauge ...
0
votes
1answer
42 views

content editor format style tags

This is the code I'm using to generate format styles for content editor: // Callback function to filter the MCE settings function my_mce_before_init_insert_formats( $init_array ) { // Define ...
0
votes
0answers
12 views

Adding custom post formatting options in custom post types

I've added custom post formatting options using the below code - function wpb_mce_buttons_2($buttons) { array_unshift($buttons, 'styleselect'); return $buttons; } add_filter('mce_buttons_2', ...
0
votes
1answer
46 views

Remove Header and Footer in iframe

Many people embed my website's pages in their websites as iframes. I want them to don't take my footer, header and a specific division in those iframes. Since, footer, header and mentioned specific ...
0
votes
1answer
15 views

It possible to implement an adhoc php web application with wordpress?

I need to implement a web app in php and I wonder if it would be a good solution to use wordpress or just do it with external php code my web app: Has some panels with forms for the users to fill, ...
0
votes
1answer
27 views

Issues with add_query_arg() not passing a variable

Im trying to pass a variable($homezip) to the URL on a new page using add_query_arg() but its not working for variables radius works fine. $homezip = $_POST["search"]; $stringzip = esc_url( ...
0
votes
1answer
48 views

Show only top 3 posts from 3 categories in order on home page

This function will show the last 3 posts from any category on front page: // Only top 3 posts from CHR category add_action('pre_get_posts', 'ad_filter_categories'); function ...
0
votes
0answers
17 views

Redirect to “pre-page”

I am using the Events Manager plugin to create bookings. The site currently functions like this: Page 1: Lists all events (clicking on an event takes user to booking page - Page 2) Page 2: ...
0
votes
0answers
23 views

Content Section Custom Anchor Not Working

I purchase WP theme (Techwise) and I found an issue with content menu sidebar in post page. that content not working as same (toc) Table of Content. it's not working with Arabic letters but working ...
1
vote
0answers
42 views

Pagination in relation to archive.php

A small problem here, I just don't know how to change this because I'm a self taught newbie. I made a child-theme from the simone-theme with a static front-page. To it I have the archive.php as the ...
0
votes
1answer
31 views

update_post_meta not working in function

I am attempting to take some custom field meta data (generated via the ACF plugin) and save it as post meta with a function. This is what I've come up with: function tps_create_slotcode($post_id) { ...
0
votes
0answers
22 views

Custom post type archive not displaying after site move from sub-directory

I have just moved a site from a sub-directory to the root of a domain. The move went reasonably well but I came up with two issues that have stumped me. The first which I have resolved was that one ...
0
votes
0answers
21 views

Functions.php in Child Theme error issues

I have been trying to update my functions.php file in my child theme and find this code in the file downloaded from the host. add_filter('https_ssl_verify', '__return_false'); ...
0
votes
0answers
14 views

Custom Taxonomy as Link

I have this image here http://i.imgur.com/5szTQNy.png which shows the download button I will be talking about. I am trying to make it so that when I put in a custom taxonomy box in the back end the ...
0
votes
1answer
23 views

How to get_template_directory() properly on local environment

I'm currently developing a site locally in MAMP PRO. When I use get_template_directory() inside of the standard functions.php file, the site path gets output correctly. However, I have a separate ...
0
votes
2answers
32 views

Custom function causes a 503 error after a couple of hours

I have a custom function written in PHP for a Wordspress theme. When I initially wrote it, it worked exactly as expected (it returns the parents and grandparents etc of a term from its ID). However, ...