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

Pagination not displaying

I'm using HTML5Blank theme to edit my own theme on clean basis, and trying to set the pagination but it's not displaying for some reason, and I cant find out why. Index.php calls loop then pagination ...
0
votes
0answers
35 views

Call attributes from shortcode function to a JavaScript function?

How do I call attributes from shortcode function to a JavaScript function? extract(shortcode_atts( array( 'xyz' => '' ), $atts )); I want to call xyz's value in ...
0
votes
0answers
28 views

Add action after function defined in plugin

I'm trying to write my second ever plugin (my first was a derivative of Hello Dolly) and I have a function that does something, however my issue is that I don't know what action to use to call my ...
0
votes
0answers
102 views

Custom taxonomy not refreshing page on add

I have created a custom taxonomy for use with WP Job Manager. The taxonomy shows up, however when I type in my tag and click the "add new job title" button nothing seems to happen. If I click refresh ...
0
votes
0answers
25 views

How to let users “follow/subscribe” tags (part is working)

I've searched for this for a looong time; My users should be able to follow/subscribe a tag than on a second front page, they only get posts from the subscribed tags. In the following example, in the ...
0
votes
0answers
109 views

500 error even after restoring to a working functions.php

While changing the functions.php file to edit who can see the wordpress toolbar I managed to return a server 500 error after the page as updating. I've since restored my backup of the previously ...
0
votes
0answers
36 views

Add Title Field To User Profile Page

Looking to add a title field to user profile which is shown above First Name field. I can add custom fields using this code but I can't figure out how to change the position of the title field to ...
0
votes
0answers
44 views

is_page_template wont allow me to enqueue scripts

I want to load specific javascript files onto any page that uses the template hello-world.php below is the code that I have used to target the page, register and enqueue scripts. But for some unknown ...
0
votes
0answers
28 views

Is it necessary to add function.php into index.php

i am new to wordpress.. I want to add 3 different js files in index.php for this ..i have following code function.php <?php function addjs() { $dir = get_template_directory_uri(); ...
0
votes
0answers
18 views

Isolate Sub-Category from Top Category in WooCommerce Cart (Exclude others)

This is my first post to SOWD. I have the following function that adds custom fields for a given product category if present in the cart - in the example below, the product_cat is 123, which is a ...
0
votes
0answers
27 views

Simple modification for menu structure

I'm trying to make a menu for my website, but I want it to be easily modified through original WP menu(dashboard > appearance > menus). I want to add some small thing to the structure of my menu, ...
0
votes
0answers
32 views

Why isn't my plugin seeing other classes?

I've written some very simple code based off of this tutorial by Harish Chouhan on the Plugins API: /** Add Plugins API if not already existing */ if ( ! function_exists( 'plugins_api' ) ) ...
0
votes
0answers
37 views

How to retrieve value from Gravity Forms input and put it in template?

I'm trying to retrieve and input from my Gravity Forms form and put it into a template file. I know I have to use gform_after_submission but I am not sure what I am doing. This is what I have so far: ...
0
votes
0answers
35 views

Display post_meta-by_key on product catalogue

I'm trying to display a custom field in my woocommerce bookshop catalogue. I have added the field "author" and I want to display it after the product title, and before the price. ...
0
votes
0answers
64 views

Include ACF field in other plugin option page

I'm using Advanced Custom Plugin. I can get the field's output via export option. My field like this: if(function_exists("register_field_group")) { register_field_group(array ( 'id' => ...
0
votes
0answers
14 views

How to get all the posts to a image (media)?

I would like to fetch all the posts in which a particular image is used. Lets say image_xya.jpg is attached in following articles- Article 1 Article 2 Article 3 Now I would like to display all ...
0
votes
0answers
19 views

Need some Tweak my nextpage Function

How I can get the next post URL when I'm on the last page ? e.g. I want go to the nextpost when i'm on the last page... This code need some tweak... Here is my Function: function next_page( $i ) { ...
0
votes
0answers
31 views

Login with user in custom created table

I was trying to add more features in login page, that i created a extra "myusers" table and trying to add two tabs in login screen,with the second tab i want login using my created users in 'myusers' ...
0
votes
0answers
15 views

How do I display continuous loop of multiple (4) previous adjacent posts while viewing the current post

I found a great article that enables me to display previous 4 adjacent posts here: Getting the Next and Previous Posts Titles in the Sidebar? @sorich87's explanation works great for me on my website. ...
0
votes
0answers
30 views

wp_delete_comment is doing nothing

I'm using front page delete links for users to delete their own posts and comments. The links are generated on the page like this : <a href="#" data-id="<?php the_ID() ?>" ...
0
votes
0answers
202 views

Image rotation issue (horizontal picture uploading as vertical) — Exif issue?

I am building a classifieds site on WordPress where users can upload their ads/images from front-end. However, when horizontal pictures are uploaded, they upload as vertical. I looked into the issue ...
0
votes
0answers
24 views

weird redirect from Movable Type installation

I'm helping a friend moving his blog from MT to wordpress, in order to do so I have created a truth table on the database (rosetta) by looking at all the old static files and I've created a relation ...
0
votes
0answers
186 views

WooCommerce order bulk edit with custom hooks in function.php

I'm working on a Wordpress site with WooCommerce. I have to implement some additional functions, one of them is some simple operation after marking the order completed. I use ...
0
votes
0answers
17 views

Intercept an image before it's uploaded to Media Library

I've got a WordPress website where I need to have some posts with gifs as thumbnails. After researching this topic a bit I realized that I have to intercept the gif before it's passed into Media ...
0
votes
0answers
56 views

How to wrap all elements in a div inside a post

How to wrap all elements in a div inside a post? eg <p>...</p> <h1>...</h1> <img> turns to <div class="para"><p>...</p></div> <div ...
0
votes
0answers
31 views

Follow author on muti-user WordPress site

How to add follow author function on muti-user based WordPress site? I fount this page but couldn't get it to work or understand how he got this working. Making Wordpress author follow button, need ...
0
votes
0answers
89 views

Override Wordpress Timber Template locations for Woocommerce

I need to overwrite the page template locations for Woocommerce using timber Wordpress. To change the location for the twig files was no problem. All page Templates are stored in the theme root ...
0
votes
0answers
47 views

wp_enqueue_scripts - force .js file to be last included file after plugin js files

I need to include a custom jquery script and need this to run after everything else. I have included it using the following code in the functions.php file: function add_custom_scripts() { ...
0
votes
0answers
27 views

Customize theme, woocomerce registration, What hooks to use?

I'm using this theme http://wp.contempographicdesign.com/wp_automotive_2/ for a project and now the clients want more specific changes 1.- The user needs to have a subscription plan in order to post ...
0
votes
0answers
63 views

WordPress registration: checking external database to see if name/email exists, then show error message

During registration (creating a new user account), in addition to checking the wordpress database, to see if user name or email already exist, I want to also check an external database. My code ...
0
votes
0answers
78 views

Is it OK to include files using ABSPATH?

I was using the following: get_home_path(); in my functions.php as referenced in the docs – but I get the error: Call to undefined function get_home_path() in ... I'd like to include a file using ...
0
votes
0answers
61 views

Author info does not show up when author has no posts

When author has no posts, it does not display author name or bio (below code). I tried http://codex.wordpress.org/Author_Templates#Custom_Author_Information but it give me Notice: Trying to get ...
0
votes
0answers
80 views

How to create a function to redirect a specified page to another page

Issue: I have a custom theme and can, of course, code pages for categories (assigned by creating a page with the name and assigning it the custom page -- eg, Create page "pine trees" and assign it ...
0
votes
0answers
20 views

Why is wp_set_comment_status not firing and executing my function?

I would like to send an email to all users on a WordPress blog that are registered and have a specific user custom field set. This email should be sent whenever a new comment is published. Here is ...
0
votes
0answers
77 views

How to output a PHP file values by shortcode?

I'm trying to output the values of two custom fields created by ACF plugin in a custom post type. I actually need this to be displayed in a popup window. wordpress popup plugins don't support php ...
0
votes
0answers
38 views

Angular disable the input submit tag

I've imported AngularJs in Wordpress into the header.php file <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js" type="text/javascript"></script> ...
0
votes
0answers
33 views

Add “custom post type” select in quickdraft (dashboard)

I'd like to modify the quickdraft in the dashboard of the admin panel. So I copied the relative function wp_dashboard_quick_press(), pasted in my functions.php and renamed the function. I added the ...
0
votes
0answers
130 views

Adding a meta box fields to child theme options page

I created a custom options page for may theme using this code: add_action( 'admin_menu', 'jrl_add_admin_menu' ); function jrl_add_admin_menu() { add_menu_page('Options', 'Options', ...
0
votes
0answers
81 views

Replace TinyMCE with Custom Built Editor

I am looking to build a custom wiziwig, and replace wordpress's TinyMCE all together. I figured out how to add to the TinyMCE editor, but thats not what im looking for. Does anyone have any references ...
0
votes
0answers
79 views

Rewrite rules lead to blank page

Using a child theme, with custom post type article, trying to call a file from functions folder inside the child theme main folder (child-theme/functions), using this code in the child theme ...
0
votes
0answers
70 views

How to wp_enqueue_script with html?

I want to wp_enqueue_script multiple javascript with html and css. I place the html code in a page, but it's not working on my side. Only plain text is displayed. Here's the link: ...
0
votes
0answers
13 views

How to override class of theme in child theme aka get google latin ext fonts

I have bougth a premium theme at ThemeForest but nobody has answered to my question - they are using Google fonts in the theme, but unfortunately, without latin extended characters and I have no clue ...
0
votes
0answers
10 views

How do you get all the posts and generate a table automatically in page?

I am trying to make a page with all the interesting posts(tagged with "interesting") and make a searchable table using TablePress. First of all, is this possible? If so, 1) what is a function in ...
0
votes
0answers
46 views

Convert NOBLOGREDIRECT to use 301 instead of 302

Does anyone knows any process to convert the NOBLOGREDIRECT 302 conversion to 301 for WP MU sites? When you define the NOBLOGREDIRECT value to some url, it uses 302 to redirect to that url. I want it ...
0
votes
0answers
37 views

Is there a hack for using is_page() within the function.php file?

I've created a function in my functions.php that's called when the submit_form event is fired on the front-end. Here is the code: add_action( "wp_ajax_nopriv_submit_form", "submit_my_form" ); ...
0
votes
0answers
29 views

Problem creating menu shortcodes

I'm trying to setup three shortcodes, each to display its own unique menu block. Just two are shown in the code below because I ran into an issue. The problem I am having is that both [footera] and ...
0
votes
0answers
23 views

Empty categories not showing up with custom function

I'm working on a WordPress based website, and I have three levels of categories. Something like: Category 1 Child 1-1 Grandchild 1-1 Grandchild 1-2 Grandchild 1-3 Child 1-2 ...
0
votes
0answers
17 views

Manipulating DevBuddy Twitter plugin

I'd like to manipulate the DevBuddy Twitter plugin, to change the order of divs inside .tweet_content. I would like .tweet_media to come before .tweet_profile_img for the sake of my layout. I had ...
0
votes
0answers
13 views

Only show loged-in user's post on WP Calander

WP default, the calendar shows links on the dates have post through out the entire site. I want to make it only show the ones from the logged in users. I'm hacking general-template.php to do that now ...
0
votes
0answers
58 views

How to update post meta in schedule event action-function?

I want to execute something like this. What I must to change in following code? wp_schedule_event( time(), 'hourly', $string); add_action($string, 'do_this_hourly'); function do_this_hourly() { ...