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

Need code: Space between page info and buttons and space below the homepage image

This is my website: http://musetude.com/ There is some space between the navigation pane and the page info. I would like the image to move directly beneath the buttons. Could you please help me with ...
0
votes
2answers
22 views

Programmatically Create Category and sub Category

i create category have name Brand with this code. i have total 3 categories and each have 3 subcategories. how to output 3 category and 3 subcategorys for all function.php code function ...
0
votes
0answers
4 views

Is strpos not working inside functions.php?

I'm trying to load a custom template whenever a certain string comes up in the URL. I've tried putting this in my functions.php, but it's not working: add_filter( 'template_include', 'paged_home', 99 ...
-3
votes
0answers
28 views

Shortcode used once, function executed twice?

I created a shortcode in functions.php and in the logs I can see it is executed twice everytime I reload the page. The shortcode is only used once on the page. What are the typical mechanisms that ...
-1
votes
1answer
27 views

How can I correct an child post

how can i child post ? like http://mysite/category/postename/gallery http://mysite/category/postename/morevideos http://mysite/category/postename/attachment http://mysite/category/postename/... Is ...
0
votes
2answers
61 views

Calling PHP function doesn't work in index.php

I have a function I wrote in my functions.php page for a gallery to display on certain pages. It displays on custom templates, but now I need it to display on index.php Here is the code from my ...
0
votes
0answers
6 views

add a menu item in buddypress [on hold]

i want add a new link (link of a specific post-page)on the buddypress menu, i have already found a code like this : add_action( 'bp_member_options_nav', 'buddydev_add_profile_extra_custom_links' ); ...
0
votes
1answer
800 views

Load post attached images on a single page site with fancybox

I'm trying to make a single page site that will display posts as thumbnails in some part. Then if a thumbnail is clicked, I want all the images contained in this post to be loaded with fancybox while ...
2
votes
3answers
48 views

When paginating a Page with the <!--nextpage--> tag, how can the 2nd and subsequent page styles be customised?

I want to apply different styles for a second page in single.php or posts. How can I do this? I have the following code in single.php to split the page in two parts: <!--nextpage--> If there ...
1
vote
2answers
26 views

Conditional Gravity Forms filter in WordPress Multisite

I'm using this technique: http://stackoverflow.com/questions/27323460/how-to-label-payments-in-gravity-forms-paypal-pro To add comments to the paypal comments field from a gravity form. However, it's ...
-1
votes
0answers
11 views

How to modify woocommerce rating [on hold]

I remove default tabs and create new tabs in function.php where on item is review sections. But I can't dynamic reviwer section where consist name, email, review and rating. How can I dynamic or ...
0
votes
1answer
21 views

redirect 301 with special character like WIX site “#!”

i want migrate a WIX website to wordpress and i want preserve the SEO score without broken the url of every post-page. but the structure of WIX url is composed by special character like "#!" , now how ...
0
votes
2answers
707 views

Show the post date using the wp_get_archives() function?

I have some doubt about the wp_get_archives() function In my website I have create the following page template that use the wp_get_archives() function to show the posts list: <?php /** ...
5
votes
5answers
12k views

How do I remove UL on wp_nav_menu?

I search on this site and found many answers for this question. Most of them is not working on my theme. Here is a one solution I found and it's working according to my need. function ...
0
votes
2answers
19 views

Child Theme Not Overriding Parent Theme

I know this question has been asked many times. I even spent the entire day yesterday getting things to work but to no avail. I am pretty sure I am missing out on something small//silly but I am ...
1
vote
1answer
20 views

Create single.php for specific tag by tag id or name

i have multiple tags and want to create multiple single.php for everyone tag. How create single.php for tags?? This code working well for category, how to edit it for tags?? function ...
0
votes
2answers
442 views

Use Exact Image Size using add_image_size

I have a pretty basic question. It may be very noob question, but it is bothering me a lot. In my theme I've added a custom image size like this: function img_update() { if ( function_exists( '...
0
votes
0answers
9 views

Empty temp image folder daily using wp_cron

I have a folder on my server that holds temporary images. I would like to empty this folder daily to free up space. I am using the following cron job: add_action('images_event', 'images_weekly'); ...
2
votes
6answers
3k views

Make sub menu items a main link in the admin menu using fuctions.php

I am trying to customize the admin area using the functions.php file to make things easier for my clients. One request I have got before and hope to be able to accomplish, is to move some of the sub ...
-2
votes
1answer
28 views

Functions.php file in a custom child theme messed up without backup

I just ran into some problem. I'm a beginning Wordpress dev. I don't know much and I have messed up my functions.php file. Here's how it happened: I copied the code from This site. This was supposed ...
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
2answers
582 views

Possible to register multiple custom taxonomies in one function?

I'm registering 7 custom taxonomies in my functions.php. Since each function uses the same labels and arguments and is attached to the same Custom Post Type, I'm wondering if it's possible to register ...
1
vote
1answer
835 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
1answer
987 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 style....
-1
votes
1answer
36 views

Remove Disqus JavaScript from homepage

Hey WordPress friends, I’m using the Disqus comment system plugin, which is working fine. My homepage is just a collection if recent posts and therefore not having the option to leave a comment (as ...
0
votes
1answer
874 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( '...
0
votes
1answer
12 views

Both the require and add_template_part function are not including the file

I'm trying to add a require function in my functions.php, to include a file that is in the wp-content folder. I first tried this with the function content_url . 'filename.php'So the line of code ...
0
votes
1answer
30 views

Autogenerate a Table of Contents

I am trying to generate a Table of Contents at the top of each of my posts and would like to minimize the requirements on the author. Ideally, the author would enter only various levels of the header ...
0
votes
0answers
24 views

I have problem when use antispambot for other languages

I have Issue about " antispambot() " when I enter German language like "höhen@yahoo.com" , it's return incorect characters . I know this function encode email address but It's work fine just for ...
-1
votes
0answers
16 views

Change category link. Lead it to a specific page

How can I change a link of any shop category in functions.php? I have 4 shop categories. To one of them I need change its href-link, it should go to specific shop page. How can I approach this?
0
votes
1answer
22 views

How do I integrate my Child Theme into a Custom Template?

I started working on this yesterday, and while I was able to successfully load my child theme, some of the site functionality went haywire. I suspect that I may need to add some code to my functions....
10
votes
2answers
13k views

Remove “Category:”, “Tag:”, “Author:” from the_archive_title

I have the following code in my theme's archive.php: <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?> This gives me titles like "Category: Russia", "Tag: America",...
2
votes
4answers
637 views

Get only <ul> or <li> from the wp_nav_menu

I have tried several options like setting 'container' => false and registering the theme_location and searching on forums but I am unable to get rid of the "div" coming with the wp_nav_menu in my ...
1
vote
1answer
994 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 - ...
-1
votes
1answer
41 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. http://www....
0
votes
1answer
19 views

Using wp_localize_script in template file - is it secure?

I have the following code inside one of my template files (NOT functions.php) $datatoBePassed = array( 'pageTitle' => get_the_title() ); wp_localize_script( 'main-js', '...
0
votes
0answers
9 views

Class For Dependent Child Post Data using get_posts()

I want to use a class to display various parts of a dependent post via a class. This is my first stab into OOP, so please be try to be somewhat gentle, if possible. :) At a high-level I have a two ...
0
votes
2answers
36 views

How to know if user logged in

I have PHP code <?php if ($_SESSION['logged_in'] == 1) { echo '<script type="text/javascript">var logged_in=true;</script>'; } else { echo '<script type="text/javascript">...
-2
votes
0answers
21 views

How can I disable author and hide their posts?

I want to disbale authors and after that they gonna be hide such as their posts, media and etc. also on the contrary of above , when i active authors their posts display to every one Any idea?
-3
votes
0answers
18 views

how to use download links with CONTACT FORM 7?

I want to allow user to download my PDF only after they filed their email id. On every post there is a different PDF to download. I am saving these download links in custom fields of WordPress ...
-3
votes
0answers
17 views

OOP help, how to implement custom lookup in my associative array within functions.php

I'm writing a function to execute on a custom action: //############## START OF NON WORKING CODE add_action( 'gform_pre_submission_1', 'myCustomFunction' ); function myCustomFunction( $form ...
1
vote
1answer
1k views

Remove Header and Footer in iframe

Many people embed my website's pages in their websites as iframes. I want them to not take my footer, header and a specific division in those iframes. Since, footer, header and mentioned specific ...
-1
votes
2answers
1k views

AJAX values converted to PHP Variables?

I just started playing with Wordpress and I have a question about the AJAX side of things. I think that I understand how the AJAX front-end to server side processing, back to font-end works. But, I ...
2
votes
4answers
2k views

How to display post tags

I'm converting an HTML template into a wordpress theme and I'm having some trouble displaying the post tags within the functions.php file. What I would like to do is add the following code into the ...
0
votes
1answer
537 views

Custom wp_trim_words() function not trimming right

I have this custom wp_trim_words() function set to give me excerpts of only 20 words, and for the most part, it works fine. Except for some reason, on posts that contain lists, it outputs way more ...
0
votes
0answers
19 views

Hide Archives From Past Year in Sidebar (Twentysixteen)

Following the instructions on this page I was able to limit the archive list on the front page of my WordPress site to the last 3 years. However, when I go to individual post pages, the full archive ...
0
votes
1answer
4k views

How to integrate owl carousel into theme without using a plugin?

I've been trying to integrate the owl.carousel into my theme but can't get it to work. The instructions on the page are not for WordPress so I need help with how to properly enqueue the required files ...
0
votes
3answers
434 views

Custom meta box in custom post type not working

As a wordpress newbie I am having problems in adding custom meta box in my "slider" custom post type which I used in some old wp theme. I'm getting a warning: Warning: call_user_func() expects ...
0
votes
1answer
47 views

How to add attributes to a shortcode

Reading the codex, I have: function btn_shortcode( $atts, $content = null ) { $a = shortcode_atts( array( 'class' => 'button', ), $atts ); return '<a class="' . esc_attr($a[...
0
votes
0answers
22 views

Generate and return a PDF file in functions.php

We have the following process flow: 1.) Users fills in a form (name and surname) 2.) Backend php scripts look for the record in local CSV files 3.) If record exists we would like to return the data ...