A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
4answers
34 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
0answers
5 views

How to create table of content from page title tags?

I'm looking for a code snipet for automatically generating a table of content taht i can add inside the php page of the article. Basically the table of content should be generating title tags with ...
0
votes
1answer
18 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 ...
0
votes
1answer
11 views

Different Google Analytics code based on Users Device

Our site has an odd GA set up with two different GA codes, 1 for desktop, another for mobile. (We use dynamic serving of website code to send different code based on User agent.) Now we have a blog ...
0
votes
0answers
5 views

Need to edit Top Ten List plugin so list descends instead of ascending (need 10-1)

I want to edit a wordpress plugin that lets me create a top 10 list. I want to make the list descend instead of ascending. Here is my new site I am working on: [https://freshergear.com/top-10-...
0
votes
0answers
10 views

Create Code Spoiler in the post [duplicate]

My purpose is for foreign language blog. Specifically used for displaying sesame words and examples related to vocabulary. As shown in the picture, the number 1 is in the normal state. Number 2, when ...
0
votes
1answer
29 views

My scripts-bundle.js file is getting sent to the browser as a stylesheet css file. Help!

I'm new to WordPress custom theme development. I am using a child theme for OceanWP. I have a webpack setup to hot-reload my files but my js scripts are not getting sent to my WordPress site instead ...
1
vote
1answer
111 views

Firefox CSS Animations Broke [closed]

After updating to the most recent version of Firefox I am having issues with my CSS Animations. On my website of camerabeanbags.co.uk I have animated buttons where the gradient is animated across the ...
0
votes
0answers
27 views

Need help refining added code in functions.php

I need an extra set of eyes to help me fix code that automatically sets any post to private so only the admin can publish any post draft. The problem I'm running into is that every time a user clicks ...
0
votes
1answer
100 views

Displaying SQL query result from user input via wpdb

I'm a bit stuck with one of my task which is to require a user input for an 'ID no' and it shall go through a table in my WP and display the result on the same page (after hitting Submit). I'm ...
0
votes
1answer
47 views

How To Export User's Custom Fields in CSV or XLSX

Hi Guys I have a BIG problem.. I'm using Eduma LMS and I have 2 type of customers... Some buy single video course, some others buy a membership (managed by Paid Membership Pro). When a user buy a ...
0
votes
0answers
14 views

Thumbail after first paragraph

I try to make future image display after first paragraph with this functions.php code: add_filter( 'the_content', 'insert_featured_image', 20 ); function insert_featured_image( $content ) { $...
0
votes
0answers
12 views

Issue with Transparent Navbar on First Load

This is a test website I am i the middle of created – http://newsite.camerabeanbags.co.uk The issue I am having is that the Top Navigation Menu/header should be transparent when the page is at the ...
0
votes
0answers
16 views

Add panels with images and description in wordpress

Good day! I wanted to add a panel into my website homepage complete with panel heading and body. I also wanted to add an image inside the panel body but I have been very unsuccessful. I have been ...
0
votes
0answers
19 views

Code to insert TAG taxonomy Wordpress

I made a grave error. I delete many TAGs from the database of my blog. Many TAGs were orphaned. And yet, unfortunately, many posts have anchor words that link to deleted tags. That is, several links ...
0
votes
1answer
26 views

How do I prevent Wordpress from eating my code?

I'm writing a guide and putting code examples. If I use the visual editor the code indentation is lost. It will also take some code and strip it out. If I use the text editor I can't ever switch to ...
0
votes
0answers
11 views

How to set serial number in admin panel by using switch case in wordpress?

function custom_order_product_columns( $column, $post_id ) { switch ( $column ) { case 'catalog_dealers' : echo get_post_meta( $post_id, 'catalog_dealers', true ); ...
0
votes
0answers
38 views

load plugin in code snippet

I'm using "PHP code snippet" in my WordPress website to create a "form" so i can read and write back to my database. Is there a way i can make a "text-area" with style editing options instead of ...
0
votes
1answer
27 views

How to code custom special page

I'm looking for how to code custom "special" page as use many plugins. An idea is that I have in theme links to the custom special page. Then admin can chose which of his pages is the one "special" ...
0
votes
2answers
567 views

Wordpress redirect all 404 pages to the Homepage

I want to redirect all 404 error pages on my WordPress site to the homepage, or to a specific page. Any advice?
0
votes
1answer
805 views

Fatal error: Uncaught Error: Call to undefined function get_header() [closed]

Fatal error: Uncaught Error: Call to undefined function get_header() in C:\xampp\htdocs\allegiant\index.php:1 Stack trace: #0 {main} thrown in C:\xampp\htdocs\allegiant\index.php on line 1 I ...
0
votes
1answer
139 views

Open all external links in new window - need help with the code

I'm using this code to open all external links in new window (site is based on Wordpress): /* OPEN ALL OUTBOUND LINKS IN NEW TAB */ function autoblank($text) { $return = str_replace('href=', 'target="...
0
votes
2answers
31 views

Code is providing a row of data but not formatting it as table

I am using the following code: function seconddb() { global $seconddb; $seconddb = new wpdb('username','password','g3boat5_G3_Genba','localhost'); } add_action('init','seconddb'); // add the ...
0
votes
1answer
327 views

Display Data in Table from External Database in WP using Shortcodes

I have successfully coded a secondary database connection for my wordpress site in the functions.php file in wordpress. I have used the following to create shortcode and run the data to my table where ...
2
votes
1answer
509 views

Connect Second Database to Wordpress

I am trying to connect a second database to my wordpress site so that I may ask for data from it and display it in a table on my site. I have tried multiple ways of doing so. I have tried to use php ...
0
votes
2answers
41 views

Search Count Wordpress Theme

I have a code that displays results for search but, I need it to include the count not just keyword searched <h1 class="font-thin h2 m-b"> <?php printf( esc_html__( 'Search Results for: %s',...
0
votes
2answers
47 views

How can I put my own code in a wordpress page?

How can I put my own code in a wordpress page? This happens when I tried to
1
vote
0answers
23 views

I got an issue after i migrated a site

I recently migrated a site to a larger server. Everything appears to be fine, the site works everything transferred over. The site does have an SSL cert. Recently we started to get flagged as unsafe ...
0
votes
0answers
25 views

How to add specific posts to specific pages in WordPress?

How can I add specific posts to specific pages in WordPress using custom fields and not categories? Actually, I want to assign a specific custom field value to different posts and show them on ...
0
votes
1answer
62 views

How do I validate extra pin field on my WordPress login form page?

I have been able to add an extra field to my WordPress login form using the following code inside wp_login.php file, thanks to stackxchange. add_action('login_form','my_added_login_field'); function ...
0
votes
1answer
19 views

Client on iPad accidentally adding <code> tag to posts while writing

A client of mine complains that text gets 'randomly highlighted' when he is writing Wordpress posts on his iPad Pro. He uses the web interface. I got him to stop deleting the 'highlighted' text and ...
0
votes
1answer
73 views

Changing input type from text to multi select dropdown - skill taxonomy

Really need help with a wordpress code please. I have a field on a form which adds tags to the post. Problem is, its free for anyone to enter anything. This keep populating the "skill" taxonomy. The ...
1
vote
0answers
22 views

Is there a way to create embed codes from wordpress/buddypress content?

I am looking for a way to create embed codes for content like, posts, images, videos, comments and buddypress content and components to be posted on external websites and apps. So for instance ...
0
votes
0answers
22 views

Write html code in comments

For example i am writing this html code into comment textarea <pre><code class="language-php"><?php echo esc_html( get_post_meta( get_the_ID(), ‘_spp_count’, true ) ); ?></code&...
0
votes
0answers
38 views

'[code]' shortcode to markup programming code does not work

I have been trying to embed some simple code on a practice blog and it has no effect other than to display the tag as text. I am aware there is no code in the image but believe me I have tried. The ...
1
vote
0answers
11 views

How to save inputed data in a textbox [EDITED] [duplicate]

This was asked before. I am re-posting it, edited. So I am making a website using WordPress, and I wanted to make a text box that saves something that is typed in it. Let me explain: Users (signed ...
0
votes
0answers
15 views

Code for cron to delete posts that contain specific expression (e.g. “unable to fetch” every 30 minutes

Please does anyone know a code that can automatically delete wordpress posts that contain a specific phrase? I want to execute it in a cron to delete such posts at regular intervals say 30 minutes
0
votes
1answer
4k views

admin-ajax.php 400 bad request - whats wrong with my code?

I'm getting a 400 bad request from admin-ajax.php & warnings from pagespeed insights tell me it's an issue. Can you see any obvious issues in the code in our admin-ajax.php file? <?php /** * ...
0
votes
1answer
29 views

How to change the link on the logo at the menu?

I'm working on my site, it been done with a site builder so the logo on the menu has a default link to my homepage, but I need to change this link so it goes to another page instead of the default ...
0
votes
1answer
387 views

Updating User Meta using Theme My Login with Custom Fields

I am trying to create a better login and registration form on wordpress. I have installed TML by Jeff and it works wonderfully. However, I am trying to further extend the registration form. I have ...
0
votes
1answer
24 views

Disable File Editing function

Researching fixing errors while validating my site, I got brave and clicked Enable button at Appearance > Editor and went pass the "warning" - now getting nervous bc don't want to accidentally mess ...
1
vote
1answer
116 views

Wordpress change Language not working

My issue is, that I want to change the Language to German (de_CH) and BBPress etc. should change the language too. I know not all Plugins are available in German. However whatever I do, add them ...
0
votes
1answer
17 views

Table styles disappear when updating content

The tables on my website all have custom code for their style. Lately, when I go in to edit the content of the table (not the code), the style will completely disappear on the webpage when I update it....
0
votes
2answers
85 views

Drop down list code for sidebar

For starters, I'm not a programmer but I'm good at cut and paste. :) I want to create a drop down list that displays each post and I've done that by putting this in my functions.php child theme file ...
1
vote
1answer
56 views

Insert custom PHP head above <html> in WP pages

I've made a WordPress site. Before, I had a coded site in HTML. My new WordPress site is still in maintenance mode. But, I want to insert a PHP code above all the website content. This is my code: &...
0
votes
1answer
42 views

How to do a code in php and have text before it? [closed]

So I have this code: the_title() And I am trying to add some text before it. So, it would end up like this: PAGE TITLE: (page tile) => PAGE TITLE is what I am trying to add before my code. However, ...
0
votes
2answers
73 views

WordPress code problem [closed]

I have this code shown in the picture on top of the search bar. It appears on all pages. I have checked all the plug-ins and it is still there. I don't know what to do next.
0
votes
1answer
15k views

how to remove the top navigation bar or header top on wordpress website?

My website (bargainbosss.com) all of a sudden started displaying a navigation bar at the top of the website. I don't have that menu option checked, only a primary menu. I can't figure out how to ...
0
votes
0answers
21 views

Manage recurring event time

Hello I'm trying to make a list of medications, the time to take them is recurring so I must have a repeater and an opening time. So I created it as follows: <form action="#"> <input ...
0
votes
1answer
3k views

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'greenday_head' not found or invalid function name

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'greenday_head' not found or invalid function name in /home/xnvrtebr/public_html/Blog/wp-includes/class-wp-hook.php ...