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

Hello,

I feel with every update my word press page gets moved out of alignment.   All of the sudden on my mobile everything is pushed to the right, but it looks perfect on a PC. Can someone please assist?  See attached for what the page looks like on a mobile phone. Home page looks good its all my pages with posts that do not. The example is on:
http://wise-eats.com/podcastclips/website example
0
Bootstrap 4: Exploring New Features
LVL 13
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

I have used this code here:

https://codex.buddypress.org/developer/loops-reference/the-members-loop/

and I want to filter users by certain criteria. The example for the bp-custom page is:

function my_custom_ids( $field_name, $field_value = '' ) {

  if ( empty( $field_name ) )
    return '';

  global $wpdb;

  $field_id = xprofile_get_field_id_from_name( $field_name ); 

  if ( !empty( $field_id ) ) 
    $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id;
  else
   return '';

  if ( $field_value != '' ) 
    $query .= " AND value LIKE '%" . $field_value . "%'";
      /* 
      LIKE is slow. If you're sure the value has not been serialized, you can do this:
      $query .= " AND value = '" . $field_value . "'";
      */

  $custom_ids = $wpdb->get_col( $query );

  if ( !empty( $custom_ids ) ) {
    // convert the array to a csv string
    $custom_ids_str = 'include=' . implode(",", $custom_ids);
    return $custom_ids_str;
  }
  else
   return '';

}

Open in new window


Example Usage: Get all members who have filled out the xprofile field ‘dogs’ and selected the value ‘poodles’.

<?php if ( bp_has_members( my_custom_ids( 'dogs', 'poodles' ) ) ) : ?>

Open in new window

How do I add more conditions to the dogs/poodles. What If I also want 'birds', 'parrot' as well as 'dogs', 'poodles' ?
0
Hi there,

I have an issue with my woocommerce mini cart.

The issue I have is that there are a few items that seem to be stuck in the cart no matter if you are logged in or not. If you try and remove them, a few seconds later they appear again.

I thought It might have been outdated plugins and template files, so I have backed up my site and updated everything along with all the template files, still the same issue.

My website is www.ingeniousgifts.co.uk and you can access the slide out mini cart from the top right of the screen.

I have attached a screen record so you can see what happens.

I would really appreciate if someone could help me find out why this is happening and how to fix it?
Home---Ingenious-Gifts.webm
0
All of the sudden my posts do not show up properly and my navigation drops and you cant see it. I am a novice at WordPress, can someone please assist? The posts are all on the default template set up, which is what I have always used. The facts its affecting every page (other than the home page) makes me feel a setting is off.  Can someone please check out the site and advise?  Thank you!!

**UPDATE I figured out the posts but my navigation isnt showing in the proper spot on all pages except the home page like it use to. Is it maybe too many words?
wise-eats.com
0
this is a  follow-on to this question
https://www.experts-exchange.com/questions/29145248/Need-Custom-Short-Code-For-WooCommerce.html

Open in new window


The image is too large to be useful.  So, is there any way to programmatically create a short-code that does everything in the previous question but uses a thumbnail instead?

I found this
https://wordpress.stackexchange.com/questions/235313/add-the-post-thumbnail-url-to-a-shortcode-in-function-php

Open in new window

but I am not clear how to design what I need.
0
I need a shortcode for WooCommerce 3.6.2 that will show the image, price and add to cart button.  I found this shortcode [add_to_cart id="1984"] but it only shows the following:

https://gyazo.com/c1efad0e35b85a05227db4941ff6cd62

I saw this
https://stackoverflow.com/questions/19930779/woocommerce-custom-shortcodes

Open in new window

discussing how to do a custom shortcode via php.  I know some php but I am not that clear how to create what I am needing.

Thanks,
0
WordPress and Azure?

I hope to create a WP site as a hobby, since I just never got around to learning PHP. But, as a .NET Developer, I also want to get my hands dirty with Azure.

Does it make sense to do this? Eventually, I would expect to host the WP site, but have no idea of what it might cost to so this. I mean, host WP on Azure.

Any idea what it might cost for a low-traffic WP podcast hosted on Azure?

Or, if this is a really bad idea, please tell me.

Thanks
0
Hello and thanks in advance for any insight the community can provide. I'm working on a WordPress site hosted on GoDaddy's Business Launch Hosting Plan, so it's a Linux  environment.  The challenge I have is with trying to use a SQL query to display data from an external MS SQL server to the WordPress site.
 
When I started looking into this, I wanted to use a plugin (WPDataTable) to do this. I cleared one error when trying to connect to the server by enabling pdo_sqlsvr. Then I received the following error:

wpDataTables could not connect to mssql server. mssql said: There was a problem with your SQL connection - SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver 13 for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver 13 for SQL Server for x64: http://go.microsoft.com/fwlink/?LinkId=163712

I called GoDaddy to see how to resolve the error. They said our website would need to be hosted in their Windows environment (Plesk) in order to communicate with a MS SQL server, otherwise, I'd have to export data from MS SQL to i.e., CSV to then import to MySQL.

- Someone today (not godaddy) said there's potentially an option if I had root access to set up Microsoft’s freetds configuration, which I'm pretty sure I don't have through Godaddy (we're not on the VPS hosting plan) and this goes beyond my level of expertise.
- I'm assuming that whether attempting to do this with a plugin, or writing code, MS SQL server…
0
Can anyone recommend a Wordpress plugin or combination of plugins that would do the following preferably using gravity forms and possibly as free or cheap as possible :)

- When a form is filled out on the front end it should email the website owner
- it should store the record in the database and create a 'ticket' for that request that can be replied to from the Wordpress backend. The user does not need an account to submit the form and the tickets will only be for the site administrator
- automated follow up emails to be sent to the person who filled out the form at set intervals until the ticket is closed
0
Hello, As the title states, I am tying to list the taxonomy categories for a specific custom post type created by this plugin, here is my code so far, no luck.


    <select name="event-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> 
    <option value=""><?php echo esc_attr(__('Select Category')); ?></option> 

    <?php 
        $option = '<option value="' . get_option('home') . '/category/">All Categories</option>'; // change category to your custom page slug
        $categories = get_categories( array(
			'orderby' => 'name',
			'order'   => 'ASC',
			'taxonomy' => 'firm_type'
		) );
		
        foreach ($categories as $category) {
            $option .= '<option value="'.get_option('home').'/category/'.$category->slug.'">';
            $option .= $category->cat_name;
            $option .= ' ('.$category->category_count.')';
            $option .= '</option>';
        }
        echo $option;
    ?>
</select>

Open in new window

0
Become a CompTIA Certified Healthcare IT Tech
LVL 13
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Hi there - I have an urgent issue which could lose me a customer if I don't get it resolved this evening. Hope someone is able to help with this.

I had a new CentOS 7 server built for a customer and have moved all their websites to it. They are all Wordpress sites and all (on the old server) used to use MySQL databases. It was a CentOS 6 server. The new server uses MariaDB which I believe works the same as MySQL.

One of the files on the site has this PHP code in it:

<?php
//      CONNECTION DETAILS
        $dataHost_EMO = 'localhost:3306';
        $dataUser_EMO = 'overall_emo_adm';
        $dataPass_EMO = '@1}Zq!!?6]M?_EMO';
        $database_EMO = "overall_emo";

//      Connect to MEMBERS DATABASE
        $connect_EMO = mysqli_connect( $dataHost_EMO, $dataUser_EMO, $dataPass_EMO, $database_EMO );
        if (!$connect_EMO) { die('Connection to db failed because... '.mysqli_error( $connect_EMO ) ); }
//      else { echo "Connected to MEMBERS DATABASE"; }

        // echo "project_emo/connection_for_emo.php HAS BEEN INCLUDED"; 
        // die("TESTING Connection");

?>

Open in new window

The error message "Connection to db failed because..." comes up. Head scratching moment.

I have made sure that the password matches the username in the config.php file and anywhere else I can find it, including in the above PHP code.

If anyone has a suggestion I would be so grateful!

Many thanks
Chris
0
I am showing child page titles as links but I want to have each word on a new line ie:

 Some 
Button

Open in new window


But it is showing as

Some Button

Open in new window


<?php
if ( $post->post_parent ) {
    $children = wp_list_pages( array(
        'title_li' => '',
        'child_of' => $post->post_parent,
        'echo'     => 0
    ) );
} else {
    $children = wp_list_pages( array(
        'title_li' => '',
        'child_of' => $post->ID,
        'echo'     => 0
    ) );
}
 
if ( $children ) : ?>
  
        <?php echo $children; ?>
   
<?php endif; ?>

Open in new window


I tried to do this with CSS in many different ways but it either didn't work at all or did not give me the exact result I wanted. I also thought to use php explode but $children is outputted as <li> and not an array as far as I can tell.

In case there is a css solution, the html output is:

<li class="page_item page-item-952">
     <a href="http://localhost:8888/myurl/myotherurl">Some Button</a>
</li>

Open in new window

0
WooCommerce / WordPress over ride a Plugin function.  I always seem to run into trouble when I try to over ride a plugin function. I have a plugin that makes a Woo Product category password protected.  It is an open source plugin from GIT.  I want to customize the password form.  The form is in a function inside the functions.php file of the plugin.
The Plugin Method
<?php
function wcl_get_the_password_form($category_id = false)
{
//  DO STUFF
}

Open in new window


My Method inside of my child theme functions.php:
<?php
add_action('wcl_get_the_password_form','mogo_password_form');

function mogo_password_form($category_id = false)
{
//  DO STUFF
}

Open in new window


This is the Plugin link: https://wordpress.org/plugins/wc-category-locker/
0
I am running wordpress 5.1.1 and WooCommerce 3.6.1 on a LInux 2 Amazon instance and I had a message that my db needed to be updated for WooCommerce. I opted to begin the process and this message popped up.

WooCommerce database update – WooCommerce is updating the database in the background. The database update process may take a little while, so please be patient. 

Open in new window


This message has been up for 24 hours now and I have a small store of 1400 sku's.

I have attempted the following:
1. restarted maria
2.  deactivated and activated woocommerce
3. checked the memory in wp-config which is set at 1024 MB
4. restarted Apache

How can I get rid of this message?  If the message isn't a problem how can I be assured the db integrity is intact?

Thanks,
0
Hello,  I'm having a litle trouble with the CSS on our location map.  I'm using the WP Google Maps Pro, and had an update. Now if you click on any of the locations, the popup is all squashed together.  

How can i target just the popups, so they are formatted nicely?

Here is the website
0
I want to show different sidebars on different pages or somehow show the sidebars on each page when editing in the backend  so they can be selected from a dropdown perhaps. I don't know if this is baked into Wordpress and just needs some code in the page to enable it or if this is a more complex task. I don't want to use a plugin unless I really have to.

I had some conditional logic in the page at the moment but this is a bad idea because the pages can be deleted and recreated with a different ID etc.

     <?php 
    
        if($pageID === 18) {
            get_sidebar( 'sidebar-1' ); 
        } else if($pageID === 16 || $pageID === 68) {
            get_sidebar( 'sidebar-2' ); 
        } else {
            get_sidebar( 'sidebar-3' ); 
        }
        

     ?>

Open in new window

0
I have created a custom widget with fields from advanced custom fields. I just wanted to check that the code is okay or if it could be improved upon (I am sure it can be). I placed this in my functions.php file but don't think it belongs there either. Where would be a better place to put it?

class ACF_Custom_Widget extends WP_Widget {

    /**
    * Register widget with WordPress.
    */
    function __construct() {
        parent::__construct(
            'fair_deal_widget', // Base ID
            __('Fair Deal Widget', 'text_domain'), // Name
            array( 'description' => __( 'A fair deal widget', 'text_domain' ), 'classname' => 'fair-deal-widget' ) // Args
        );
    }

    /**
    * Front-end display of widget.
    *
    * @see WP_Widget::widget()
    *
    * @param array $args     Widget arguments.
    * @param array $instance Saved values from database.
    */
    public function widget( $args, $instance ) {
      // outputs the content of the widget
      if ( ! isset( $args['widget_id'] ) ) {
        $args['widget_id'] = $this->id;
      }
        
        $widget_id = 'widget_' . $args['widget_id'];

        $bgImage = get_field('background_image', $widget_id);
        $profilePic = get_field('profile_pic', $widget_id);
        $name = get_field('name', $widget_id);
        $description = get_field('description', $widget_id);
        $cta = get_field('call_to_action', $widget_id);
        $contactNum = get_field('contact_number', $widget_id);


   

Open in new window

0
I am needing to change the search url after I change the permalink assigned to my products.

I have a permalink situation on my products when I fix the permalink change.  The free version of wordpress search still shows the old url even purging the cache.  By the way, I have changed settings -> permalinks saved it and then put it back to my normal settings and saved it again.  All the while purging the cache.

Here is a screenshot

screenshot of all of the slugs for Skeletal Strength if you look at the last product in the slug I took away the "-8" hoping it would default to the correct slug.  However it still faults to the old content id 3276?.  I thought the normal url was supposed to default to the non appended -[number] option?

FYI I have to have separate sku's for each offer with the vendor I am using thus the reason for the numerous slugs being appended with various numbers.

If you want to look at the one of the products in question it is at
https://www.theherbsplace.com/product/skeletal-strength-p-535-8/

I have several products that have appended -numbers on their slug which is causing the search engine to bring up other product slugs instead of the product that is in stock and available for sale.
0
I am unable to use the featured image. My site is running WordPress 5.1.1. I have tried to use the “image” as shown in the attached screenshot, but I cannot find a featured image control. Please help.Post without Featured Image
0
Exploring SharePoint 2016
LVL 13
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

I thought this would be super easy to do but I can't seem to find an easy way.

When I go to my blog page I want to list all the categories available in a custom layout, so I don't want to use a widget.

I did this:

    <?php wp_list_categories( array(
        'orderby' => 'name'
    ) ); ?> 

Open in new window


But the formatting is awful.

Then I tried this:

    <?php $cats = get_categories(); ?>
    <div class="blog">
        <a href="#" class="button blog-category">show all</a>
        <?php foreach($cats as $cat): ?>
        <a href="<?php echo site_url() . '/category/' . $cat->slug; ?>" class="button blog-category"><?php echo $cat->name; ?></a>
        <?php endforeach; ?>
    </div>

Open in new window


But not sure that href is ideal. And the other problem is that I want the category I am on to add an active class to the nav item.
0
Here's a screenshot of what I'm seeing on my Dashboard when I'm looking at a photo gallery using the "Responsive Photo Gallery Pro" plugin...

screenshot
Every thumbnail, every image is flawed because of the path looking for a folder called "georgia." That was the default folder on the old server. I've since migrated the site to a new server and "georgia" doesn't exist.

But...

The migration has been a total success with every other setting that I've seen thus far and every reference to "georgia" seems to have been eradicated from the database. Still, there's this reference to the "georgia" directory and I don't know where to go to change it.

I'm thinking there's a setting somewhere, but I've run out of ideas.

Any thoughts?
0
I need a sort that uses the parent id which is called jk_sku.  I am on 5.1.1 WordPress and 3.5.7 for WooCommerce.  I only need this as an option for sort.  So following two articles on the net.  I put together this code

function jk_add_custom_sku() {
$args = array(
'label' => __( 'Parent ID', 'woocommerce' ),
'placeholder' => __( 'Enter custom SKU here', 'woocommerce' ),
'id' => 'jk_sku',
'desc_tip' => true,
'description' => __( 'This SKU is for internal use only.', 'woocommerce' ),
);
woocommerce_wp_text_input( $args );
}
add_action( "woocommerce_product_options_sku", "jk_add_custom_sku" );

function jk_save_custom_sku( $post_id ) {
// grab the custom SKU from $_POST
$custom_sku = isset( $_POST[ 'jk_sku' ] ) ? sanitize_text_field( $_POST[ 'jk_sku' ] ) : '';

// grab the product
$product = wc_get_product( $post_id );

// save the custom SKU using WooCommerce built-in functions
$product->update_meta_data( 'jk_sku', $custom_sku );
$product->save();
}

add_action( "woocommerce_process_product_meta", "jk_save_custom_sku" );
//add_action( "save_post_product", "jk_save_custom_sku" );

####### Custom Sort Option ######################

// 1. Create new product filter
 
add_filter( 'woocommerce_get_catalog_ordering_args', 'bbloomer_sort_by_name_woocommerce_shop' );
 
function bbloomer_sort_by_name_woocommerce_shop( $args ) {
     
    $orderby_value = isset( $_GET['orderby'] ) ? wc_clean( (string) wp_unslash( $_GET['orderby'] ) ) : wc_clean( get_query_var( 'orderby' ) );
   

Open in new window

0
Hello,

i am trying to write an wordpress user search with multiple types of meta_query includes, some AND, some OR, but I am finding that they just replace each other

So in plain english, my default search search through first name, last name and description of a user, this works fine. But I also have a custom field for each user member_search_visibility, which tells me if they users wish to be found in search results, so if I add is as below, if ignores that names and only searches member_search_visibility (last few lines of code)

So how can i make my search go through all name data AND only display users who member_search_visibility is equal to yes

$args = array (
    //'role'       => 'reporter',
    'order'      => 'ASC',
    'orderby'    => 'display_name',
    //'search'     => '*' . esc_attr( $default_fields ) . '*',
    'meta_query' => array(
        'relation' => 'OR',
        array(
            'key'     => 'first_name',
            'value'   => $default_fields,
            'compare' => 'LIKE'
        ),
        array(
            'key'     => 'last_name',
            'value'   => $default_fields,
            'compare' => 'LIKE'
        ),
        array(
            'key'     => 'description',
            'value'   => $default_fields ,
            'compare' => 'LIKE'
        )
    ),
	'meta_query' => array(
        'relation' => 'AND',
        array(
            'key'     => 'member_search_visibility',
            'value'   => "yes" ,
            

Open in new window

0
Hello,

I am trying to build a custom Wordpress use search, it is displaying  every user and ignoring my search criteria

Search form  ( LINK: http://oalaca.nextmp.net/member-search/ )
<form role="search" method="get" class="search-form" action="http://oalaca.nextmp.net/member-search-results/">
	<label>
		<input type="search" class="search-field" placeholder="" value="" name="main_fields" title="">
	</label>
	<input type="submit" class="search-submit" value="Search Users">
</form>

Open in new window


Search results

        <?php 
	
	function myplugin_register_query_vars( $vars ) {
    $vars[] = 'main_fields';
    $vars[] = 'default_fields';
    return $vars;
}
add_filter( 'query_vars', 'myplugin_register_query_vars' );
	
	
	$default_fields = $_POST['main_fields'];
		
		
		// WP_User_Query arguments
$args = array (
 
    'order'      => 'ASC',
    'orderby'    => 'display_name',
    'search'     => '*' . esc_attr( $default_fields ) . '*',
    'meta_query' => array(
        'relation' => 'OR',
        array(
            'key'     => 'first_name',
            'value'   => $default_fields,
            'compare' => 'LIKE'
        ),
        array(
            'key'     => 'last_name',
            'value'   => $default_fields,
            'compare' => 'LIKE'
        ),
        array(
            'key'     => 'description',
            'value'   => $default_fields ,
            'compare' => 'LIKE'
        )
    )
);

// Create the WP_User_Query object
$wp_user_query = new

Open in new window

0
Head out to this page: https://www.studweldfast.com/arc-weld-embed-plates/

I'm in the final stages of migrating this site to a different server. Everything seems to be working, but I've run into a problem with the gallery that you see on this page in that the images don't show up.

The problem rests in the path of the images. Here's an example:

 <img src="http://www.studweldfast.com/georgia/wp-content/uploads/2015/08/20150525_161041-400x400.jpg" class="gall-img-responsive" alt="Embed Plates">

Notice the presence of "georgia" in the URL. That directory doesn't exist. When you remove "georgia" from the URL, everything works fine.

I've done a "search / replace" in the database so "georgia" shouldn't be a problem anymore, but I'm still missing something.

This is all a part of the "Responsive Photo Gallery Pro" plugin, by the way. Not sure if that makes any difference...

Is it a config setting that I'm missing? I can't figure out where that path is coming from and I've got to get rid of the "georgia" aspect.

Any ideas?
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.