Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

need.htaccess 301 redirect code for any pages starting with //www.example.com to home page of //example.com

I would like to add an one catches all .htaccess 301 redirect code for any (old)url starting with https://www.example.com to the home page of https://example.com. (without www.) The permalinks are not ...
0
votes
1answer
21 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
24 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
28 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
10 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
12 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
13 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
1answer
16 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
16 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
28 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
0answers
12 views

Request to amend the code to work on my site code on WordPress?

Brother, I installed a code I am facing a problem He’s doing well here But the problem is when I put a picture of the article uploaded And everything is fine And when I click to add it it does not ...
0
votes
1answer
29 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?
0
votes
0answers
9 views

Use one upload folder for multiple sites WordPress

I've a question about use one /uploads/ folder instead of multiple. We've a huge uploads folder because of the many content that has been created in all the years this website is live. The main site ...
1
vote
1answer
33 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 ...
0
votes
0answers
7 views

Pasted carousal code doesnt show pictures while original post shows

I have elementor carousal on a page made by elementor.I need to copy paste the caruasal to a custom post type.The costum post type doesnt support elementor.So, I must add it with code editor by copy ...
0
votes
2answers
122 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
12 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
173 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
42 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
30 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 ...
0
votes
0answers
10 views

I want to show the codes written with the <pre></pre> tag in color. How can I do that?

When I add code with the <pre> tag, the color of the codes is black. I saw it in color on some sites and realized that this can be done with the plugin. But I don't want to use plugins. Is there ...
1
vote
1answer
25 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
16 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
68 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
18 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
166 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
96 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
0answers
12 views

Uploading bulk product images to wordpress through CSV

I want to upload product image to Wordpress, but the main problem i am getting is i am using images from external website and the issue i am getting is. For example i want to upload 2 images i am ...
0
votes
1answer
197 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
34 views

How to display file types for Woocommerce products that can be downloaded on one product page

How to display file types for Woocommerce products that can be downloaded on one product page I use the plugins woocommerce and wcvendor because the product on my site is uploaded by the seller with a ...
0
votes
0answers
19 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 ...
0
votes
0answers
27 views

Add/remove post ID to User Meta on the click of a button

I'm wondering if it's possible to update user meta via front-end, maybe with Ajax... The purpose is to create a custom user meta that stores post IDs that users set as "Add to list" or "...
0
votes
0answers
46 views

“use of cookies” consent AMP and HTML

I've searched everywhere - searched by plugins for WordPress, searched Google, but found nothing that would work. There's a website with active AMP web pages. Could you please advise (code, plugins) ...
1
vote
1answer
376 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"?
0
votes
0answers
55 views

How to increase width of code block in WordPress blog?

I am new to writing blogs on WordPress and facing when adding code snippets (Java/Scala code). Whenever I add code snippet and choose codeblock in the blog, since width of code block is too small ...
0
votes
0answers
89 views

Change page post status based on acf field value

I’m kinda newbie to coding, I have just made a new wordpress site that uses advanced custom fields on backend (all fields are global fields in added options menu) from where front end pulls the values ...
1
vote
1answer
143 views

How to make this WP_Query run faster on a WordPress website?

This code is part of a custom WordPress homepage that shows the 7 most recent posts using WP_Query, and the first post has a custom html structurer, while the rest has another html structure. Then ...
0
votes
1answer
23 views

How to put 2 php codes in functions.php without site crashing

I can use either the php script for a menu <!-- menu --> <?php function wpb_custom_new_menu() { register_nav_menu('my-custom-menu',__( 'My Custom Menu' )); } add_action( 'init', '...
1
vote
0answers
43 views

How to remove all comments from JS, HTML, CSS files?

How to remove all comments from JS, HTML, CSS files? I found this to remove comments from HTML, but is there a straightfoward way to do it also from all included JS and CSS files?
0
votes
0answers
12 views

how to display the number of posts in different on pages 1, 2 and 3

I want to create a page that displays the following number of posts. Page 1 or home = 7 posts Page 2 = 5 posts Page 3 and so on 15 posts. What is the code to display it?
0
votes
0answers
17 views

Change code URL

is it possible to change to the url of images on the code source i'm finding a problem with redirection so the best thing to do is to begin all the image src url with /wp-content/
0
votes
0answers
101 views

Download button for all gallery images in WooCommerce product page

I'm trying to figure out a code to download all gallery images under each and every product with one press of a button. Thanks! Regards Rasmus
0
votes
1answer
54 views

Call to Action Button - Resize Help [closed]

I need help with resizing the "free quote" action button on my website. It is placed on the menu on the right top corner. I need to resize it to smaller size so that it fits the size with other text ...
1
vote
1answer
421 views

How to get the POST TITLE using the POST ID?

I made a page with several POST IDs that I get from the Table of a plugin. Now the page is showing like: 3249 3250 3251 3252 (Post IDS) I wanna show the title of those IDs like 3249 - POST TITLE ...
-1
votes
2answers
56 views

I want to add the alt attribute to all the photos!

Hello everyone and I found you well, I have a problem with a dynamic site that contains over 200,000 photos, it is a news site. The site is built on the WordPress platform and has many changes to suit ...
0
votes
2answers
529 views

How to run wp cli from a wp hook?

How can I run a wp cli command when a wordpress hook is called on my website. On user registration hook, I would like to run a wp cli command to activate a license.
0
votes
1answer
39 views

&nbsp; &nbsp; &nbsp; &nbsp; out of nowhere

Something is inserting four non-breaking spaces into my single.php code, but I can't find the cause at all. I have already tried to disable all plugins and restore the theme's initial settings. Link:...
0
votes
1answer
38 views

How set a while with a function

i have a simple function and i need that while it execute my function it set a variable to true, otherwise false. the execution would be my condition. while run this func function need() { ...
0
votes
4answers
2k views

how to edit source code of specific page in wordpress?

i am taking a hard time to figure how to do it. I have three different pages in my wordpress installation besides the Homepage. I need to edit each one of them separately, remove header, footer and do ...
0
votes
1answer
85 views

How to escape html generate by a loop

I have the following code which is flagging a warning that I've been asked to fix by my theme reviewer. WARNING All output should be run through an escaping function (see the Security sections in the ...

1
2 3 4 5 6