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

making a glossary with wordpress

I know that there are glossary plugins in the wordpress repository. This plugins normally searches glossary terms in post content and adds a link to it. But i have not found one, that search and ...
0
votes
0answers
402 views

Twenty Fourteen Customization: Link Post Formats

A solution for this issue for the previous default theme, Twenty Thirteen, was found by me here. It's perfect for what I'm trying to do: set my own desired URL as the link in the title, rather than ...
0
votes
0answers
28 views

Can anyone tell me why I can't edit a plugin when it is installed without having to re-install?

I am using a shortcode plugin as a framework for the short codes I want to add that go with my theme. I decided to just include the plugin in a repo for the user to dl so I am not building theme right ...
0
votes
0answers
134 views

WordPress Bones theme, changing default Excerpt amount of words

Been back and forth with this one and cannot find anything on the Themble site about this. I am trying to shorten the length of the_Excerpt from 55 words to 20. Have checked the codex and know what I ...
0
votes
0answers
25 views

Break a Wordpress function to run in patches and re-continue

I am new to PHP and coding and I am really not a coder but I try to modify and use existing codes. I have a function which I am trying to run when needed for all users within Wordpress to do an ...
0
votes
0answers
52 views

Calling information from my theme options page

I'm setting up a theme options page, I used it on a previous theme and thought i could easily just copy it over to the new one. <?php $options = get_option( 'sample_theme_options' ); ?> ...
0
votes
0answers
29 views

Add custom css to menu while using custom nav_menu_tag

I created a custom menu to replace my li with td markers. However, I need to be able to add some custom tags through the wordpress menu. How do I do so? Is there something I can add to my ...
0
votes
0answers
23 views

WP supersize not displaying when different languages flags are selected

I've got a very strange problem with this website. The background slides appear when your English flag but when its switched to The Spanish flag or Other flag the backgrounds don't appear. Link to ...
0
votes
0answers
38 views

How to escape shortcode content? Do I even need to escape or validate?

I've written a small shortcode that wraps it's content into a HTML element, like so: [my_shortcode]The sun is shining today.[/my_shortcode] In my shortcode function, I basically return the string ...
0
votes
0answers
67 views

restrict access to specific urls on a specific period of time

I have a countdown timer plugin which is set do redirect the user to a specific permalink after the time is elapsed. I've added a countdown timer here : mywebsite.com/mypost which is set to 3 days ...
0
votes
0answers
28 views

Using conditionals, maybe from a DB, to register & enqueue files, for varying pages, in functions.php

I wanted to include some javascript and css files on only some of my WordPress pages. To do this, I registered and enqueued the files in my child theme's functions.php file, and used conditionals to ...
0
votes
0answers
87 views

Use $_POST['value'] inside functions.php

Is it possible to use a value stored in POST on a page inside the functions.php file? First on the . after the "20" I want to add the category__in value to the query_vars. And thats where I want to ...
0
votes
0answers
48 views

Change conditional tag in wordpress without editing the core files

In wp-admin/includes/class-wp-posts-list-table.php lines 59-69: if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) { $exclude_states = get_post_stati( ...
0
votes
0answers
272 views

Email attachment not working using wp_mail function

I am trying to send email with attachment but, I am not getting any attachment but I am getting the email bellow is the function ,I have used in function.php and I am trying to attach a zip file fro ...
0
votes
0answers
43 views

Getting undefined index id error in theme

I am getting Notice: Undefined index: id on the line $id = $option['id'];in my wordpress theme adminfunctions.php file Can you please help. function of_option_setup(){ //Update EMPTY options ...
0
votes
0answers
124 views

Pass PHP variable between functions in functions.php

I have a WordPress Admin page where you can add a "listing". Within this Admin Page I have added many fields which transfer variables over to the listing page which is created/updated. Within this ...
0
votes
0answers
134 views

jQuery conflict on EDIT POST page - Getting blank White Screen

I have made a button to show up on ADD/EDIT POST page with onClick function to import values and insert to custom fields. My button/script looks like: <script type="text/javascript"> ...
0
votes
0answers
104 views

Insert image in custom row using woo-commerce plugin function

I am using the woo commerce plugin in bellow function ,I am trying insert one image which is stored in one session variable into the custom row woocommerce_order_items table File Name-> ...
0
votes
0answers
91 views

wp_enqueue & youtube API on different templates

I'm trying to use the youtube API on two of my template pages. Obviously I want to enqueue it correctly. When I put this code in my footer.php page, I got it to work: <script ...
0
votes
0answers
103 views

Function working in single.php but not working in custom template file

I defined in my functions.php the following code: function fix_footnotes($content){ return preg_replace('/href\s*=\s*"[^"]+(#[^"]+)"/','href="$1"', $content); } When I call this ...
0
votes
0answers
22 views

pagenavi issue on multi wordpress insall

Apologies in advance for my explanation of this problem. I've got one install of wordpress running several different websites. The actually problem is with the pagenavi function. It seems to work ...
0
votes
0answers
43 views

Disabling All in One Seo Pack plugin in functions.php does not work

Here is my code: function my_title($title) { global $aiosp; if ( defined('AIOSEOP_VERSION') ) { error_log( print_r( $aiosp, true) ); remove_action('wp_head',array($aiosp,'wp_head')); ...
0
votes
0answers
13 views

How to link 'Private page' to 'Login' button in login screen

I want to link a private page to the 'Login' button can any one guide me how to link this. Full description: 1) I opened my website 2) Click on 'login' link 3) A new screen opens with username & ...
0
votes
0answers
15 views

Insert retrieved image into another table?

I am retrieving one image from a table name "user_templates" after retrieving ,I have to insert that retrieved image into another table name "ca_woocommerce_order_items" but I am not able to insert ...
0
votes
0answers
29 views

Clean URLs with custom link in WP menu

I've read some articles on here and numerous through Google and I'm still struggling with clean urls. Basically I have a menu where I inserted a custom link which is ...
0
votes
0answers
46 views

Disable Override in WooCommerce

In my WP theme i've created a folder called "woocommerce" and inside that i put all file with my custom code, based on WooCommerce guidelines: template structure All work fine, but is possible to ...
0
votes
0answers
82 views

functions.php conditional output for a single plugin

hope I've asked this correctly. Bizarre situation. I have some non-breaking spaces in my titles for typography reasons. They are added automatically where required in place of normal spaces by the ...
0
votes
0answers
56 views

List all recent post by categories at the front page (WordPress MU)

I'm looking how can I put on the network homepage all recent post of my WPMU Network. I tried that script but there are not so much informations (I want the same presentation such as a normal post) : ...
0
votes
0answers
45 views

How to request login for user but not for bots

I wondering, how to not requesting bots like google crawler or bing crawlers to login since they can crawl my post info, but require user to login if they want to see the posts? I already know how to ...
0
votes
0answers
529 views

Custom password reset using AJAX

I used this (great) tuturial 'WordPress AJAX Login Without a Plugin – The Right Way' to make a custom login form and everything works fine. But I could need some help building the same functionality ...
0
votes
0answers
26 views

How to get a RestFUL URL for a function?

I have a basic custom function which accept GET/POST requests, and process them upon request. Just simply (Lets say GET now): function miccheck() { echo "Hello, Mic Check 123! ". ...
0
votes
0answers
43 views

Rewirte the theme URLs

I was trying to implement the rewrite system of Roots on my theme. I followed this tutorial. In my functions.php I put the following: include_once(THEME_LIB . '/rewrites.php'); And created the ...
0
votes
0answers
239 views

How to make woocommerce a private catalog

Are there any tutorials/functions/custom code that I could utilize to make my entire shop pages completely private to users? I need a private shopping experience for logged in users only. My client ...
0
votes
0answers
114 views

Call wp_create_user function from external?

I want to create New Users from external. I've found this is function in wordpress: wp_create_user( $username, $password, $email ); So how can i run this function from external call please? I ...
0
votes
0answers
106 views

All “Featured Images” not displaying after Wordpress update

After updating to the latest version of WordPress today, I noticed that all "Featured Images" on my website are no longer displaying. After trying to figure the problem out for hours, I added the ...
0
votes
0answers
38 views

Create user from external file

I have this little script for create user from page of template i use in wordpress template page : $user_name = "usertest"; $user_pass="123456"; $user_email="myemail@domain.com"; wp_create_user( ...
0
votes
0answers
49 views

WP Function still having effect after being deleted

I wanted to hide the add to cart buttons in Woocommerce so I created a custom plugin and added the following code to it: function remove_loop_button(){ remove_action( ...
0
votes
0answers
32 views

global vars in wordpress no works fine

I have 2 global vars defined inside funtions.php global $ruta_path; global $ruta_db; I want send the value of this global values to function in comments but no get works Inside comments.php i have ...
0
votes
0answers
102 views

Site is not updating because something is wrong with custom code. How to fix it?

I really didnt know what a proper title for this question could be. Anyways, I have this code in functions.php which is breaking my site function wp_show_post_views(){ global $post; $postid = ...
0
votes
0answers
49 views

using enqueue_script in a shortcode isn't working

I'm new to wordpress and I'm trying to get this to work by following the wordpress codex but I feel like I must be missing something obvious. I have a child theme based off of a parent one, and I ...
0
votes
0answers
241 views

Display default WordPress login/registration form into a modal window

hope someone can help me with this. I need to display the default WordPress login/registration into a modal window. I followed this tutorial in order to create the modal box and it is just exactly ...
0
votes
0answers
335 views

How to fix Warning: call_user_func_array()?

I modified my theme metabox.php to fit my needs, and I got this eror Blockquote Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'mytheme_add_box' not found or ...
0
votes
0answers
47 views

How to structure plugin in to functions?

So I have customized a few plugins before, but never developed one from scratch. One thing that I have struggled with is structuring my functions. I found the following snippet and wonder how YOU ...
0
votes
0answers
77 views

Adding result from PHP function into an input field

I have the following PHP code which is a template page for a wordpress site: <?php /* Template Name: Calculator Form */ get_header(); ?> <div id="content" class="grid_7 suffix_1 <?php ...
0
votes
0answers
158 views

Functions.php not working in 2013 Child Theme

I have created a child theme base on the new twentythirteen theme. I made a style.css file and put a few styles in it. I've selected the child theme and my css styles are working. No problem there. ...
0
votes
0answers
180 views

HTTP_HOST changing in functions.php

I have getting variable results from the $_SERVER['HTTP_HOST'] variable in the functions.php file of our child theme. Let me explain our setup and then I'll explain the issue. We are running WP ...
0
votes
0answers
58 views

Using array page name together with page id to deregister script

If I use this: if (is_page(array(blabla-test-page, 20726, 20720, 38881))) {wp_deregister_script( 'gdsr_script' ); } the blabla-test-page looks like it overrides different pages, even if certain ...
0
votes
0answers
173 views

Changing /author/ link to something else: what is a better way?

Is there a better way than this snippet I am using? function change_author_permalinks() { global $wp_rewrite; // Change the value of the author permalink base to whatever you want here ...
0
votes
0answers
193 views

Full size image option removing problem

I have removed the Full size image option from the media upload window see Code: function theme_t_wp_set_image_size_options( $sizes ){ $sizes = array( 'thumbnail' => 'Thumbnail', ...
0
votes
0answers
432 views

How to add a class name to the ancestor <li> of a post?

I've asked this question before with a different Question Title over at Stackoverflow. At that time, I was not yet aware that a function of the theme is adding a class name called current-menu-item. ...