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
2answers
391 views

Passing postid of Testimonial Custom Post in Shortcode Parameter

I am trying to create Testimonial custom post and display using shortcode function create_post_type() { register_post_type( 'testimonials',//new post type array( ...
1
vote
1answer
17 views

Define Function in functions.php or plugin and call in theme loop

I need to define a function in functions.php or a plugin and be able to call it inside the theme's loop & outside. Example; I have a $product_price = get_post_meta(get_the_ID(), 'product-price', ...
0
votes
0answers
25 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
1answer
12 views

Showing content from one page on another

There are many posts that seem to strike around this area, but I'm more and more confused by each one I read. I have a page that shows the "Terms of Service" (id = 1772). I would like to display the ...
0
votes
1answer
380 views

call wp_insert_user in custom class doesnt work

im creating a custom class to manage users in wordpress and chamilo but this is not the point. Class looks like this: class Platform { private $security_key = '..'; private $secret_key; ...
1
vote
2answers
598 views

Update user meta of author when post content is viewed

I have a value that I'm trying to store as user meta for authors on my site. I need it to update itself every time the content of a post is viewed for that author. Here's as far as I've gotten but it ...
0
votes
0answers
7 views

Get stock from another store for a WooCommerce store

I want a help! I am reseller of other stores, and as the store grows it becomes hard to manually update inventory. I have a custom field _url_font that I fill with product source address. I wanted ...
-1
votes
0answers
14 views

Is there a way that you can use 2 same wordpress plugin at the same time?

Is there a way that you can use 2 same wordpress plugin at the same time? like using 2 jetpacks or 2 any other plugins?
0
votes
1answer
449 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
-1
votes
0answers
26 views

How to add repeater field to option page?

I've created an options page for blog. In this options page, I can save some details about the website. using this code: add_action( 'admin_menu', 'site_add_admin_menu' ); function ...
0
votes
2answers
631 views

How to hook into the quick edit action?

I found this solution to automatically assign parent terms when a child term is selected, which is working fine for the save_post hook: add_action('save_post', 'assign_parent_terms'); function ...
2
votes
3answers
292 views

Implementing DNS Prefetching with WordPress

I'm not sure whether my question sounds promising or not but what I'm going to ask is very much relevant. So please read the full question before down voting or flag. I'm trying to implement DNS ...
0
votes
1answer
597 views

Session is not starting

I've read the usage of session() in WordPress from here and here. And I placed the following code into the very starting of my functions.php: /** * ENABLING SESSION TO THE SITE * Thanks: Shazzad ...
1
vote
1answer
740 views

Auto Populate Custom Field with Complex Value That Increase by One?

Can somebody help me to sort this? I am using WP 3.5.2 and I have "Orders" post type where purchase_order custom field is located. This is the sample of purchase order record: POCOS20130051 PO - ...
0
votes
0answers
19 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
2answers
208 views

Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS

I've been having trouble Automatically Compiling my .scss files into my main WordPress style.css file. I'm using Leafo's SCSSPHP script and trying to achieve a few things. i'm using Kirki ...
1
vote
1answer
31 views

How to override a plugin function wrapped in a class?

The class is from someone else's WP plugin and I want to adapt one of the functions from that class (there are more functions). The (edited) original code: class some_class { private function ...
0
votes
1answer
26 views

add a function code into a class name [on hold]

how can I hook or add action or add filter this code into the class name by using function code: function user_authorname_qv() { echo "<p class='qv_authorname'>"; echo get_the_author(); ...
1
vote
1answer
14 views

Where can i find wordpress auto update code flows?

I want to see how WordPress auto update works in code . which WordPress file or function performs auto core update? I have read http://halfelf.org/2011/how-the-wordpress-upgrade-works/ I have ...
0
votes
1answer
17 views

Automatically add tag if a checkbox is checked

I'm looking for a simple function to automatically add a specific tag to a post if a checkbox is checked. For example: When creating a post there is a checkbox that says: "Add example tag to post" ...
0
votes
0answers
6 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
9 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
1answer
17 views

How to style injected code in header section?

Trying to add custom code to header section <head>..</head>of the blog by adding this code to child-theme functions.php // Add scripts to wp_head() function child_theme_head_script() { ...
0
votes
1answer
136 views

Show custom default avatar instead of gravatar

I'm using this custom function to get the default avatar from my server instead of gravatar: if(!function_exists('custom_avatar')){ function custom_avatar($avatar_defaults){ ...
0
votes
0answers
5 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
1answer
16 views

Remove links from the_content when using filters wp_trim_excerpt

I'm using wp_trim_excerpt which is working perfectly but I want to strip the links contained in the the_excerpt (using get_the_content), I've looked online and tried many solutions to get the thing to ...
3
votes
2answers
3k views

What is the correct MIME type for PSD (Photoshop)

I am trying to create an upload area (frontend) for word press users on a site. I've got a lot of types opened up through some function calls, but unable to correctly get PSD support. I'm seeing a lot ...
1
vote
1answer
1k views

How to set the jpg image compression for specific thumbnail sizes?

This question was asked on Set JPEG compression for specific custom image sizes and answered very nicely by Ahmad M I'd of course comment to that thread but I don't have 50 point reputation... The ...
0
votes
1answer
641 views

How to echo Widget Title in Custom Frontend-Template Box

I've created a custom Widget with the help of following code: // Creating the widget class wpb_widget extends WP_Widget { function __construct() { parent::__construct( // Base ID of ...
0
votes
2answers
37 views

Database SQL Error, Should Work

I'm trying to get my posts to order by radius, and so far i'm struggling, I've been using the following tut by Steve MArks, http://biostall.com/performing-a-radial-search-with-wp_query-in-wordpress ...
0
votes
1answer
25 views

How to style options page in dashboard?

working with a child-theme, adding a custom options page to dashboard in which admin can save details about the site. Using this code in the child-theme functions.php to create the options page: ...
1
vote
1answer
28 views

creating shortcode to pull json array

Frankly - this may be a duplicate of another question I have out there. Sorry if it is. I'm learning this site and PHP/Wordpress development. I have partnerships with local sites that use JSON and ...
0
votes
1answer
38 views

Database Query not working

I've been following a tutorial by Steve Marks which goes throught adding information from posts to a new Database Table as well as the usual postmeta one. However no matter what I try, It will not ...
0
votes
0answers
25 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" ); ...
1
vote
2answers
29 views

Access Plugin data from Functions.php

I'm trying to insert data from a wordpress post into a new table database table rather than WP_postmeta. My function is working, It'll insert the $postid no problem at all. The issues I'm having is I ...
0
votes
0answers
20 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
1answer
2k views

Let users upload image(s) to the post from front end

I want to enable logged in users (Wordpress) to submit posts from front end (among with other data). My form is working great, I add custom post meta data which I later display on custom post page. ...
0
votes
1answer
20 views

How to use parent theme functions in child theme functions.php file?

Parent theme required a foo.php file, and inside that file is a baz() function. I want to use that baz() function in functions.php of the child theme without recall foo.php file again. Are there any ...
0
votes
0answers
13 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
14 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 ...
1
vote
1answer
596 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
3
votes
1answer
39 views

How to create a custom order status in woocommerce!

I've tried the below code to create custom status. add_action( 'init', function() { $term = get_term_by( 'name', 'shipped', 'shop_order_status' ); if ( ! $term ) { wp_insert_term( ...
0
votes
1answer
32 views

How to create “page” used for generating PDF? [closed]

I am new to wordpress but I do have some knowledge base in php. I am developing custom theme for my Wordpress site. I also have a PHP file which generates PDF file based on GET parameters and it's ...
0
votes
0answers
33 views

Woocomerce adding items to cart from a share cart url? [on hold]

I think I need help in here, Im not really sure if I need to set the session manually or it will set automatically while adding items to woocommerce cart, lets consider the following: ...
0
votes
1answer
19 views

Page not showing after add a function on child theme [on hold]

I am using Genesis framework and modern-studio-pro as a child theme. I have just copy this code function genesis_standard_loop() { //* Use old loop hook structure if not supporting HTML5 if ( ! ...
0
votes
2answers
8 views

use system script advertising in wordpress multisite

I have a little problem that I can not solve. I have a website "multi-site" system with ADS script. I wish I could enter leaderboard banner. This is an example script: <div id=""><script ...
1
vote
1answer
46 views

Display Password Protected external RSS in wordpress template

I am using the below code to show external rss feed in my wordpress blog page template: <?php include_once(ABSPATH . WPINC . '/rss.php'); $rss = ...
0
votes
2answers
23 views

Query for user roles

How do I query for a specific user role? if (is_user_logged_in() && user_role == "user") {} The part I'm unsure about is user_role. Is there a way I can ask WordPress to check for a ...
1
vote
2answers
235 views

Pass info from functions.php to plugin

What is the best way to pass some information from functions.php to a plugin? I need to give a user the ability to pass a piece of data from their functions.php file to my plugin. (It can be any ...
0
votes
0answers
7 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 ...