Tagged Questions

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

Commenter should see only his comments in wordpress

I'm building a site for a research and my participants will be all logged in to use the site. I would like to make these participants able to see only their own comments, so other users' comments will ...
0
votes
0answers
11 views

PHP version or config prohibiting script from working properly

I have a function that is working correctly on another site, but not on mine (the string is not being replaced on my site). Both sites are using the default 2012 WP theme and the same plugins. ...
0
votes
2answers
42 views

Passing variable as add_shortcode argument

I'm trying to pass a variable into the add_shortcode function to be used as the shortcode name but it does not seem to be working. Is there a way that I can pass a variable similar to this? foreach ...
0
votes
0answers
18 views

Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?

I'm trying to update the post meta of all published posts hourly (via wp_cron) with the code below: if ( ! wp_next_scheduled( 'postviews_updatedcounts_hourly_event' ) ) { wp_schedule_event( ...
0
votes
1answer
26 views

Got white blank page after copying the functions.php to child theme

I got white blank page after copying the functions.php to my child theme. How can I change "like_escape"? What file can I find that? And I see this notice: Notice: like_escape is deprecated since ...
-1
votes
0answers
14 views

How to have text automatically scale to container width and height? [on hold]

I'm having a problem developing a new e-commerce website for a client. Basically, I need help making long product name text resize to fit the container that it is displayed in, which is fixed for ...
0
votes
0answers
25 views

how to load post content when a post title is hovered using ajax

i have a wordpress blog and i need to make my posts content show up when vistor hover the title of the post on my index page with no need to get into that post , exactlly like in the following site : ...
0
votes
1answer
20 views

is_page Funtion for Posts ?

I am using a plugin Bottom of every post which have a a function if( !is_page( ) && file_exists( $fileName )){ which is printing custom Text on bottom of every pages, i want to show them on ...
0
votes
0answers
14 views

Disabling custom post type in child theme [on hold]

I'm using a parent theme named magnum. It has a few custom post types that I dont need and want to disable them in my child theme. How do i find out the name to be able to disable it? I read an ...
0
votes
0answers
15 views

Link to existing content is not working

it's pretty simple, I have a fresh local installation of latest wordpress with the reverie there/framework. Everything is working smooth, but the nice ajax feature in the editor (Link to existing ...
1
vote
1answer
67 views

Get the title before comma

I am using this code to return the title of the post on a gravity form field. add_filter('gform_field_value_page_name', 'page_name_filler'); function page_name_filler($value){ return ...
0
votes
1answer
12 views

Apply height and width for the_content() inside youtube video tag

I am displaying video and content form this function the_content() for this am using you-tube [embed] link. How can i give height and width ??? Also, I am using the_post_thumbnail() for image it to ...
0
votes
1answer
31 views

Function to display post by specific author

I am trying to create a function that will display the 5 post made by a specific author. Lets say the specific name of the Author is 'Nick' I don't know how to excute it. I am using global variables ...
0
votes
1answer
27 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
17 views

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

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 ...
0
votes
1answer
47 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
49 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. ...
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
13 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
52 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 ...
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
18 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
23 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
22 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
11 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
32 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
25 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( ...
0
votes
1answer
12 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
21 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
22 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
35 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
30 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
11 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
33 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
64 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
78 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
20 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
28 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
21 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'] ...