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

Function the_content

For some reason on my attachment page template (http://capa.furniture/?attachment_id=1494) I am getting the url of the reduced size image. I do not know why. I am not getting the thumbnail full size ...
-1
votes
1answer
27 views

how can I make content from a plugin hidden when user is logged in? [duplicate]

I would like to make my social icons at the top of my page disappear when a user logs in to my website... what is the best way to go about this and can you give me all options that are possible ...
0
votes
1answer
39 views

Class property seems to lose scope, attached to save_post action?

This may be more suited for StackExchange, so if you think that would be the right place to direct my question - please let me know :). So, I have a class with a property of save_list. This is an 2D ...
0
votes
1answer
38 views

main menu page redirects to user ID

I have a site that displays fitness results to clients. It works by showing them a page based on their UID displaying unique charts and graphs etc. I can redirect members to the unique pages on ...
0
votes
1answer
34 views

How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]

As the picture says I am trying to remove the three dots that follow the end of the blue sentence (shown in the photo). I am also trying to increase the numbers of characters it can reveal. ...
0
votes
1answer
13 views

Wordpress shortcode Issue!

Hi I have developed a shortcode that lists posts from a custom post type depending upon taxonomy terms. But I am having an issue. It's displaying all posts from all terms instead of the terms being ...
0
votes
0answers
42 views

Plugin Boilerplate - Where should I put helper functions?

I'm using the Wordpress Plugin Boilerplate and as it's OOP, I don't see where is the place for helper functions. If I am using this for say a review plugin - and I have a function that generates the ...
0
votes
1answer
41 views

Problem in outputting shortcode

This is my 2nd question about shortcode as I'm learning shortcode. Here is my code: add_shortcode('work-shortcode', 'work_shortcode'); function work_shortcode() { $return_string .= '<div ...
-1
votes
2answers
27 views

Only echo Page Content (not page title & page content together)

I am working on a child theme of the WordPress Twenty Ten theme. I have several pages in WordPress (About page, Testimonials page, Contact page, etc.). I want to only echo the page content (the actual ...
0
votes
1answer
81 views

How to Display a Plugin function (content) on frontpage using index.php

Slightly Advanced Noob Alert: {Sorry}. I'm designing a WordPress Site {No Active Yet}. I have a plugin [feelbox], but currently it displays only on the single post page. There is no option in the ...
0
votes
1answer
25 views

Edit TinyMCE Button Functionality

How can I edit the "Align Right" button functionality on Wordpress' TinyMCE to add a class "alignright" instead of "style='text-align: right'" for text. TinyMCE already has that functionality but it ...
0
votes
0answers
456 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
0answers
20 views

Custom Fields: Linking a thumbnail to another image

I'm trying to figure a way to link a project, not to another page, but rather to an image that I'll eventually display in a lightbox but for now, it just links to the image in its' own window. That's ...
0
votes
1answer
33 views

need help with '… read more' excerpt in functions.php

I have this to generate the link: <a class="view-article" href="' . get_permalink($post->ID) . '">' . __('View Article', 'html5blank') . '</a>'; But I don't want it to open the post ...
-1
votes
2answers
42 views

replacing words to “…” [closed]

So, I have this post title that has a certain length (say 15 words). When the browser width is reduced, the overflown words are placed to a next line by pushing everything down. However, is there a ...
0
votes
1answer
61 views

Function that prevents users from uploading photos more photos

Mjello, I'm struggling with this function that prevents users from uploading more photos than what their membership are entitled to. So they have 10 photos to upload. When they've reached 0 they ...
0
votes
1answer
37 views

Excerpt function for any content

Is there an excerpt output function in wordpress I can hook into regardless of the field used, rather than just the main content field? I have a CPT using custom fields, and rather than creating a ...
0
votes
1answer
57 views

Call function without having to wait on response

When submitting a form I want to call an additional function that will connect to a webservice. Because of the slow response time of that webservice, I don't want the page to keep loading untill the ...
0
votes
1answer
44 views

Problem in shortcode outputting content

I`m trying to make a shortcode that output the a div containing content from Custom Post type . I'm able to output the content but content does not output within div . the shortcode output the div and ...
0
votes
1answer
39 views

How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]

I am modifying someone's Wordpress theme and they have a section for upcoming tour dates. The page for inputting was made with Advanced Custom fields plugin and uses a date picker widget that stores ...
0
votes
1answer
28 views

How to convert raw url to hyperlink?

I have a custom field with raw urls and I want to convert them to hyperlinks. So I used this code: <?php $text = get_post_meta( get_the_ID(), 'Links', TRUE ); echo make_clickable( $text ); ?> ...
0
votes
3answers
176 views

Dequeue script to prevent javascript event conflict on wordpress child theme

I've built a child theme of Divi Theme to use with Buddypress. So far so good, except for a script conflict on commenting buttons. The theme load a javascript (js/custom.js at 2642:2662) with the ...
0
votes
1answer
30 views

Randomize Color Scheme Selection in Theme

on my site I'm using cenetric, a child theme of genesis and this theme comes with some predefined color schemes. //* Add support for additional color style options add_theme_support( ...
0
votes
1answer
69 views

Insert function insde body tag

How to insert this function inside <body> <?php function Ciusan_NBar(){ global $options; $options = get_option('Ciusan_NBar'); if($options['CNB_Showing']=='yes'){ ?> <div ...
1
vote
1answer
675 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: ...
0
votes
1answer
34 views

Excerpt for pages not showing

I am creating a simple wordpress theme and need excerpts for pages. I have tried the code from many topics some resolved on 'wordpress SO' but nothing works. Because I created the theme from scratch ...
0
votes
1answer
50 views

Is there any wordpress function to update a random post every 10 minutes?

I' m looking for a function which can be inserted in wordpress theme function.php , when inserted , i want it to update a random post (which is already posted ) every 10 minutes . can this be done ...
0
votes
0answers
48 views

Restrict Editing by Category

I've tried every possible user role plugin for this, but each of them no longer work with the latest edition of Wordpress (Role Scraper, Restrict Categories, Advanced Access Manager, etc). If a plugin ...
0
votes
0answers
39 views

Custom function to add a secondary logo

I'm looking to create a custom function in order to be able to change/load a new image from the "customize" panel (this because I won't be the one who manage the website, so I'm trying to made things ...
0
votes
0answers
32 views

Rotate image media item 90° anti/clockwise ajax front end function?

Is there a rotate image function that I can create a button on the front end of my website, using ajax inconjuction with the id number of the media item? I'm thinking having 2 buttons, rotate left ...
0
votes
2answers
48 views

Assign category a default post type

This one has been bothering me for a few days now, so I'd really appreciate any help you can give me. Problem overview: I have a plugin which automatically creates a post and assigns the category ...
0
votes
1answer
106 views

Shortcode to get featured image of specific id post

So I'm trying to create a shortcode to get specific id and its featured image to display it in a specific page. I want to use shortcode to make it easier for the user to add any post in this page. ...
0
votes
0answers
41 views

Modify shortcode to work with custom taxonomies and slugs

I am using this code which works fine with posts but I am looking to modify it so that the user can specify in the shortcode: custom post type name taxonomy name slug of taxonomy category For some ...
0
votes
2answers
94 views

Extract and display user infromation on an automatically created page

Is there a way to get the block of code below to extract a list of given user information as it creates the page for the new user. It creates new page for new user as supposed but I'd like it to alos ...
0
votes
0answers
62 views

Override A Plugin Variable And Function Via Functions.php

Is it possible to override a variable in a plugin function without altering the plugin? The closest thread I found to answer this problem is this one : Pass A Value From Outside To A Plugin Variable ...
0
votes
1answer
141 views

Calling the first & last post by category in custom post type

I have custom post type for comics, called “comic” and have written a basic comic navigation. First —previous — (current) title — next — and last comic. In functions.php, this code calls for the ...
0
votes
1answer
444 views

Fatal error: Call to undefined function add_action() - an untouched problem

The question was asked many times in many ways, but unfortunately is not covered well in most of the answers. I'm having the same issue doing things using include-files. In my TwentyFourteen child ...
1
vote
1answer
41 views

Toggle User Roles with button

I don't know if this is possible, but I've got two user roles: Hero and Legend. When people subscribe to my website, they're assigned the Hero user role. I would like to be able to toggle users to ...
0
votes
1answer
65 views

Adding New Role

I have add new role in functions.php file by this code: // Add a custom user role $result = add_role( 'supplier_for_planvent', __( 'Supplier_For_Planavent' ), array( 'read' => true, // true ...
0
votes
1answer
27 views

Must filter functions receive all arguments passed to them?

I'm writing a filter function to redirect logins: function my_filter_func( $redirect_to, $requested_redirect_to, $user) { // My code. } add_filter( 'login_redirect', 'my_filter_func', 10, 3 ); ...
0
votes
1answer
17 views

Hiding all posts/products/pages from a site based on a custom taxonomy/domain name

I'm working on a site that's running Domain Theme Mapper (http://codecanyon.net/item/domain-and-theme-mapper) with WooCommerce to present two sites with two different child themes... that share a ...
0
votes
1answer
60 views

Styling admin page rows in order of importance (checkboxes)

I am altering a plugin's admin area and adding a checkbox for a "Coming Soon" option. As of now, when the user checks the "Coming Soon" checkbox, the entire row will turn green, but there is also the ...
0
votes
0answers
42 views

Load a Child Theme's style.css just before the closing </head> tag

I have this in functions.php: <?php /* Import parent style - The new standard Wordpress way - No @import in CSS! */ add_action( 'wp_enqueue_scripts', 'theme_enqueue_parent_styles' ); function ...
0
votes
1answer
133 views

wpautop - disable <br> tags, keep <p> tags

I write My articles in Emacs and they end up having tons of newlines, with double newlines to separate paragraphs. Ideally, I want wordpress to work like markup does, meaning it ignores single line ...
1
vote
1answer
44 views

Assigning WP functions which echo to PHP variables

I am creating a settings page. If I use the default example it works fine. <form method="post" action="options.php"> <?php if(isset( $_GET['settings-updated'])) { ?> <div ...
0
votes
2answers
68 views

Load CSS conditional on custom field is present

In my functions.php I would like to enqueue a CSS file conditional on whether a custom field exists on the page or custom post type. How should I go about this? function flatsome_scripts() { ...
0
votes
1answer
59 views

Can't wrap my head around this function - any help would be appreciated

OK so I am working on a theme that utilizes the customizer a lot. When you change a color for example, the necessary css gets added to the header, but when you click default, the css with the default ...
0
votes
1answer
40 views

Child theme - overriding add_image_size by a child theme [duplicate]

I am trying to get my child theme to work and to overide one line of code in the main theme functions.php but I can not getting to work since I am totally green in php. In my main theme functions.php ...
0
votes
1answer
42 views

Split single-review.php to two parts

I have a created a new page template which I want to use for my custom post types as well. I need to retain the existing format of my old custom post types but for any new custom post types, I want ...
0
votes
1answer
103 views

Custom Taxonomy Select Menu: Setting default option value?

I'm creating a series of select drop down menus that pull data from various taxonomies. I got this PHP script working for a WooCommerce attribute of color: function get_color_dropdown($taxonomies, ...