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
10 views

video.js not enqueueing?

I'd really appreciate any light you folks could shed on this issue. I was tipped off by Firebug that the function 'videojs' is not defined, when it tried to run the block of script which links to the ...
0
votes
1answer
9 views

Add functionality to post editor

I can't find any documentation to add a functionality to the post editor. I've got this so far: http://www.wpbeginner.com/wp-tutorials/how-to-add-custom-styles-to-wordpress-visual-editor/ But I ...
0
votes
0answers
10 views

Call outside functions to within wordpress widgets class

Hi i'm created widget for show soundcloud clips, and i'm created a function in function.php file to create info link within widgets to show explain images to how get clip id in bootstrap modal style. ...
0
votes
0answers
13 views

Required file not loading when function fired with AJAX in functions.php

I'm calling a function within the functions.php with AJAX. A custom registration form and page uses AJAX to post to the registration function. An include outside the registration function at the top ...
-2
votes
0answers
21 views

how to use wordpress-as-a-pay-for-access-system [on hold]

can anyone explain on how to use this code? http://www.yasyf.com/coding/using-wordpress-as-a-pay-for-access-system/ Thankyou
0
votes
1answer
20 views

Update add_image_size

This has been asked before, but the answer is from three years ago and is not working for me, so I'm wondering if something fundamental has changed since then, or if I'm fundamentally misunderstanding ...
0
votes
0answers
21 views

restrict content in product category in woocommerce

how can I restrict the product category in woocommerce. Most of the restriction plugin were in page, but in product category, there is no page for that. If I just the woocommerce shortcode ...
0
votes
1answer
19 views

same user role or copy the user role to be same as the other role

how do you make the user role "contributor" to be same as the user role "seller" by using functions.php I've tried user role editor, but it seems to be the dokan multivendor plugin has set only into ...
0
votes
0answers
20 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
19 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
23 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
21 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
80 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
26 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
7 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
34 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
51 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
64 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
17 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
41 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
17 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 ...
0
votes
0answers
23 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
24 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
24 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
20 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
31 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
52 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
54 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
24 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
43 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
32 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) { ...