All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

Custom post type's posts are not showing anywere but in xml sitemap

I don't use any cache plugin. Custom post type's posts are only showing in xml sitemap but not showing in other places on the site, until I "open each new post url manually" or "use a third-party ...
0
votes
0answers
77 views

Why does echo on functions.php not yield result in source code?

I follow the tutorial in How to Add Facebook Open Graph Meta Data in WordPress Themes and add some echo code in functions.php both in the main theme and child theme. However, when I check the source ...
0
votes
1answer
31 views

Dequeue Scripts and Style for Mobile not working?

I've followed a few tutorials on Dequeueing and Deregistering scripts and styles for WP - trying to optimise my site speed. Initially I could dequeue and deregister, until I added a condition for ...
2
votes
1answer
37 views

Can I change a variable in a content part while calling it?

I am using a content part for title sections on various sites. I would still like to be able to change the title manually on each page. For this particular case I can‘t use dynamic functions like ...
0
votes
0answers
20 views

Problem with multi checkboxes value in metabox?

I'm a beginner and I have a problem with a part of the script that I found in a post. Practically when printing the checkboxes it does it outside the table. I can't bring the content of the foreach ...
1
vote
2answers
40 views

Add dynamic links in WordPress custom theme

I want to implement a system to insert custom links in my wordpress custom theme. I don't want to hardcode these links inside my theme. These links are for the socials or partners website. So they ...
0
votes
0answers
26 views

Is it possible to remove original src from wp_calculate_image_srcset() results?

Was just wondering how one could load a custom srcset stack. I know the srcset loads all registered sizes so I'm good on that side but I cannot find a way to remove the original src from there without ...
0
votes
1answer
174 views

Woocommerce singe product custom gallery output works just on the first slide

I copied the "product-image.php" to my theme folder in order to change the HTML output a bit, so instead of using wc_get_gallery_image_html I created my function and changed the output there. Here's ...
0
votes
0answers
60 views

How to offset main query without affecting other queries and backend

I'm trying to offset my main blog query by 3 posts whilst trying to get the pagination to function correctly. I've been following the codex reference here but I'm struggling to get it working as I ...
1
vote
1answer
19 views

How to display the link (title) and thumbnail post?

I found this related post code here, but the code calling it is incomplete, it only shows the article title. How do I make the links and thumbnails appear? I really hope someone helps, because this ...
1
vote
2answers
57 views

How to use thumbnails in gallery?

Since Wordpress 5.x they've removed the thumbnail size option for galleries. Is there a way to activate or build a workaround? I like to build up a classic Lightbox gallery.
0
votes
2answers
75 views

ACF not showing

I have a (weird) issue - can't get the ACF field to work on my page. I have a simple text_field and it shows on the Homepage page section: ACF settings: Homepage settings (when I refresh the panel ...
1
vote
1answer
12 views

WordPress menu link doesn't work properly

I am developing custom site. The header links work on home-page but when I go inside shop then the home-link becomes siteurl/shop how to solve this? <div id="content" class="site-content"> &...
0
votes
0answers
67 views

How to enqueue reactjs built theme to index.php to build wordpress theme

I am trying to make a wordpress theme using create-react-app package. But the problem is i have no idea how to put these files in wordpress directory to render it on index.php or how to enqueue these ...
0
votes
1answer
223 views

Trigger popup in a php if/else statement

I am trying to trigger a popup within functions.php if certain conditions are met. The if else statement it self works perfectly, but I can't get the popup to open. I've tried calling a shortcode but ...
0
votes
0answers
51 views

Menu to the right of screen on desktop using Bootstrap 4

I'm fairly new to WordPress development and would love to learn as much as possible. I am building a theme from scratch and using the wp-bootstrap-navwalker (https://github.com/wp-bootstrap/wp-...
0
votes
0answers
28 views

Add meta data in head from theme

I want to add a meta data in the head of my website. I have a post type with custom template : single-custom.php In this template, I want to add this meta : <meta name="robots" content="noindex"&...
0
votes
2answers
243 views

Control the srcset much more (not all sizes in it each time)

I'd like to be have more control on the srcset on certain important images of my website if not all. By default the srcset includes all the sizes created by wordpress for all the images. I'd like to ...
0
votes
1answer
99 views

what is `get_section()` and how to use it?

i saw get_section() being used in WordPress. what is this function and how can i utilize it for theme development?
0
votes
2answers
34 views

What is the fastest way to load PHP functions that are only used in one theme template?

I've developed a lot of PHP code snippets for my website, and I'm not sure where would be the best place to put them in order to reduce site loading times. If they go in functions.php or in a ...
0
votes
1answer
54 views

Create dynamic logo carousel without using any plugin

I am converting an html template to a WordPress theme. In the WordPress theme development process I'm stuck at dynamic logo carousel. Can anyone tell me how to create a logo carousel dynamically ...
1
vote
1answer
235 views

Search filter by Post title OR Meta Title Value [duplicate]

I am trying to search Movies by it's Post title OR Meta Title value. But it is not working, it only search's by Meta value. I need to search by Post title as well and i.e check if the keyword is ...
3
votes
1answer
120 views

Overriding core functions in child theme

Is it good practice to use children functions.php to override parent core functions? Example in Storefront theme : Core function if ( ! function_exists( 'storefront_primary_navigation_wrapper' ) ) {...
2
votes
0answers
21 views

Best Practice for Syncing Local Development With Staging Development [closed]

My team and I focus on custom functionality locally using MAMP on a few Wordpress projects while our graphics guy who works on the styling, typography and layout settings works on the staging ...
0
votes
1answer
41 views

How to wrap image tag into div for post only?

I have created a function it wraps all image tag inside a div, but I want to apply it only for the post but my function wraps the page images inside a div also. // Wrap img into div function ...
1
vote
1answer
42 views

Error in custom php function doesn't exist

I was able to successfully set the default page template for a new page, when there is not yet a defined template to be member_home_page.php. This works perfectly on my local environment but when I ...
2
votes
1answer
143 views

Is the regular ajax request method safe or I should use admin-ajax.php?

On the homepage I have some links: <a class="link" data-id="1">first link</a> <a class="link" data-id="2">second link</a> <a class="link" data-id="3">third link</a>...
8
votes
1answer
464 views

Display random categories on the front page (Finding and Editing Theme Functions)

I'm Currently in the alpha stages of editing a child theme for a Wordpress theme. I do have programing experience and some experience managing wordpress but no direct experience editing wordpress ...
3
votes
2answers
932 views

TinyMCE custom styles remove class when switching styles

I have added some custom styles to the TinyMCE editor using the tiny_mce_before_init filter hook. They work by adding classes to the block-level element. See the code below: function ...
0
votes
1answer
16 views

How to insert class in each list of categories?

<ul class="list-inline"> <li class="list-inline-item">Category 1</li> <li class="list-inline-item">Category 2</li> <li class="list-inline-item">Category 3</...
0
votes
1answer
350 views

Global page ID variable empty error

I am creating theme and I have a need to create global variables within theme functions.php file. Currently I am doing it like this: /** * Setup globals */ global $nb_id, $nb_page; $nb_id = ...
0
votes
2answers
2k views

How to add css class to image attached in all the posts?

Currently by default image have similar classes <img class="size-full wp-image-8996" src="https://nepaltimes.net/wp-content/uploads/2018/04/31043884_1792179470828697_8330507756888915968_n.jpg"> ...
2
votes
2answers
546 views

Return only top-level navigation items from a menu using wp_get_nav_menu_items

I have the following function in my project: function cr_get_menu_items($menu_location) { $locations = get_nav_menu_locations(); $menu = get_term($locations[$menu_location], 'nav_menu'); ...
0
votes
1answer
31 views

Check if the image size is available and if not use 'full' image size

I have added an image size with code add_image_size( 'medium_post_thumbnails', 87, 63, true); By default WordPress has full/original image size. I have a function where I use above image size '...
0
votes
1answer
57 views

Way to store featured image width and height in two separate variables?

i have added a function like this to generate custom image size add_action( 'after_setup_theme', 'slider_image'); function slider_image(){ add_image_size( 'slide_image', 540, 405); } ...
1
vote
1answer
39 views

Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]

I am trying to get a function to get three posts and print/echo 1st post with class active and rest of the post will be Normal. I tried this code in functions.php to generate and didn't achieve the ...
1
vote
2answers
26 views

My Own layout in WooCommerce pages [closed]

I have static template made from PSD to HTML. Now I am implementing it in WordPress. It's not fully E-Commerce site. So I need to create single product page category page and shop page individually. I ...
1
vote
1answer
23 views

What's the difference between same wp functions get_posts(); functions in different form?

get_posts('post_type=post&numberposts=-1') and the get_posts( array( 'post_type' => 'post', 'posts_per_page' => -1 ) ); Are they the same?
0
votes
2answers
373 views

I can't add CSS with functions.php [SOLVED]

I'm relatively new to creating a theme with WordPress, and I've been adding all the stylesheets (main and for each page) with the old echo get_stylesheet_uri();. But I find out that this isn't the ...
0
votes
1answer
780 views

How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]

I've searched the web for help on this, I found similar questions, but not exactly what I'm looking for. Hopefully someone can help. The following code is in my theme's archive.php file: <header ...
0
votes
1answer
1k views

Remove External Links from WordPress posts Using add_filter() in Theme functions.php

We have been searching high an low for a plugin, code sample or example of how to remove all external links at the theme filter level but can't seem to find anything online. We want to keep the ...
1
vote
0answers
536 views

how can I edit flexslider in woocommerce. [Urgent]

Can anyone please tell me how I can edit flexslider settings in woocommerce. I am actually trying to get this result. http://flexslider.woothemes.com/thumbnail-slider.html someone please help me ...
2
votes
1answer
211 views

Add external js file to footer with id

I know how to add custom/external js but i dont know how to pass js id also. i am using it as: wp_register_script( 'validation', 'https://www.asd.in/script.php?id=3ff00a469474bbe71a9218a7f0377518', ...
2
votes
2answers
1k views

Change parent theme file function in child themes functions.php

im trying to understand how Action Hooks and Filters work and have this example i want to edit This function is in a parent theme framework php file: public function formatArticleCat01( $...
0
votes
1answer
16 views

Theme editing “post thumbnail” help

Is it possible to change the following code to display the "featured image" of a post/page using the style "background-image" instead of the image at the URL that is being pulled. I have messed around ...
3
votes
1answer
83 views

Organize functions.php

What's the best way to organize functions.php for performance? I have a couple of add_action calls, few more add_theme_support and couple of add_filter and 4 additional functions. For breadcrumbs, ...
0
votes
1answer
50 views

How to retrieve image IDs from shortcode content?

I like my clients to simply throw their images into the WordPress editor while the script of my custom theme handles everything else. Be it a gallery, a carousel or whatever. So instead of using ...
0
votes
1answer
41 views

Design view breaking on Pages

For my client site,when i try to create new page and publish the design view was breaking but the blog post view showing properly, the site uses custom WordPress theme developed by the previous ...
1
vote
0answers
699 views

admin-ajax.php + load-scripts.php hanging for minutes

My issue is that when I do a simple Admin Dashboard change, like updating a post or page, I sometimes wait up to 10 minutes for the request to finish. I have tried restarting the process and my ...
0
votes
2answers
147 views

HowTo: Add wrapper to columns shortcode?

I have a simple columns shortcode. (How) can this be adjusted to output a containing div around multiple columns? Really don't want to nest shortcodes in the frontend. Perhaps some kind of filter? ...