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

Convert NOBLOGREDIRECT to use 301 instead of 302

Does anyone knows any process to convert the NOBLOGREDIRECT 302 conversion to 301 for WP MU sites? When you define the NOBLOGREDIRECT value to some url, it uses 302 to redirect to that url. I want it ...
0
votes
0answers
25 views

Is there a hack for using is_page() within the function.php file?

I've created a function in my functions.php that's called when the submit_form event is fired on the front-end. Here is the code: add_action( "wp_ajax_nopriv_submit_form", "submit_my_form" ); ...
0
votes
0answers
20 views

Problem creating menu shortcodes

I'm trying to setup three shortcodes, each to display its own unique menu block. Just two are shown in the code below because I ran into an issue. The problem I am having is that both [footera] and ...
0
votes
0answers
13 views

Empty categories not showing up with custom function

I'm working on a WordPress based website, and I have three levels of categories. Something like: Category 1 Child 1-1 Grandchild 1-1 Grandchild 1-2 Grandchild 1-3 Child 1-2 ...
0
votes
0answers
14 views

Manipulating DevBuddy Twitter plugin

I'd like to manipulate the DevBuddy Twitter plugin, to change the order of divs inside .tweet_content. I would like .tweet_media to come before .tweet_profile_img for the sake of my layout. I had ...
0
votes
0answers
7 views

Only show loged-in user's post on WP Calander

WP default, the calendar shows links on the dates have post through out the entire site. I want to make it only show the ones from the logged in users. I'm hacking general-template.php to do that now ...
0
votes
0answers
14 views

How to update post meta in schedule event action-function?

I want to execute something like this. What I must to change in following code? wp_schedule_event( time(), 'hourly', $string); add_action($string, 'do_this_hourly'); function do_this_hourly() { ...
0
votes
0answers
20 views

Been at this for hours--how do I add a jQuery function in the functions.php of WordPress?

I can't include all the things I need to include in my one multi page gravity forms form. If I try to include too much it just 403 errors me. I need to add a video at the top of each page. I've spent ...
0
votes
0answers
30 views

WordPress Caching

I try something on my local machine. I have a custom JS and CSS file which I included in the functions.php of my theme (twenty fifteen) like this: function load_my_stuff() { wp_enqueue_script( ...
0
votes
0answers
21 views

Declare inline background image in functions.php

I'm not sure if this can be done as I cannot find anything to help me anywhere no matter how hard i try. I'm using Ajax to load to in posts on the press of the button. the posts that are loaded in are ...
0
votes
0answers
15 views

How to call the post thumbnails in a list of recent post in wp nav menu?

Thanks to Stack I found a code which allow to list recents posts of each of my categories into my wp nav menu. The code looks like this : // Front end only, don't hack on the settings page if ( ...
0
votes
0answers
34 views

Modify category archive page loop on functions.php

I was able to modify the query on the category archive page using global $wp_query; $args = array_merge( $wp_query->query_vars, array( 'tax_query' => array( array( ...
0
votes
0answers
13 views

wp_schedule_event doesn't work

Can someone tell me where I'm going wrong? Images in folder /wp-content/cached_img/ are not delated add_filter( 'cron_schedules', 'cron_add_week4' ); function cron_add_week4( $schedules ) { ...
0
votes
0answers
9 views

Create multiple Instances of Ajax function and Control Variables from Template file

I received some help previously in order to build a Wordpress Ajax Load more function, However the site I am building is using different variances of this on different pages pages. The issue I'm ...
0
votes
0answers
33 views

Template file structure , wordpress hook for altering the template

i need to convert a html structure to theme. So this is my html structure <html> <head> ................. </head> <body> <div class="main"> <div ...
0
votes
0answers
26 views

Dynamically generated breadcrumb functions for category.php

BACKGROUND: I want to create a template page (using template.php) for news articles. News articles fall into about 7 different categories (Local, Special Events, Tech, etc). The template will use ...
0
votes
0answers
10 views

shortcode with menu item attributes show only if entered

I have created a shortcode so admins can add a menu with up to 11 items. The issue I have is if they enter only 8 items I have 3 empty items showing up in the html. Is it possible to show items only ...
0
votes
0answers
17 views

Custom Post Type On Publish Update Meta Field

I'm wondering if someone can shed some light on how I can update a custom meta field value, when a new post is created in a custom post type? Specifically, I have a custom post type named ...
0
votes
0answers
18 views

Adding additional advert after set number of paragraph

I've currently got my website set up where it automatically adds a Google Adsense ad after the 2nd paragraph of any article, but I'd like to improve on this, if anyone is able to help. I'd like to ...
0
votes
0answers
23 views

How can I add a dependency in functions.php to a JS file inside a plugin?

I'm currently using the Ajax Load More plugin and I'm trying to get it to work with Masonry. There's actually a section specifically dealing with this interaction on the Ajax Load More plugin site, ...
0
votes
0answers
53 views

how to use custom form field values in email - woocommerce

I am using following code to add a custom field to woo-commerce registration form. After registration is done. I am saving generated activation key to wp_users table. By using that custom field value. ...
0
votes
0answers
19 views

Getting an array of parent menu links and titles and all children links and titles

I am developing a theme with wordpress and trying to develop a sidebar that changes based on the users menu selection. So if a user clicks on the 'Fruits' link on the menu and it has children menu ...
0
votes
0answers
11 views

Adding a jQuery rotator function

I wanted to test and use the bellow function from @kaiser for a jQuery rotator, but I received an error. Can anyone tell me what is wrong? I have followed all instructions of the author. The ...
0
votes
0answers
30 views

Get specific post connections

So I'm using post2post plugin to create connections between posts. On my functions.php I try to get specific post connections but I don't get the connections and I'm not sure why. Any help? So far my ...
0
votes
0answers
39 views

Pre_get_posts meta query value serialized array using multiple URL parameters

Using the 'pre_get_posts' action I'm looking to return all posts which match multiple URL parameters by defining the meta_query. For example: example.com/?size=large,small&options=green,blue,red ...
0
votes
0answers
24 views

Change login and not login into user role

I need help, I'm sitting in front of my computer for days, i think i need help in editing the user role, just the user role, the rest of the code works. I have tried sevelral code, get current user, ...
0
votes
0answers
20 views

I wanted to restrict a user role, only user role “contributor” can access/view a specific product categories, not the post type post category

after reading this article:Add role that restricts user to post in specific category, I try to edit the function code in my theme but it doesn't work, maybe I'm missing something here a small detail ...
0
votes
0answers
167 views

Visual Composer creating own shortcodes with vc_map() to return simple Image

I am using the Plugin Visual Composer with in a new Theme I develop. My question is about mapping shortcodes to Visual Composer arrays. The problem I get, when I try to make a custom element for an ...
0
votes
0answers
26 views

add_filter Add To Content, Not Replace Existing Filter Function Content

If I am trying to add content to the content generated by a plugin/core filter function - how is this accomplished? The specific situation I am attempting to accomplish - I want to add the widget ID ...
0
votes
0answers
44 views

Editor Styles Not Working

I am trying to re-style the TinyMCE editor here: http://dannymcgee.net/duskguard/forums/forum/general-discussion/ I've tried both of these in my functions.php: add_editor_style(); or ...
0
votes
0answers
17 views

Theme Customizer not recognizing Widgets

First of - i do not know much coding, though i do learn quickly and am looking to get this issue sorted ASAP. I am sure it is something simple. When i load up my site in the Wordpress Theme ...
0
votes
0answers
79 views

echo value from 'select' field type into page template using cmb2?

I'm using CMB2 plugin to add metaboxes into a custom post type. I'm adding the additional metaboxes via functions.php onto child theme. It may worth to mention that parent theme/custom post already ...
0
votes
0answers
24 views

wordpress not calling peliegro functions.php?

I'm very confused with this question because I'm not really sure what is happenning, but as far as I know, my "father" functions.php is not being called. I'm using peliegro and peliegro Child. What I ...
0
votes
0answers
19 views

Php function modifying the page's rendering engine buffer and blocking caching plugin

I tried to create a plugin which creates pages based on a CSV or excel file containing hundreds of city names and postal codes. It creates one page per city, with always the same design but different ...
0
votes
0answers
16 views

is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript

Is there a predefined JavaScript function that can be use to check whether the site is being previewed in the Customizer which returns true if it is or false if it's not, just like what ...
0
votes
0answers
23 views

does it need any special functions to write in function.php?

does it need any special functions to write in function.php of template for single-{post_type}.php? I created a custom theme , but it does not move the single-{post_type.php}, my page is ...
0
votes
0answers
17 views

Query custom post in tag archive

I created a custom post and added the standard Wordpress tag functionality: function btp_work_register_post_type() { $args = array( 'label' => __('Works', 'btp_theme'),'labels' ...
0
votes
0answers
32 views

A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control

Are you familiar with the Customizer core $wp_customize->get_setting( 'header_textcolor' )? It will become available once you add_theme_support( 'custom-header' ). It have two controls, one is a ...
0
votes
0answers
14 views

Set the transport of the Customizer 'header_image' core setting to 'postMessage'

To activate the Customizer core section Navigation (ID: nav), you need to: add_theme_support( 'custom-header' ); I already tried to make the transport of the Customizer header_image setting ...
0
votes
0answers
29 views

How To Dequeue Styles From Plugins With “if”

I'm not a coder, but I'm trying hard enough to optimize my site using free codes. Lately, I found a way how to dequeue and deregister script/styles from plugins. Been using this: add_action( ...
0
votes
0answers
47 views

WordPress SEO By Yoast Plugin is interfering with a custom function code - how to troubleshoot and fix it?

I'm trying to optimize my page load on my WP site. I've copied a custom function (can't remember where I pulled it from) to optimize my pages. Things that it can are the following: move javascript ...
0
votes
0answers
34 views

Why wont these thumbnails show up?

Here is a link to the Website with the issue. http://southernhighlands.com/homes/exclusive-listings/ Looking at the 1st thumbnail I can see it is linked to Notice: Removed http:// because I can ...
0
votes
0answers
29 views

Split posts into separate screen on custom post type admin screen

I have a custom post type called 'event' that has a meta_key of event_status with a value of either 'upcoming' or 'past' depending on the event date. I am trying to split all past events into their ...
0
votes
0answers
30 views

Child Theme functions.php has no effect

I'm trying to make a child theme of Woothemes Appply theme. The Child functions.php file is having no affect though. I started by adding in the code to enqueue a style sheet, which didn't work. Then ...
0
votes
0answers
17 views

I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views

This is my Ajax Handler function function get_total_post(user_ID) { jQuery.ajax({ type: 'post', url: ajaxforall.ajaxurl, cache: false, data: { action: ...
0
votes
0answers
23 views

Cannot disable wpauto

I have tried everything to disable something adding multiple paragraph and break tags (up to 20 in a row) tags to a registration form. I first went into the event espresso files for this plugin and ...
0
votes
0answers
30 views

Adding some sort of Label-text to a looped button

To sum up my problem, here's a picture: I've added this text with a hover-fx to a button to explain to users what the button does. I've done so by adding a <div> with another <a>-element ...
0
votes
0answers
16 views

Manually call a WP class, e.g. wp-comments-list-table?

How would I output a class such as the admin comments table (wp-comments-list-table.php) on my own page? Thanks in advance
0
votes
0answers
92 views

Setting a cookie in functions.php and it gets deleted when working on an other function

My first function gets the parameters from the URL and sets the cookies: /** Get variables from the URL and set them into the coockie **/ add_action( 'init', 'set_utm_cookie'); function ...
0
votes
0answers
34 views

Using Conditional Themes to change out different themes using the Theme Customizer radio Buttons

I've been trying to change my theme based upon a radio button selection from the theme Customizer. I've included this plugin -> https://wordpress.org/support/plugin/wp-conditional-themes as a file ...