Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
74 views

Why does HTML entities are still encoded in Code Block?

In the Code Block if I type in reversed character, they are encoded to HTML entities: Input: Output: <pre class="wp-block-code"><code>'&#91;] </code></pre> ...
0
votes
0answers
26 views

Save Meta when custom Taxonomy Saves

I am in need of some advice, we are setting up a custom tag for Movies. We want to have it pull from the OMDB Api when it is saved. We have the function setup, but it is not firing, and I am stumped. ...
0
votes
1answer
11 views

How i can remove Working Functionality of my header & footer plugin from backend files but in front end plugin need to show that plugin activate

I have a question actually I have a website in which one of my friends is using too many scripts in the header & footer using header & footer plugin in WordPress so I just want to stop the ...
1
vote
0answers
25 views

How to save checkbox values for logged in users?

Hello~ How can I have checkboxes save their values for a logged in user? My Wordpress website features various checklists in a table format. When a user finishes a task on the list, they would be able ...
0
votes
0answers
19 views

Woocommerce display orders with products from specific categories to specific admins

I am new at stackoverflow. I have a question about wordpress. I am building a wordpress site for some cinemas with movies. Each cinema is a product category. I want enable an admin cinema1 which will ...
0
votes
1answer
18 views

Woocommerce template file outputting <strong><code> tags

I'm struggling with the editing of the woocommerce template files. In particular, I'm trying to create a custom cart page and, as guidelines, I've copied the cart.php template file to my template ...
0
votes
1answer
21 views

Reorder a page of posts of a certain taxonomy/value by a custom field

I want to re-order a page of posts of a certain taxonomy/value by an added Advanced Custom Fields PRO field, instead of the default (ordered by post-date). We have a WP site with a custom taxonomy, ...
0
votes
1answer
18 views

remove edit link only for published post and pending post

Currently i m using this shorocdes add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 ); function remove_row_actions( $actions ) { if( get_post_type() === 'post' ) unset( $actions['edit']...
0
votes
0answers
20 views

using add_filter in a template_redirect function?

I have certain pages that I would like to filter, replacing some tags, with a value. Rather than attempting to filter every page, I only want some pages, but to make it use even less resources (not ...
0
votes
0answers
22 views

Automatically Close wordpress media uploader after click on upload image

i am using one function for automatically insert image in post after user upload image in wordpress media uploader but problem is that wordpress media uploader is still open after user upload image. ...
0
votes
1answer
31 views

Copying and pasting to Wordpress "code editor" code via the front end and clipboard

I'm trying to emulate what these folks do with their "Copy code" button: https://gutenberghub.com/templates/team-56 Their approach is great for copying to clipboard and pasting directly to ...
0
votes
1answer
79 views

How to create a checkbox to show/hide a field in WooCommerce checkout [closed]

I want to put a checkbox before all fields where I want to ask people if they have vat number and when they check that checkbox I want to display vat_number field, also when isn't checked I want to ...
1
vote
1answer
49 views

Wordpress wp_insert_post() returns 0 but not not wp_error

wp_insert_post() return value says: (int|WP_Error) The post ID on success. The value 0 or WP_Error on failure. Okay, I' have an import routine running and all but a few (about 20) of them import ...
0
votes
1answer
30 views

how to display google maps with javascript

I want to display one google custom map with javascript, I set this code in a code module, but when I post it only appear the code and not the map, how can I display my map correctly? The code works ...
0
votes
1answer
42 views

How to make my homepage automatically redirect to an external website?

Actually, I have a website hosted by my University. They claim that it is my personal website or whatsoever, but they do not give me full control of it! I cannot install plugins, change the theme, or ...
0
votes
0answers
61 views

How to preload header logo image in WordPress? like what's the code and where do I put it?

I want to preload image in header i.e. Logo, so what is the code for that and where do I put that logo? Thanks!
0
votes
0answers
15 views

I would like to add a review count of a particular website in to my blog and that it should update automatically every time it changes

Hey i would like to be able to add a review count from google reviews or trustpilot of someone else website that i am writing about them in my blog. i would like it to be accurate and therefore update ...
0
votes
1answer
28 views

restrain filter on get_the_excerpt to queried item in stead of current post

So, I have a walker nav menu who add the page excerpt to all page links in the nav menu. Now, I want to build a custom post excerpt for the blog archive. All works fine when the nav menu doesn't meet ...
0
votes
1answer
29 views

How can I create a shortcode to show the number of posts of actual day?

I want to create a shortcode to display the posts posted on actual day. I found this code: show number of posts posted today And I'm trying with it, but return 0 function ts_day_f() { // we get the ...
0
votes
0answers
12 views

Cost calculator with ability to add new products

I'm looking for a way to make cost calculator something like this: Name: Surname: Email: ** + Add product ** Quantity: X: Y: Z: ** + Add product ** with ability to add as many products as I want to ...
0
votes
1answer
29 views

Make order notes field at woocommerce checkout only viewable on front end by Admin level user role [closed]

I have a snippet of code that allows me to hide the order notes field at checkout for all users (logged in or not) but wanted to ask if someone has written a snippet that hides the same field from ...
0
votes
1answer
34 views

CSS properties in textarea in the Customizer

I am trying to create a custom field (text/CSS code in textarea) that include the CSS suggestion like Additional CSS in the customizer: https://i.postimg.cc/9QhLPgVk/image.png. Does everybody has ...
0
votes
0answers
28 views

Reduce number requests to database

I am developing a module that every time the web is refreshed, it reads some values ​​from the wp_options table. My idea is to reduce these reads by caching the values ​​and I have coded the following ...
0
votes
0answers
48 views

Problem with MEMCACHE and Redis with wp_options

I have developed a plugin for worpress but it is giving me problems when I start MEMCACHE o REDIS CACHE. I have been told that the problem is that I am using wp_options directly and that I should ...
0
votes
1answer
23 views

Code snippet to show current php version inside "At a Glance" box in admin

Could somebody provide a code snippet which would show current php version inside the "At a glance" box win Wordpress admin? There are plugins but I'd like to do it with a code.
0
votes
1answer
26 views

How to pass https://achecker.ca/ validator? [closed]

i have to pass https://achecker.ca/ validator for a client without any "known problems" an i recieved this message Success Criteria 1.4.4 Resize text (AA) Check 117: i (italic) element used. ...
0
votes
0answers
34 views

How to display single product on shop page in WooCommerce

I want to display single product page on shop page using specific product id. I need all HTML design of single product page setup by current active Theme. I want to display single product into pop-up ...
0
votes
2answers
38 views

wordpress prepare error

this is my code: $terms = wp_get_post_terms( $listing_id,'job_listing_category' ); if(!empty($terms)){ $sql_terms.=" AND ("; foreach($terms as $term){ ...
0
votes
0answers
25 views

WP search box on page not finding .PDF files

Current marketing person left the business and I'm filling the role for now. Receiving code from search page which formally was able to locate .PDF files by typing in and searching by key word(s.) The ...
0
votes
0answers
18 views

Adding code to send referrer on login page

I have a code i need to add to the wordpress/woocommerce login page function fix_lack_of_referrer_login() { ?> <meta name="referrer" content="origin"> <?php ...
1
vote
0answers
17 views

Adding custom field in all widgets, but at the top of the form, in admin area

I am creating a cute new functionality on my theme that requires to add a custom field to all widgets forms in the admin area. I managed to do so by using the in_widget_form hook: function thefunction(...
0
votes
0answers
20 views

How to insert a link inside a tag page, linking to another page tag

I want to insert a link inside a tag page that will link to another page tag. This is the code (on the answer paragraph): I'm trying to implement the solution found here. This is the code: <?php ...
0
votes
1answer
18 views

Shortcode with loop stacks output

I found some shortcode to display a custom post type, but it's not display how I envisioned. Originally the shortcode only added the title from my custom post type, but I modified it to also show the ...
0
votes
1answer
211 views

Changing the Default New User Notification Email

I've been trying to edit the automatic email sent by WordPress to users when they register for my site. Currently, they register on a form made by the plugin called Forminator. However, the WordPress ...
0
votes
1answer
81 views

Adding a schema code to one specific page using functions.php file

I would like to add a schema code I have generated to one specific page on my website using functions.php file on my child theme. How do I do this?
1
vote
1answer
141 views

How can I upload an image for background use using the Theme Editor in Wordpress?

I'm learning Wordpress from the book Wordpress for Dummies. The author says to open the theme editor then use the style.css sheet. I uploaded the image to the twentyseventeen image folder via ...
1
vote
2answers
444 views

Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();

I'd like to completely disable RSS feeds on my WP website. Can someone please guide me on how to throw a 404.php page and set the headers to 404, when someone types in https://example.com/feed/ here ...
1
vote
1answer
21 views

Nested Code Snippets [closed]

I'm new to wordpress and I'm trying to accomplish the following goal: I have a custom type albums seeded by a plugin and I would like to display this data in a list. I installed the Code Snippets ...
1
vote
3answers
444 views

The custom logo, site title, and description doesn't appear at the same time

The problem I'm having is the custom logo, site title, and description won't appear at the same time. In image 1 below, you can see that with no custom logo, the site title, and description appears ...
0
votes
0answers
65 views

JQuery script working locally on desktop, not working on Wordpress + Divi

So I have to map an image, and I chose to use jQuery. The code works perfectly on my desktop, in the browser, code editors, etc. But whenever I try to port it to the WordPress website I'm managing (...
1
vote
1answer
37 views

code is working properly in Core PHP but writing coding in WordPress

function generate_pdf($array) { header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="sample.csv"'); $fp = fopen('php://output', 'wb'); foreach ( $array ...
1
vote
1answer
31 views

Hide wordpress field if data is empty in post!

I'm using this code to show my field: <?php echo '@ ' . get_post_meta(get_the_ID(), 'Author:', true); ?> When I add a field in my posts it shows it with no problem but for posts that I don't ...
0
votes
0answers
43 views

Wordpress Sticky Post Count "Fix" Breaking Pagecount by 72 pages!

I have a permanent sticky post on my front page and have implemented the code (pasted below) into my functions.php file to stop it adding an extra post to my post count on the front page (it's a grid ...
1
vote
1answer
297 views

How to add an automatic refresh in Wordpress for a Page/Post or an embedded OneDrive/Excel HTML Code?

I have added an embedded Excel sheet on my website's home page. It is always displaying live data which is changing all the time. But when me or my colleagues view that page, they need to refresh the ...
0
votes
1answer
23 views

How to generate random codes that have to be entered to access a Mailchimp form?

I want the code to show up somewhere on my landing page. Users will have to enter it into a form before they can enter their actual details. I've heard that interaction and tiny challenges increase ...
1
vote
0answers
256 views

Changing wordpress publication date to ACF date and time picker date not working

This might be a long post but I want to explain in detail what I'm trying to do and what I've already done. I'm making custom forms using the advanced custom fields plugin and I need to display these ...
0
votes
1answer
169 views

How to display content if user meta data isn't empty with shortcode

I need to display content if user meta data isn't empty Example : [empty_user_meta="last_name"] Show only if last_name is not empty. [/empty_user_meta] Code don't work : add_shortcode(...
0
votes
1answer
890 views

advanced custom fields and contact form 7

I want to use contact form 7 shortcode in advanced custom fields I created field called shortcode with advanced custom fields and put the contact form 7 shortcode in it. it displayed the form as ...
0
votes
0answers
28 views

How can I use javascript in specific posts without relying on a plugin?

I have a few posts needing javascript, but I can't rely on plugins. I know it can be achieved through functions.php, but there's another problem: I don't want the code to be loaded on every page. I ...
1
vote
1answer
936 views

Adding custom styles to dropdown in editor

is it possible to add a custom style to the dropdown in the classic WordPress editor, say a div with the class of "fancywords"?

1
2 3 4 5 6