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
1answer
16 views

WP Theme Development, Adding Content Areas to Custom Page Template

I am not sure how to ask this, which is why I have been having trouble finding anything via google searches. I am hoping someone here will understand what I am looking for and be able to direct me to ...
-2
votes
0answers
9 views

Metabox from Video Thumbnail plugin in Front End Post Submission Form

I'm trying to get metabox from Video Thumbnail plugin to my Front End Submission Form. The reason of it, is that the plugin doesn't save the thumbnail from custom field. I was looking for the answer ...
0
votes
1answer
392 views

Custom registration form in shortcode getting internal server error 500

I created a custom registration form which works fine when used as a custom page template. I needed it as a shortcode so I created a shortcode using the function below /* Custom shortcode */ function ...
1
vote
1answer
830 views

Polylang: pll_e() & pll__() on functions.php, doesn't work

I've on functions.php some functions that echoes blocks of HTML. Problem comes with Polylang plugin, that uses custom functions pll_e() and pll__(). Those works right on index.php on every theme, but ...
0
votes
0answers
17 views

Backstretch.js and thumbnail sizes to reduce loading time

I am using backstretch.js to set a featured image as a full size background image I would like to combine this approach with different thumbnail sizes in order to reduce loading time on mobile ...
0
votes
1answer
37 views

Allow the access over wp-login.php

I created a maintenace template, and redirected to the folder where it is located via the functions.php file inside the theme folder; this is the code: function maintenance_redirect(){ if( ...
0
votes
1answer
28 views

Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?

I'm building a simple post order "plugin" through my theme's functions.php. The function updates the value of an option in options.php on submission of a form. So, for instance, when "1" is inputted ...
0
votes
1answer
90 views

Posts to expire (deleted) after a date

I am creating a coupon site from scratch. I have reviewed many code examples on the Internet, but have not found anything that will work, as my requirements are little different. I need help in ...
2
votes
1answer
307 views

Changing post category from dropdown

I am showing a list of posts on the front of my wordpress site which each have a dropdown next to them with a list of category's, which are pulled in as follows. As you can see the form submit button ...
0
votes
1answer
13 views

Automatically Populate Post Taxonomy Data Based on Post Author Meta Data?

I'm trying to use author meta data to automatically populate a custom taxonomy on a given author's post(s). Currently, the taxonomy is visible on the post page, but I intend on hiding it from the ...
-1
votes
0answers
8 views

live preview. help [on hold]

i whant to make website like that: http://themeforest.net/category/wordpress/blog-magazine i made and i dont know how to upload other demo themes for live preview, like that: ...
0
votes
2answers
35 views

Function to pull data from user meta not working

So I am attempting to create a series of functions that calculate a price based on a client level I have set for each customer. Some customers may have a special deal. To do this, I created a custom ...
0
votes
0answers
22 views

Rename filename to post title. Post Title not being fetched

function new_filename($filename, $filename_raw) { global $post; $post = add_post_meta( $post_id, wp_get_attachment_url($attachment_id)); $info = pathinfo($filename); $ext = ...
-2
votes
0answers
19 views

idea about managing cashback site on wordpress [on hold]

i want to know how can i manage a cash back site on WordPress. i am already doing user tracking , so i know which user purchase. i do get CSV from my Affiliate network. So i just want to know how ...
0
votes
1answer
18 views

Fill empty custom field with other custom field

i have a product listing website, all products are uploaded from csv. i have a two custom field named "old_price" and "new_price". Sometimes there is no discount (new_price) , so the field be empty. ...
0
votes
1answer
17 views

Copy and delete a directory with WordPress functions

I have successfully used copy_dir() to copy a directory to a new location. How can I delete a directory using WordPress functions?
5
votes
4answers
2k views

Removing Metabox for “Slug” without removing functionality

Here is an interesting question. I have recently noticed that if you utilize the code remove_meta_box('slugdiv', 'post', 'normal'); you are actually unable to modify the slug when you click on ...
2
votes
2answers
285 views

Dynamically add id to heading tags

How do I add an id attribute dynamically to every heading tag on a wordpress website using php? I wanted to make it so that for every heading tag (h1, h2, h3, h4, h5, h6) I have a unique id attached ...
0
votes
1answer
11 views

Force changing the Site Title and add link

I have the function below, but it's not actually changing the site title where it is called in my theme. function blog_filter($string, $show) { if ( $show == "name" ) { $string = ...
0
votes
0answers
22 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 ...
1
vote
2answers
33 views

How to add a rel attribute to images that contains their categories?

I've added categories to images, so that I can use them to filter images within a portfolio page. Now I'm thinking I need to add the rel attribute to each image that contains its assigned categories. ...
0
votes
1answer
19 views

Is it possible to be more page/post specific with admin_enqueue_script?

I am using this code to load a stylesheet in the admin, but only on post.php related pages: function my_enqueue_for_post_pages_only($hook) { if( 'post.php' != $hook ) return; ...
0
votes
2answers
245 views

Get the alt text of the image in a array

I have a php code. That put the thumbs on the screen. I have this: <?php if (has_post_thumbnail()) : ?> <div class="image"> <?php $attachment_id = get_post_thumbnail_id(); ...
0
votes
1answer
20 views

Simple/basic use of get_current_screen

I would like to load a stylesheet on only 3 admin pages: post.php?post=7&action=edit post.php?post=10&action=edit post.php?post=18&action=edit I was trying with admin_enqueue_script ...
0
votes
3answers
29 views

Include files in child themes, declare in functions.php

I'm using a child theme. I want to make a change to a file which currently resides in: mybasetheme>includes>sf-content-display>sf-post-layouts.php So I copied the exact same file structure into ...
0
votes
1answer
18 views

Meta Box value not been pulled in

Here is the code that creates my metabox on my CPT named clients it displays fine and seems to keep the value input upon clicking update. The problem is with displaying the value saved within the ...
1
vote
1answer
532 views

Only let plugin add actions to wp_head & wp_footer on single posts

I'm using a a plugin (Comments Evolved) on a recently built site. The issue I'm having is that this plugin globally enqueueing and adding actions to the head and footer of all pages. I'd like to ...
0
votes
1answer
9 views

How to Add Image to Wordpress RSS-Feed with no Plug-in?

I have searched for adding featuring image to rss feed with no plug-in for WordPress. I have found some examples and applied how it was instructed. But All I have got now is nothing. Still can't ...
0
votes
0answers
23 views

How to add submenu to Wordpress plugin in the same Directory of main Plugin?

I have created a plugin and now i want to add a third party plugin inside of the Main Plugin menu, so it can be submenu. How do you make the second plugin appear? Directory Setup: ...
0
votes
1answer
66 views

Redirect to post after publish or update a published post

How can I get the permalink of a post from functions.php in my theme? I know this code: get_permalink($post->ID); but this produces something like this: mydomain.com/index.php?p=123 and I ...
2
votes
1answer
476 views

Display Total Number of Social Shares

I have to display the total number of social shares, like mashable does in it´s website. It´s not a problem, I found a php code that does the job. function getTotalShares($atts) { ...
1
vote
1answer
291 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 ...
0
votes
0answers
6 views

How to call a FB function from an admin bar action?

I am using FaceBook's SDK inside of my wordpress application. I need to set up the application so when a user clicks log-out on the admin bar, it will fire facebook's log-out function. in order to ...
3
votes
1answer
37 views

Autogenerate wordpress shortcodes using array?

I was create a shortcode which automatically generate shortcodes with given array key and value. Function names does not generate dynamically. Note: Array KEY = ShortcodeName and Value = Wordpress ...
0
votes
1answer
25 views

Redefine function arguments before rendering

How to change args values before function output (filter default values before call) wp_function($arg1,$arg2 = false){code} change to wp_function($arg1,$arg2 = true){code} without php runkit!
0
votes
1answer
27 views

Add a class to post if it has been recently updated

I'm trying to add 'updated recently' after the post title. I've discovered some code which works but because of plugins and some theme coding it affects numerous instances of the_title that it ...
2
votes
1answer
4k views

Using wp_get_nav_menu_items() to list children of children pages

I'm working with a Genesis Based Theme and I'd like build a Page/ Child Page menu structure. That part I can do with the help of some code produced by Bill Erickson. Essentially what I'm trying to do ...
0
votes
1answer
14 views

Return link pages instead of displaying them

Is there any WP function to return the pages links instead of displaying them with wp_link_pages()?
1
vote
2answers
313 views

Custom gallery in wp3.5

I used a tutorial I found for a slick little custom gallery in 3.4, but upon upgrade to 3.5 it no longer works. I'm trying to learn php still and can't seem to get this working again, as I either get ...
0
votes
0answers
18 views

Working widget does not show up in appearance->widgets

I try to add a custom widget for use outside of a normal sidebar. For that I have created class myfirst which extends WP_Widget and with appropriate function overrides. namespace widget; class ...
1
vote
0answers
35 views

Multiple Loops Meta Data

I am now trying to figure out how to create the functions/ loops to pull my data from custom post types. I have two post types(keys): And I need to pull the data from both to run my functions. ...
1
vote
1answer
861 views

edit role display name and label name without plugins

I'am creating WordPress function for editing role name function change_role_name($role_name, $new_role_name, $display_name) { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles ...
0
votes
0answers
9 views

Automatically create featured image on post publish

I know how to make an image display IN PLACE OF a featured image if the post has no featured image, however, as far as the database is concerned, the post still has no featured image. In my theme, ...
1
vote
0answers
31 views

How to remove custom post type and add category and post name

I have a custom post type called listing and taxonomy for this listing is called listing_cat. At the moment my wordpress permalinks appear in this format ...
0
votes
2answers
40 views

deregister scripts on certain page

i need to exclude certain scripts from running on a certain page. i have tried this code but it's not working - when i inspect the page the scripts are still being loaded into the footer of my page. ...
1
vote
4answers
73 views

jquery won't load in footer

I wanted to move jquery to the site's footer, but that doesn't work. I've tried it with the following code. As you can see, I have a couple of another scripts and they load correctly on the footer. ...
0
votes
0answers
22 views

Custom frontend post not working?

Hi I am creating a custom post front end submission. This is my code to submit the custom post details. Here the validation is not working as well as it will not submit the post. When i submit the ...
7
votes
2answers
179 views

Displaying the number of updates available in the Admin area

I am having an issue finding out how to display the number of plugins/updates available to call somewhere else other than the admin header. I found the function wp_get_update_data should be what I ...
0
votes
0answers
32 views

Problem loading wordpress functions outside of wordpress

I´ve just finished setting up my first ever website and blog, so please be gentle ;) . I am having a problem using some functions outside my wordpress installation (blog.example.com). To be ...
0
votes
0answers
26 views

Wordpress Wp_nav_menu How to create Columns in submenu

i have been trying to develop custom navigation in wordpress. i want to add columns in sub menu item. i want to add images in navigation as well as create Multi column Navigation. Please check this ...