All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
432 views

How to display Disqus comment count in WordPress?

I'm using Disqus on my site. The theme that I'm using has comment count shown on every post, but it shows only default WordPress comments system count. How can I integrate it with Disqus, so the ...
0
votes
0answers
42 views

Prefix only some posts with a custom prefix

I'm lost in the world of Wordpress rewrites and I'm hoping someone can help... I'm creating two custom members areas from my site; users logged in as certain roles will be able to view certain posts, ...
0
votes
2answers
728 views

How do I add a custom body class to the admin area of a page?

I tried with this code in functions.phpof my website's child theme. add_filter('admin_body_class', 'custom_body_class'); function custom_body_class($classes) { if (is_page(8)) $classes[] =...
-1
votes
1answer
563 views

Hide/show specific products for backend users in woocommerce

i have 5 customers who use the same shop in woocommerce. These 5 customers can enter the backend and see there products (but also the products of each other) in the catalog - I want now to hide ...
0
votes
2answers
5k views

Removing Product from Woocommerce checkout page using Ajax

I have added remove button for products in the checkout page. The code - function add_delete( $product_title, $cart_item, $cart_item_key ) { if ( is_checkout() ) { /* Get Cart of the ...
0
votes
1answer
337 views

Show child taxonomies (that have posts) of the current parent taxonomy

For the life of me I can't see why this isn't working. It works fine like this (normal categories) <?php if (is_category()) { $cur_cat = get_query_var('cat'); if ($cur_cat) { $...
0
votes
1answer
96 views

Wordpress post_content gets deleted in cron after wp_update_post

I'm developing a Wordpress plugin (integrated with WooCommerce) that fetches HTML Content from an API, and add it to a WP Post as post_content into an iframe, this way: kses_remove_filters(); $...
0
votes
1answer
3k views

WooCommerce - Global $product is returning value null

My code is: function sync_on_product_save($new_status, $old_status, $post) { global $post; global $product; if( $old_status != 'publish' && $new_status == '...
2
votes
2answers
295 views

wordpress custom theme import and export options for sample data [closed]

I am Created WordPress custom theme as per Html template. it was worked fine. now I am trying to create custom export/import functionality for my custom created theme. but I don't have found a better ...
0
votes
1answer
30 views

Is admin section completely customizable in terms of styling?

Can we completely customize the WordPress dashboard in terms of appearance and style? I have uploaded the image: Or Wordpress doesn't allow such conversions. I mean the right-hand side part shown ...
1
vote
1answer
1k views

Move WooCommerce product tabs out of the tabs [closed]

I want to have the product tabs out of the tabs section and put them one down the other with no need of having the tabs functionality. I can unset the tabs add_filter( 'woocommerce_product_tabs', '...
0
votes
2answers
28 views

How can php be used to return data from custom fields in a post?

How can php be used to the return data from a custom field in a post? Any help would be greatly appreciated.
-1
votes
1answer
32 views

list / show comments of post author in special page

i have a problem and i need you to save me really. i have many post authors with a lot of comments that every day is submitting. so i want to show comments that has submitted in every post to its post ...
-1
votes
1answer
155 views

Customize comment notification e-mails with HTML

I want to customize the default content of notification e-mails i found the following codes. but i need to use HTML in my own content. would you please make it with HTML? i do not know enough about ...
0
votes
1answer
628 views

WordPress database error Duplicate entry for key 'slug'

I have just migrated to a new host and upgraded my Wordpress to 4.9.8 (from 3.9.x, embarrassing I know, plan to keep it up to date from now on). I also went through the process of replacing plugins ...
1
vote
1answer
2k views

Font Awesome wp_enqueue_style

I have been trying to get the same code I have on my old server to work on my new server. This is the code I have thus far: function enqueue_load_fa() { wp_enqueue_style( 'load-fa', 'https://use....
0
votes
1answer
1k views

ACF Post Object meta-query by title not ID

I'm trying to query a post type (intervention) via a post object field (intervention_country) by the title (of the related custom post type - country). Something like: $wp_query = new WP_Query(); $...
0
votes
1answer
65 views

How to separate categories with commas?

I have this function that displays the specified hierarchy level category of a post. For example <?php display_cat_level(0,true); ?> will display the top/parent category, while <?php ...
1
vote
1answer
50 views

How to get next image with this code from same post?

I want to show images in my single-content.php file. I have almost 20 to 25 images in every post. I want to print them with below code one by one. I have to change one line in code for every image for ...
0
votes
1answer
253 views

I need query_posts() to order results first by a meta value and then by post ID

I've read all the WordPress docs that seem relevant, and I've read lots of posts here and on other sites to find an answer to this, but I still can't find a way to do this. I have a custom post type. ...
0
votes
1answer
195 views

Is there a limit to size of data stored in update_option()?

I've checked out several* questions and WP docs and I have some idea of the answer but am looking for a specific number on the following questions: 1- Is there a limit to the size of data (kb,mb, ect)...
0
votes
1answer
342 views

How to get the_category(', ') with link “title” attribute

In my theme I use <?php echo the_category(', '); ?> to get the categories, separates by comma, with links to them. But those links have no title attribute. Is there any way to get them?
1
vote
1answer
48 views

Admin username and password

I use ceber security plugin which protects my site again malicious attacks etc. I checked today and there were over 20 lock outs. I checked ip addresses and there were no constituencies, they were ...
1
vote
1answer
39 views

Is it possible to edit the styling of the admin panel from within a custom theme?

I'm making a custom theme. I know from reading around that I can make a custom admin theme by creating a plugin, but I would prefer to keep everything contained within just my custom theme. ...
0
votes
1answer
355 views

Problem with get_permalink, to get page content

I want to retrieve the content of a page via ajax. but i have a problem with get_permalink <?php $id = 171; $post = get_post($id); ?> <a class="post-link" rel="" href="<?php ...
0
votes
1answer
103 views

Body class to each level of a hierarchical custom taxonomy

How would this be adapted to apply to specific custom taxonomies? add_filter( 'body_class', 'custom_cat_archiev_class' ); function custom_cat_archiev_class( $classes ) { if ( is_category() ) { ...
0
votes
1answer
28 views

List all taxonomies with their descriptions

I have this snippet below that lists all my categories in linked hierarchical order and their descriptions. I was hoping someone could update it to allow for a specific custom taxonomy instead? ...
0
votes
1answer
19 views

Static page won't identify template

I have two pages, one working correctly and one broken. The first is called Calendar and it has an ID of 34. I created a page template called page-34.php and wrote some custom code, and when I load ...
0
votes
0answers
23 views

Perform javascript when an input in Customizer is selected/focused?

Can't figure out how to perform actions with javascript/jquery when a input is focused/selected in the Customizer under a section. I want to modify the content on the site in the preview when the ...
0
votes
1answer
35 views

How to safely return the HTML?

I have return '<button type="button" class="btn btn-success">Open Now</button>'; If I echo this it will work fine. I am getting an warning like echo is used without escaping. I know ...
0
votes
1answer
152 views

wp_head makes my custom page template not work in Customizer?

I have a weird issue where if I am in the Customizer and visit a page which uses a custom page template I made it doesn't load the site in the preview. But I can see that it loads in the console. I ...
0
votes
1answer
617 views

Remove CSS & JS from <?php wp_head(); ?>

I've been with this problem for a couple of days and the truth is that I can not find a solution. I have added code manually in wp-header.php and now I need to delete these lines that it generates ...
0
votes
1answer
30 views

Have I been hacked - getting new site setup email for 8 localhost wordpress sites

I've just found some emails in my spam folder saying a new wordpress site has been set up on my local server, for 8 already existing wordpress installs. I'm assuming its been hacked but am not 100%. ...
0
votes
1answer
395 views

Auto copy value from specific user meta field to another field

I'm looking for synchronizing specific user meta field with another one. ex: Coping user phone number to woocommerce billing phone. So the admin can only edit one field and the other updates ...
0
votes
1answer
142 views

Wordpress 302 Redirect to Random Product/Post/Page

I'm trying to add the ability to redirect a user to a random product/page/post url similar to example.com/page/random which would redirect to example.com/page/oneofmany. This question is not ...
0
votes
1answer
26 views

Make another copy of a plugin and install it

I'm trying to make another copy of this plugin SyncFields It contains just one file syncfields.php, So I tried to edit it and edit the functions with another name but it didn't work It appeared in the ...
2
votes
1answer
718 views

Filter oembeds tags to modify iframe attributes

By default, when putting another WP url inside a post/page, it oEmbeds it and produces a blockquote and iframe code with the default in the front-end: <iframe class="wp-embedded-content" sandbox="...
4
votes
1answer
934 views

Get the list of enqueued/registered scripts for a specific post?

I am exploring how to build a theme where most of the pages are loaded using the Rest API. I can load the index page and from there make GET requests to get posts json data and after build its content ...
0
votes
1answer
73 views

how to load css and js based on post template

I have created a post having the following template: <?php /* Template Name: Html Code Template Post Type: post, page */ ?> <?php get_header(); ?> <?php get_sidebar(); ?> <div id=...
0
votes
0answers
1k views

Featured image not showing on facebook share

I Guys! I´ve spent the whole morning after this... Some post images are not showing up on facebook if I try to share. But some are. If I go to facebook and try to share: http://www.taiff.com.br/...
0
votes
1answer
437 views

Custom admin plugin read CSV

I've made a plugin in admin, very simple. I just need to read a CSV files, put data into an array. I use this : $csv = array(); if (($file = fopen('my-file.csv', 'r')) === false){ echo '...
1
vote
2answers
672 views

Paginate Pages by only showing 3 pages at most

I'm trying to use Wordpress paginate function to only show 3 pages at most(client wants it this way) so that when you go up a page it shows the current page you're on and the previous and next page: ...
1
vote
1answer
38 views

How to orderby multiple meta fields with another meta query

I have a custom post type ”events” with meta fields ”startdate” and ”enddate”. Archive query already uses meta query to show only upcoming or ongoing events, but in addition I need to order by both ...
0
votes
1answer
324 views

Saving html into postmeta without stripping tags - safe?

I have a product description box, I want to add the HTML from the description as postmeta, for some outside reasons I can't unescape the code coming back out of post meta. Is it safe to just ...
1
vote
4answers
226 views

How can the plugin directory path be returned into <script> </script>?

How can the plugin directory path be returned into <script> </script> instead of hard coding the path? Here is the custom-page.php: <?php get_header(); ?> <script type="text/...
1
vote
0answers
106 views

post meta parameter in post custom-post-type endpoint with restapi

I'm trying to create a new custom post via the native Wordpress REST API POST /wp-json/wp/v2/CUSTOMPOST at the moment I used the wp-rest-api-controller plugin to activate the endpoints the custom ...
0
votes
1answer
525 views

author.php not showing content if Author has no Posts

I am making a custom Genesis theme, and have a custom author.php file that pulls in various custom fields (Using Advanced Custom Fields), and author meta information to the page from the author ...
1
vote
0answers
259 views

Debugging preview not working problem

The link here is ?p=1448&preview=true Which should be redirected to the /index.php If I press that link it goes to: /?p=1429&preview_id=1429&preview_nonce=ddfbdb8ba3&_thumbnail_id=...
0
votes
1answer
9 views

How to get correct value from checked()?

I am trying to create 2 raido buttons as a category custom field, and in function.php I do: $feat = get_term_meta( $tag->term_id, '_feat', true ); <input name="feat" type="radio" value="0" &...
0
votes
0answers
142 views

How to fix Gutenberg with SiteOrigin page builder deleting content when editing

Our company has a custom built theme based on SiteOrigin's Pagebuilder. We've implemented a single-column site with 14 sections and scrollspy navigation. Since Gutenberg got pushed out the editing ...

15 30 50 per page
1
384 385
386
387 388
2128