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

How to display 2 function calls in same line?

<?php the_author_posts_link(); ?> <?php the_time('g:i a'); ?> When I call above 2 functions you will see the output in two lines. But what Need is "Andrew 2.10" I need both output in ...
0
votes
0answers
7 views

WooCommerce Product addon - show add-on price? [on hold]

I'm using the plugin product add-on more as a variable, because I like the checkboxes better. I've set the regular price to 0 and added filter in functions.php to remove the "Free" price tag ...
-1
votes
1answer
34 views

How to override woocommerce.css?

I would like to override woocommerce.css in my child theme. This is what I tried in my child theme's functions.php but it does not seem to work: add_filter( 'woocommerce_enqueue_styles', ...
0
votes
0answers
12 views

Breadcrumbs remove link on specific page

Hello i made a function call breadcrumbs yes it's working but i want to make it into more custom like this if is_page is parent page then the breadcrumbs should be like this below Home / Parent Page ...
1
vote
1answer
34 views

Publish author posts only with editor approval?

I run a multi author blog and i am looking for a non plugin solution. The default author user role in Wordpress can publish posts without any approvel - look at Role Capabilities Wordpress Codex. ...
-1
votes
1answer
20 views

Shortcode Calendar Not Rendering [on hold]

Totally new to WP... Working on an existing project where calendar stopped rendering. This is what is rendering in the DOM: This is the code: I don't see anything referencing a calendar in the ...
0
votes
1answer
15 views

Replace header image on all other pages but home - URL issue

I've got a function working to achieve what I want on my dev server, but it will not work on the live site. I have a random image implemented via shortcode and plugin, and it must appear everywhere ...
0
votes
0answers
9 views

get adjacent post by meta key and meta value

I'm trying to limit previous/next navigation to posts that have the same meta_value on a certain meta_key. I know this was asked before, but I couldn't pick a working answer. And all that I could come ...
1
vote
2answers
39 views

Child Theme files - what is needed?

On child themes: It is stated: ... create a file called style.css. This is the only file required to make a child theme. Then, it states: The correct method to import the parent themes ...
-2
votes
0answers
32 views

How to upload and allow downloads of .mobi and .epub formats in Wordpress? [closed]

Referencing a past post that asked the same thing. The answer was provided but I don't understand how to use the code they provide: Using WordPress native Media uploader, you can use the upload_mimes ...
0
votes
0answers
14 views

How to edit plugin to only display on specific post types, instead of all posts and pages

I've installed a plugin (allows users to save favourite posts to a list: http://goo.gl/9LEvjy ) but by default it displays on all posts and pages. I want it to only display only on posts, NOT pages - ...
0
votes
2answers
16 views

How to check if a user exists by a given id

Is there any way to check if a user id exists? I want to create a function similar to username_exists() but which returns if the id exists or not.
0
votes
0answers
20 views

Call wordpress function outside wordpress

I am writing an script to get wordpress posts and user data outside wordpress files and folder, this script run by side of wordpress installation but will fetch data from wordpress as explained below. ...
0
votes
1answer
17 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 ...
0
votes
1answer
21 views

meaning of (array)function()

I saw this piece of code that have part of the code I never saw before. What is the behavior of (array) in this scenario? so far I know the way of creating arrays in php never see this. // ...
0
votes
0answers
10 views

How to mirror exactly the left admin menu on front end?

Want to mirror the left admin menu on front end, exactly as it appears on backend... I'd like to do this for a multisite so it seems like a seamless transition. I can add more menu items and hide ...
0
votes
2answers
17 views

Adding a filter with custom function to the menu / navigation

I'm going to get crazy with the problem: I want to add a specific css class to the menu items, depending on a custom taxonomy. This is my code so far. add_filter('nav_menu_css_class', ...
0
votes
0answers
27 views

Social Media button function using jquery

I've wrote a fairly small function that I'm trying to get working. At the moment the jquery doesn't seem to have any effect on the html selected. I've checked the "inspect element" all file's are been ...
0
votes
1answer
18 views

Check if excerpt is empty at loop-portfolio

I want to check if excerpt is not empty, then echo the excerpt link, if not the echo permalink, like this: if(the_excerpt()!='') echo the_excerpt(); else echo get_permalink() but how can I check if ...
-1
votes
1answer
24 views

How to assign a div class to a echo function [closed]

How can I assign a CSS (span or div) class to this function, so that I can style the output in my style sheet? function show_today_date() { echo date(get_option('date_format')); } add_shortcode( ...
-2
votes
0answers
19 views

Can't enter to wp-admin after modified functions.php [closed]

I can't enter to wp-admin after modified functions.php. I don't have access to the FTP, is there any way I can restore or enter wordpress and the site again?
0
votes
1answer
9 views

add a function to submit options.php

I have a form which does <form method="post" action="options.php"> ......... <input type="submit" class="button-primary" value="<?php _e( 'Save changes', 'bsp_style_settings' ); ?>" ...
0
votes
2answers
34 views

check if the user is owner of current page

I am struggling with this little problem. I have a user profile page and I want to change some of the content based on whether it is my own profile og someone elses. This is my code to add a shortcode ...
0
votes
1answer
17 views

Modify php code to pass a page id as a parameter in order to create a breadcrumb

I use a function to create the breadcrumb in my pages and it works: function the_breadcrumb() { $currentBefore = '<li><a>'; $currentAfter = '</a></li>'; if ( ...
0
votes
1answer
21 views

Load slideshow.css file only if Slideshow is checked / on

I use <?php if ( get_option('mytheme_slider') == 'checked') { get_template_part( 'partials/slider/slider-java-script' ); } ?> to include the slider-java-script.php template part into my site. ...
0
votes
0answers
32 views

Mail function not working with user accounts

I have an issue with the user account system. It refuses to email people their passwords when they make and account and when they get a temporary password. It always returns with this error "The ...
-3
votes
0answers
27 views

Related Posts without plugin

I need to my folder single.php insert code related post I tried but problem that does not appear div where the path for the images. Or the exact steps? Thank you
0
votes
1answer
7 views

Open image size links in a page instead of direct image link

I am using this custom function to display image sizes on image.php (attachment page) function my_get_image_size_links() { /* If not viewing an image attachment page, return. */ if ( ...
0
votes
2answers
32 views

Individually styling date month year [closed]

I am using underscore_s barebone theme to build mine and came across this challenge that I would like to style date month and year separately with CSS and the code output puts them together. I dug ...
0
votes
0answers
56 views

admin-ajax.php not working after wordpress 4 update

n WordPress 3.9.2 access to admin-ajax was working for non loggedin users. When I upgraded the script stop working. I have the following code in functions.php function theme_name_scripts() { ...
0
votes
0answers
12 views

Wordpress hook to add content under title or post status buttons on edit.php

I'm looking to add some content above the wp_list_table for a custom post type. I have custom bulk actions and filters but would like to add some further content to this header area. I cant seem to ...
0
votes
0answers
9 views

Splitting of Page

I have opted to go with a single page layout with custom fields. However is becomes tedious to scroll down the page to edit content at end. As such I would like to split the page into smaller parts. ...
0
votes
1answer
69 views

How to target specific wp_nav_menu in function?

I am adding a specific class on my wp_nav_menu link via function.php but I am not able to target a specific menu: This is what I got which targets all wp_menu_nav on my page: function ...
0
votes
0answers
16 views

Get default post thumbnail from custom field

This is default post thumbnail code add_filter( 'post_thumbnail_html', 'my_post_thumbnail_html' ); function my_post_thumbnail_html( $html ) { if ( empty( $html ) ) $html = '<img src="' . ...
0
votes
1answer
19 views

Remove a Plugin function through theme's function.php?

I am using a Plugin called PixGridder for backend setup, but i dont want the front-end css to apply.. I found that in the plugins functions.php has these lines: public function front_styles() { ...
0
votes
0answers
10 views

Let the user duplicate chunk of meta boxes

I have a CPT 'Product', that can be rented or sold multiple times over. Each time a transaction takes place, the admin would like to update some of the information (such as sale date, condition etc). ...
0
votes
2answers
25 views

Calling an custom field from theme option at the frontend

I am having trouble calling a field and displaying its content at the frontend from a custom theme option page. This is the code I am using to display my custom theme option at the backend ...
0
votes
1answer
18 views

Function not pulling image or text from custom post type

//Custom Post Type register_post_type('inf_main_feature', array( 'labels' => array( 'name' => 'Main Featured', 'singular_name' => 'Main Featured', ...
0
votes
1answer
9 views

How to edit label_submit styling?

This is going to sound like an easy fix, but I am looking to style my submit comment button on my comment form. Currently the code in the $args = array looks like this: 'label_submit' => ...
0
votes
1answer
19 views

Function to get the name in database table from the comma separated string

I already created admin column in WP using this code: add_filter('manage_pages_columns', 'page_custom_cols', 10); function page_custom_cols($pages_columns, $post_type) { $pages_columns['user_group'] ...
1
vote
1answer
25 views

Usage of theme name in functions

I've been studying some functions.php files to get my head around theme development, and I keep stumbling upon a reference to the theme name inside functions. Something like this: <?php ...
0
votes
0answers
25 views

Get Custom Field Value of a $post_id on wp_insert_post Action in functions.php

I have this code in the functions.php file which emails the post content to the admin every time a pending post is added to the database: function send_email_on_pending_post_creation( $post_id ){ ...
0
votes
0answers
10 views

How to format the Widget Display function contents?

I'm writing my first plugin, and basically I'm wondering how to write the code which goes inside of the widget display function: function widget($args, $instance) {} I'm trying to run a post query, ...
0
votes
0answers
25 views

Send post id through ajax and get the post content back

First of all i want to say that I am a WordPress beginner :). I am trying to get a post content in a modal by using ajax. So i send the id through ajax, but i cannot execute the php code anywhere on ...
-1
votes
1answer
16 views

Remove base from the custom post type URL [duplicate]

I wanted to add blog before the post slug in the URL. The URL for the post type page was: http://example.com/blog/post-one So basically to add blog before the posts url in Settings >> permalink ...
0
votes
0answers
22 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){ ...
-2
votes
1answer
28 views

PHP error in shortcode [closed]

Can anyone help me see the error in this code? I'm trying to implement a function via shortcode which I found here: <?php if (function_exists(‘wooslider’)) echo do_shortcode(‘[wooslider ...
0
votes
0answers
27 views

How to create a function to change content in the website?

I've been searching for an answer for over a day, but I couldn't find anything. The problem is that I need to change those 3 blocks of information whenever I want to, using the admin panel I've ...
0
votes
1answer
32 views

apply_filters() function

I have used apply_filters() while retrieving the content from WordPress post like: $content=$query_val->post_content; $content = apply_filters( 'the_content', $content ); When I was using ...
0
votes
1answer
30 views

Function not recognizing page id?

I'm trying to setup an if/then statement so that if the page_id is not one of these three pages or their ancestors, then use the default logo. I'm using the is_tree() function in my functions file and ...