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)

2
votes
1answer
191 views

WooCommerce product search titles only

I had asked this earlier and solved it using the Relevanssi plugin, however that plugin is now breaking things so I can't use it anymore. How is something so freaking simple made so impossible by ...
2
votes
1answer
292 views

Gravity Forms field entries into wp_query loop

I have a simple function that filters the page content when form (ID 18) is submitted. It simply displays the entry of field (ID 13)... add_action("gform_after_submission_18", "set_post_content", 10, ...
2
votes
1answer
90 views

How can I list random authors from current post category?

The following lists authors of the current category. But I want this to be a list of 6 random authors from current post category. foreach((get_the_category()) as $category) { $postcat= ...
2
votes
1answer
3k 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 ...
1
vote
1answer
17 views

How to get correct URLs in network wide menu (Multisite)?

I'm using this function to switch to my main website's navigation and display it on all sub sites in my multisite network. Ideally the links should have the following format: ...
1
vote
1answer
76 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 ...
1
vote
1answer
120 views

Function to auto-set a featured image that is already in use

I don't even know where to start with figuring this out.... This function for functions.php grabs the first attached image in a post and sets it as the featured image. The problem is that it will not ...
1
vote
1answer
173 views

Remote upload file to server B

I'm aware this might be some of the hardest coding to do ever, but thought of giving it a try. Im basically trying to detect all (mp3) filetypes uploaded through the Wordpress media upload and send ...
1
vote
1answer
44 views

PHP mixed with some JS code to update Wordpress theme settings

I am working on my first Wordpress Theme but I am facing a little problem in my code. In fact, I have created a little page in the administration to change some settings on my theme and, for example, ...
1
vote
1answer
459 views

How can I customize wp_footer, where is the code that controls what this function does?

I am using Wordpress 2013 theme as a starting point for a new theme from scratch. Under my themes folder, my footer.php theme looks like this. (Notice the final functionwp_footer(). ...
1
vote
1answer
35 views

Where to add the permalink in this function?

Below is a function that displays the latest 4 approved comments on my homepage, I wrote this almost a year ago, and for the life of me, it's gone completely from my head, All i want to do is add a ...
0
votes
0answers
155 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
169 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
223 views

Variable Posts per Page function plus pagination not working

I use the Reverie theme as a framework for my sites and I'm having an issue with using a function to create variable posts per page plus having the arrows for the paging to work. I used the variable ...
0
votes
0answers
168 views

Add password validation to contact form 7

I would like to add custom post type loop to the functions.php. I've created PHP function to validate contact form (contact form 7). My function is simple, but it doesn't solve my problem. My custom ...
0
votes
0answers
343 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. ...
0
votes
0answers
29 views

How to combine Custom Post Type Pagination with $selected_id?

I have a Videos CPT, everything is set up nicely, but I wanted to add pagination. Loop begins here// $args = array( 'post_type' => 'videos', 'posts_per_page' => 10 ...
0
votes
0answers
44 views

syntax error unexpected '}' at 364 line

I am getting this error on my website and am not able to access admin dashboard. The error occurs when I am a new theme on my website. Can you please help me to find this error. Parse error: ...
0
votes
0answers
44 views

get_post_meta no longer working

I am trying to use get_post_meta to return a value from the post meta, it was working completely fine then suddenly stopped working. I've tried and checked everything and i cannot seem to get it ...
0
votes
0answers
46 views

Highlight posts currently being edited on multiple editor site?

I have a custom page that uses the Cleverness To-Do List plugin to display multiple posts on a page. My site has multiple editors, and if a post is currently being edited on the custom page (not the ...
0
votes
0answers
68 views

How to delete in the pages the pre tag added automatically by Wordpress

i have been looking around but there is not a specific answer to my issue. I have set up a slideshow by Wordpress, then i paste the short code in the page where i want to display. The slideshow is ...
0
votes
0answers
78 views

featured post show in category base

i have 2 featured post in 1 div id, 1 big class and 1 small class . i want big featured div are post in category base.. big featured post code show in below. <div class="main_feat"> ...
0
votes
0answers
22 views

New theme crashing site

I have recently recreated a theme on our site. I took the old theme as a base and started messing around and trying to be more efficient with our code and what it was doing. And it all seemed to ...
0
votes
0answers
29 views

Problem outputing my theme options

If you take a look at my code you can see I've tried outputing the options stored within the settings fields and sections I've created. Its my first time developing a theme-options page of this ...
0
votes
0answers
186 views

Get User Login Data (date, time… )

I did my best looking for information about this subject. Your guidance is appreciated. My goal is to perform some actions based on the number of user logins on my website per month and login days ...
0
votes
0answers
162 views

Can't preview custom post - Redirected to home page

When I click on preview in custom post types I get redirected to home page. But when I visit or view the page that have all the Custom posts in I can see all of them. I cant figure out what or why. ...
0
votes
0answers
55 views

Extended image control not showing up in theme customizer

I have an extended image control for the theme customizer that adds in an extra panel and lists images I have hardcoded into the extended control. Now the issue is that it is not showing up in the ...
0
votes
0answers
69 views

How to get dynamic data in page hierarchy?

I'm trying to mimic the page hierarchy rules of WP. I'm checking for the existence of certain files, then requiring them if they exist -- in the same order as I understand the hierarchy rules. Here's ...
0
votes
0answers
51 views

How to utilize theme customizer live preview in this situation?

Short version: I am using the theme customizer in my theme and javascript for the live preview. I am not sure how to implement the javascript for php(as seen in code excerpt). I am creating a theme ...
0
votes
0answers
62 views

WordPress Popularity Score relative to all posts (score views, shares and comments)

I am trying to find a solution to score my posts in an effort to visually represent how "hot" they are, relative to other posts, or relative to a score of 1. I have views, total shares and comments ...
0
votes
0answers
40 views

Run function from parent on child site

I'm running a Multisite WordPress installation and have a couple of child sites. I'm trying to run a script from the main page on one of the child sites. It can be a shortcode [pro_display_zone ...
0
votes
0answers
129 views

How to Display Sequential Post Number Count

I know this has been answered at least a couple of times already and there is an answer out there from alchymyth2010 but I am looking for a different solution if possible because I have a fairly big ...
0
votes
0answers
55 views

URL build query

I have the following that builds a list of custom taxonomy(location) terms on the archive page for a custom post type. My issue is that when it builds the URL it is picking up the last post as part of ...
0
votes
0answers
80 views

How to disable controls in theme customizer?

Edit: I have rewritten the question in hopes I will get a reply from someone who knows the theme customizer. I am trying to figure out how to disable setting controls in the Wordpress theme ...
0
votes
0answers
171 views

How to add X number of products to woocommerce cart at once

I am trying to add x number of products input and button to my catalog page so I can select a number, then hit add to cart. Is it possible to add in this function? The user will provide a number ...
0
votes
0answers
49 views

Wordpress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache

I have been working on a theme for a few days and when I realized my JS file for my theme customizer wasn't updating I decided to clear the cookies and cache, and wow that was problematic. As soon as ...
0
votes
0answers
21 views

If user removes section with theme customizer I want it to add padding to footer

I added the ability to the theme customizer for the user to remove a section that is above the footer. The issue is when the section is removed it is causing the links in my footer to move up. How ...
0
votes
0answers
69 views

Problem with function not executing

I am sorry for the long post but I wanted to be thourough in hopes someone could help me figure out this issue. I have been trying to get it working for 2 days with no such luck. I would appreciate ...
0
votes
0answers
95 views

User driven content problems

I am trying to build a website that will allow users to post from the front end. I need to be able to have the user enter a title, a category, and tags. For the content of the post, I would ideally ...
0
votes
0answers
94 views

How do I link a button I created in theme customizer to a function?

I created a button in the theme customizer and I want to use it to execute a function? All I can find is using controls to add theme settings such as CSS and text. Although this button is to clear out ...
0
votes
0answers
95 views

Created custom control from theme customizer, where should I add code it will control?

I have created a custom control for the theme customizer which is a simple button and label. I am going to be using it as a theme reset button that will clear the theme mod settings to their original ...
0
votes
0answers
71 views

Press this! not working

I am trying to debug a Press this function on a site {Adult Contents} This issue is, images on the page does not add up and does not show... javascript code for press this button is javascript:var ...
0
votes
0answers
56 views

Wordpress adding in site URL to header links

A little information: I am developing a one page theme that uses posts as sections on the main page. I have created code that allows users to add a menu item in the post page from a meta box when they ...
0
votes
0answers
149 views

How can I clear the theme mod settings?

Ideally I am looking to add a button to the theme customizer that allows the theme to reset to default settings, although that may be asking for too much in one question so I am wonder if anyone knows ...
0
votes
0answers
130 views

Cant get theme to change footer color through theme customizer

I am having an issue trying to configure the theme I am working on to allow the footer color to be changed. So far all of my other options work so I am geussing it is an issue with the way I am ...
0
votes
0answers
78 views

How to make this scroll script work on just one post

I currently have a jQuery scroller on a website I am developing so that when a visitor hovers over an arrow the content scrolls up and down. This is fine on single pages, but I now need to include ...
0
votes
0answers
59 views

Current path on page in functions.php

How can I get the current path of my page? I know how to do it inside a template file, but I need it inside functions.php. And it has to be before the send_headers hook, because I'll use this info to ...
0
votes
0answers
57 views

Create custom permalinks / rewrite

How can create a custom permalink in my functions file that would include a template page when you go to a custom url: http://example.com/members/settings I have a template page at ...
0
votes
0answers
83 views

Registration Fail Redirect Problem

We use two registration links allowing users to register for different roles: /wp-login.php?action=register&utype=subscriber /wp-login.php?action=register&utype=contributer The subscriber ...
-1
votes
0answers
23 views

How to make a shortcode for returning HTML Value using condition inside a function.php?

I'm practically new in Wordpress Development and currently trying to make a shortcode for displaying condition user_logged_in by returning HTML format. Its not working very well and deteriorating the ...