WordPress

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL for creating websites and blogs. Features include a plugin architecture, a template system and strong management, customization and search systems; through its dynamic presentation of content, webmasters have the flexibility to create websites easily.

Share tech news, updates, or what's on your mind.

Sign up to Post

I need to display and image on the single product page of Woo Commerce.  However, when I use this function nothing is displaying it seems my problem is how I am referencing the image.  The image is in the media library.

add_action ('woocommerce_after_add_to_cart_button', 'display_calif', 10);

function display_calif() {

if ( has_term( 'california', 'california_temp' ) ) {
echo '<img src="/wp-content/uploads/2019/01/california.gif" />';
        }
}

Open in new window


Please tell me how to reference this image.
0
Build an E-Commerce Site with Angular 5
LVL 12
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

I have a javascript button at https://www.theherbsplace.com/rebate-program/ it is found at the bottom of the page.

Here is the code
<script>
document.getElementById("order_comments").innerHTML = "I want membership";
</script>

Open in new window


<p><a class="button exclusive biz-op-button" title="I Want Membership!" href="#" data-register="true">Get My Membership</a></p>
<p class="form-row notes" id="order_comments" data-priority="">
    <label for="order_comments" class="">Order notes&nbsp;<span class="optional">(optional)</span></label>
    <span class="woocommerce-input-wrapper">
        <textarea name="order_comments" class="input-text " id="order_comments" placeholder="Notes about your order, e.g. special notes for delivery." rows="2" cols="5"></textarea>
    </span>
</p>

Open in new window


The button works fine but I need it to change colors and text on click.  This is so the customer will know their request has been logged.

I am not very strong in javascript.  I see on the net some examples but I don't know enough to fold them into what I already have working.

Thanks,
0
Hello,

I need help modifying my WordPress XML feed.   Currently, I am using the WP Job Manager plugin, and have a custom rss feed for a client.

For one of the fields,  they require only the city, but it outputs as city, state, country. see below.

<cityHiring>
<![CDATA[ Wheatland, WY, United States ]]>
</cityHiring>

Changed to this:
<cityHiring>
<![CDATA[ Wheatland ]]>
</cityHiring>

So basically i need everything after and including the first, to be removed.

In the theme code, the field has this PHP
echo $the_job_location;
				?>
		</city>

Open in new window

0
We're using WordPress for our Extranet site which is stored on servers outside of our organization.  We usually upload files to the site that users can download by clicking on a link.   Problem is every time we update a document we need to upload it again.

Is there a way to create a WP link that references a local file on our servers. ?     The computers that are accessing this site are all on our network and would have access to this location.

Thanks ….

Joel
0
Hi there, I'm trying to put a theme shortcode in my wordpress template file.

I'm getting the following error "Parse error: syntax error, unexpected 'echo' (T_ECHO) in /www/wp-content/themes/enfold/includes/loop-big6.php on line 30"

test website here
<?php
global $avia_config, $post_loop_count;

$post_loop_count= 1;
$post_class 	= "post-entry-".avia_get_the_id();



// check if we got posts to display:
if (have_posts()) :

	while (have_posts()) : the_post();
?>

		<article class='post-entry post-entry-type-page <?php echo $post_class; ?>' <?php avia_markup_helper(array('context' => 'entry')); ?>>

			<div class="entry-content-wrapper clearfix">
				
				<img class="vv" src="https://idgiyn5kp0-flywheel.netdna-ssl.com/wp-content/uploads/2018/04/CreteCarrier_OfficeBlueShirt-1500x430.jpg" alt="rr" width="100%" height="230px" />
				
				<?php if ( $apply = get_the_job_application_method() ) :
						if ( $apply->type === 'url' ) {
							$application_href = $apply->url;
						} elseif ( $apply->type === 'email' ) {
							$application_href = sprintf( 'mailto:%1$s%2$s', $apply->email, '?subject=' . rawurlencode( $apply->subject )  );
					} ?>
				<?php endif; ?>
				
				 <?php echo do_shortcode('[av_one_third first margin="0px" padding="0px" radius="0px" mobile_breaking="" mobile_display="" av_uid="av-y5kp57"] 
					 <a class="application_button 

Open in new window

0
I have some reports that are generated from our WordPress sales app and I'm changing the way the room selections work.

I need to know what the code below is doing, or more specifically, layman's terms of the syntax - $selected_czar_room = ($_POST['czar_room'] == 'default') ? '' : $_POST['czar_room'];

I know it's getting room info from the post and then setting a cookie and expiration, but the behavior of the cookie is different with my new room selection code that pulls the rooms dynamically from the DB instead of being hard-coded in the page. With it hard coded, the cookie "resets" if I change the room. With it selected the new way, the cookie does not reset and the report will pull from the previously selected "room".

So what is the code "saying" here - > $selected_czar_room = ($_POST['czar_room'] == 'default') ? '' : $_POST['czar_room'];
As in, set this variable ($selected_czar_room) to equal the post value of 'czar_room' ,,  and then I'm lost
I don't know what == 'default') ? '' : $_POST['czar_room']; means.

Thank you!

if ($_POST['czar_room']) {
            setcookie("ROOM_TP", ($_POST['czar_room'] == 'default') ? '' : $_POST['czar_room'], time() + 365 * 24 * 60 * 60, "/");
            $selected_czar_room = ($_POST['czar_room'] == 'default') ? '' : $_POST['czar_room'];
        } else {
            $selected_czar_room = $_COOKIE["ROOM_TP"];
        }[code]

Open in new window

[/code]
0
I am having a problem with Woocommerce new categories not showing the products.  To test what is going on I created a new category called Promotions and put one product in it.  But as you can see I am getting this message.

https://gyazo.com/305a1237d267847a67a0df6cfae84f8a

Here is the product as you can see I have Promotions ticked

https://gyazo.com/7e725a8a3c16193de3af3877a7ce08f5

When I click on Chrome Console this is what is showing up.  Unfortunately, I don't know how to correct these issues.

https://gyazo.com/1a6efa8cc5d613472413ffbe3fbfbhttps://www.experts-exchange.com/askQuestion.jsp?headerLink=ask#1c8

This is an active site and I just discovered today that categories wasn't working.  I have disconnected any new plugins since the last time I checked out an individual category.

Please help me to solve this issue.

Thanks,

Randal
0
My client has reported a website header display issue occurring only on iPad, but I don't have an iPad and can't replicate the issue using the iPad responsive mode in Chrome dev tools. I think the main navigation menu may be wrapping down below the logo and title.

Would someone with an iPad please try to view the site (landscape and portrait) at https://www.u3ahastingsnz.org.nz and see if you can replicate the issue?

Please share the model of your iPad, and if you can replicate the issue please provide a screenshot. Thanks very much!

The navigation menu should look like this (and the menu should collapse to a mobile menu on smaller screens):
Screenshot of how the header should look
0
I am having trouble finding out how to do routing with PHP.

I know WordPress and Laravel use it, but I was wondering how to code it.

I realize it would use Apache mod rewrite, but I'm having trouble figuring out how to do routing without a framework in PHP.
1
Does following a podcast normally require you to create a new podcast?

I host my podcast at PodBean, and generally feel like I made a good decision. I assume after I get some traffic, I could consider hosting on my WordPress site...we'll see.

For now, I have given my Podbean URL on a business card to over a hundred people who were really interested in following me. But, according to Podbean, none has shown up as a follower.

The thing abut Podbean, to follow a podcast, you need to create your own podcast. And I fear this is scaring away so many people that otherwise would follow my podcast.

What do you know about hosting my podcast differently so that to follow, you simply click follow. This lack of engagement may be seriously killing my podcast. I mean people tat were really engaged, who got scared away when they were forced to create a podcast.

I distribute on iTunes, Google Play, Youtube, and soon other sites as well.

Have you ever heard of this? I wold consider switching, simply over this requirement. I am stunned that no one has followed my podcast, considering I have given my business card to over a hundred people who saw my presentation and were amazed.

Thoughts?

Thanks
0
Rowby Goren Makes an Impact on Screen and Online
LVL 12
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Need help on making a good Blog: http://www.free-ride.org/

Got this domain from Google Domain.
I am unable to post new blogs on it.
I am finding it hard to edit and make a good video and Picture and multiple pages on thishttp://www.free-ride.org/ Blog.
0
Website"http://bringurbag.com/" does not load on the mobile phone.

Registered domain on names.org.
Hosted on:- technical@infinityhosts.com
Used a free template provided by hosting company.

Images are minimal(downloaded from the free web sites)

I am not sure why? To me, it does not seem to be too heavy.
If yes then how to resolve it.
0
Hello MySql experts.

I am trying to import a Wordpress table that I exported to a new Wordpress site, using Phpmyadmin, via the "Import" tab.   It's a .sql file.

When I try to do the import I get an error that says "#1050 - Table 'wp_posts' already exists" .

That is because, of course the wp post file does indeed already exist.  I just want to either overwrite that table, or append to that table.  

I assume I must either import using a "Run Sql" query  or modify the sql file.  

Thanks!

Rowby
1
Hello Experts,

I am working with 2 versions of a website.

test: http://test.techcarre.ca/test/en/ 
live: http://cassecroutedenhaut.ca/en/ 

You will see that on the test site after the navigation menu the slider has text that is animated, but on the live there is no text. I am told that the animation had disappeared when migrated from test to live. The designer had used for this the Revolution Slider plugin.

You will note that on the frontend of both sites there are no relevant JS errors, but in the backend when I go in to the Revolution Slider I see the following error on the live site, whereas the test site is error free.

JS Error
I have not used the Revolution Slider before.

Any help will be greatly appreciated.
0
I'm using the latest version of WordPress (5.0.2) with Gutenberg.

I'm writing a blog post on SQL, and I want to use backticks everywhere possible.

The problem is when I use a backtick inside of a <pre> tag where I write code, it seems like once a word is enclosed in backticks it highlights the word and the backticks disappear.

I'm using the codeprettify plugin.

Any idea how I can write backticks in my blog post?
0
Hi there,

I currently have a WordPress website,  which is using the WP-Job Manager plugin on the home page.

Everything is working as it should,  but not just learned that we cannot hire out of California.   I've taken out all the jobs we have for that, but we also have a sticky job which always appears at the top of the listings, regardless of what city, state, zip code is entered.
the sticky job location is just USA, and uses google api, so it will appear top of any location entered.

I just cannot hide it for California.

I was wondering if anything had similar problems or different solutions.   Maybe, if California was typed, a Javascript alert box appears, saying we don
t hire from California?  

Just at a loss as for how to fix this.  Any ideas?

<< Website >>
0
I am needing to improve my website speed and running gtmetrix I get this message with a grade of F in this category

Avoid bad requests 	
F (0)
	Content 	High
What's this mean?

The following requests are returning 404/410 responses. Either fix the broken links, or remove the references to the non-existent resources.

    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/pickadate/default.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/pickadate/default.date.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/pickadate/default.time.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/select2/select2.min.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/um-account.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/um-crop.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/um-fileupload.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/um-fonticons-fa.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/um-fonticons-ii.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/um-members.css?ver=2.0.35
    https://www.abc.com/wp-content/plugins/ultimate-member/assets/css/um-misc.css?ver=2.0.35
    

Open in new window

0
Images no longer Hyperlinked?

Each time I add a new image to a Wordpress post they now simply get added s an Image? They used to automatically be hyperlinked so if you clicked on the image it would open larger in another window.

Where has that been disabled? How can I turn the back on?

for example see this post the top image was added recently, the bottom image was added a long time ago? ones hyperlinked the other one is not?
0
This question is more of an opinion :
I have created a very complex plugin built of many functions which are not dependent on each other.
I am thinking of splitting the plugin multiple small plugins with their proper description.
Will splitting this cause the the WordPress system to overload ?
Thanks
0
HTML5 and CSS3 Fundamentals
LVL 12
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Wordpress - I am trying to add three button links to three separate websites and have like to have them evenly spaced horizontally on one line.

SO far I can't seem to figure out WHERE to do this.  I am helping a friend with a Wordpress website that I did not create (and the friend did not do this either).

I actually added the wording "Follow us on Facebook and Instagram" but have had no luck trying to add the logos which will become links.

I attempted to do this under "Theme Options - Footer Settings" and Appearance - Editor - "built-in CSS Editor" and at times some of the coding was visible but not the logos. I have the logos in the Media Library and know that Wordpress has a strange way of linking to the images to begin with.

I don't usually work in Wordpress but am familiar with PHP, and HTML.

Below is a screenshot of the area where I would like to places these logos and would like to put them just under the wording that says "Follow us on Facebook and Instagram".

Thanks

Website Screenshot of Footer area
0
Has anybody here managed to do a PUT request (any language) to the Wordpress Rest API for an ADVANCED custom field?.
I managed to perform a PUT request to Wordpress Fields but tried to do a simple PUT to an acf?
(get works fine).
I use postman to do my testing.
maybe I don't understand the syntax.
the error does not help me and gives me:
{
    "code": "cant_update_item",
    "message": "Cannot update item",
    "data": {
        "status": 500
    }
}

herre is a psuedo Pseudo api url
with the PUT request to show my syntax (assume I authenticated with basic authentication).

 https://somewebsite/wp-json/acf/v3/pages/735?dog_name=somthing


Thank You
0
I am trying to update a custom filed using put requests in POSTMAN
I manage to update the page title slug or any filed which wordpress created.(fields)
For example I have :
if I do a get request :
https://breeding-portal.mystagingwebsite.com/wp-json/acf/v3/pages/735
you will see :
{
    "acf": {
        "dog_name": null
    }
}

What I want to do is update dog_name I have tried multiple solutions.
the PUT request echoes :
{
    "code": "cant_update_item",
    "message": "Cannot update item",
    "data": {
        "status": 500
    }
}
Anyone solved this ?
0
This issue is about disabling the "Submit button" or form submission subsequent to an original submission while it's running the request of the database, but re-enabling after the results are displayed. The issue is that the report doesn't really show that anything is going on during a date range selection, and the users click submit multiple times, hence, resubmitting the request and spiking the DB server CPU and potentially freezing the app.

I have several custom report pages in WordPress ( I did not design them and the developer is long gone). When they are called, by default they show results for "today". At the top of the page, there is a date picker that the user can choose to pull a report (displayed on screen) within the date range selected. The date picker has a submit button that jQuery catches and runs the same page code in the themes Functions file, but with the selected date range instead of "today", and then re-displays the results on the original page.

I need to be able to disable the date pickers submission if there is one already in the works and only re-enable once the page has displayed the previous request results.
I will include as much of the current code as possible so you have something to see.

***EDIT***
Upon further investigation, the "Submit" link/button has a class of disable that prevents the form from being submitted without dates entered in the date picker range.
It is removed by jQuery when both fields have a date …
1
I have a bunch of JQUERY UI files that load in the footer of my wordpress site.

These files are in my wp-includes/js/jquery/ui folder, is it bad if i minify + combine all of these files?

I tried to put this in my functions.php but it wasnt working. How can i get rid of wordpress from loading all of these UI scripts and load my combined file?

if(!is_admin(){
wp_dequeue_script(' autocomplete '); //url wp-includes/js/jquery/ui/autocomplete.min.js
wp_dequeue_script(' core ');  //url wp-includes/js/jquery/ui/core.min.js
wp_dequeue_script(' menu ');  //url wp-includes/js/jquery/ui/menu.min.js
wp_dequeue_script(' position ');  //url wp-includes/js/jquery/ui/position.min.js
wp_dequeue_script(' widget ');  //url wp-includes/js/jquery/ui/widget.min.js

wp_register_script(' combined-script', 'wp-includes/js/combined-script.js', '1.0.0'); //register script
wp_enqueue_script(' combined-script '); //hooks into add_action


}
0
I have our WordPress site hosted on AWS and on relatively small VM's and low power RDS database.  This is usually enough power for our use (this is internally accessed Wordpress Site). However, on occasion (couple to several times a day) my RDS database will spike the CPU. The connections rise up as well indicating multiple large queries are being submitted. At times, this behavior will extend for several minutes and at times it will cause the search function, or the entire site to become unresponsive. I have discussed this with AWS support and they believe that just throwing more compute power to it, isn't going to really help.

I have narrowed this down to an extent as our users search on phone numbers or names and such. If they get impatient and hit the enter key several times after entering a search query, this causes subsequent search queries to the database. The search usually has to go through 8million + metadata records to compile results, so you can see how this is an issue.
I believe we may have the same issue on other types of submissions as well, but a fix on this one will get me a head start.

What I need for Wordpress, is a code snippet that disables submission of subsequent entries once the first one has fired and the page is waiting for the results before it reloads to a results page.

Thanks for your help!
0

WordPress

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL for creating websites and blogs. Features include a plugin architecture, a template system and strong management, customization and search systems; through its dynamic presentation of content, webmasters have the flexibility to create websites easily.