Questions tagged [single]

The single post template. Used when a single post is queried.

Filter by
Sorted by
Tagged with
0 votes
0 answers
165 views

Modify post template on Divi Theme

I'm using the Divi Theme on my site and i want to add some code on the posts template. I know i'm supossed to modify the single.php file, but anything i do on the file doesn't work. I even tried to ...
Draws Ren Gundam's user avatar
0 votes
1 answer
147 views

404 error on published page with specific permalink

I am experiencing a strange error with my Wordpress install. I've got a dozen of pages, %postname% permalink structure, everything works fine. For one of the published pages, I reverted it to draft ...
Denis's user avatar
  • 1
0 votes
0 answers
194 views

Single post shows post three times

Not sure exactly what happened, but my site shows the single post content multiple times. Example. Reinstalling the theme didn't help. Also, it's not happening with any other theme, only with the ...
Alin's user avatar
  • 1
0 votes
1 answer
27 views

Defined function isn't showed on page

I've defined a function in function.php and then I tried to call it but it's not visible when I call it. This is the function function social_sharing_buttons($content) { global $post; if(!...
S.I.'s user avatar
  • 125
0 votes
1 answer
1k views

How to display different blocks for mobile and desktops

I want to display a fixed banner from the bottom left of the screen. But at the same time, the banner is different for desktops and mobile devices. Please tell me. How can I determine the user's ...
Alex Gromov's user avatar
0 votes
0 answers
429 views

Using AJAX on frontend: Synchronous XMLHttpRequest deprecation except for admin role

Everything is happening in single.php. I have to validate if user has subscribed to the webinar and show login button accordingly. It's on the frontend. I'm doing this on document ready: <?php if(...
Azamat's user avatar
  • 362
0 votes
1 answer
266 views

two col layout bootstrap 4 with one fixed col and fade in effect on image

I've created a layout for my single post that have a fixed column and another that contains images that has the vertical scroll. I'm using viewportchecker to check if the images are inside the ...
ZWPDev's user avatar
  • 96
0 votes
3 answers
2k views

Post Template Query with WP_Query?

I've seen this solution for querying pages based off of template type: Page template query with WP_Query I'm having trouble getting it to work with posts, that are using a "Single Post Template:" ...
roscoe ferguson's user avatar
1 vote
1 answer
606 views

previous/next_post_link in the same sub-category?

As the title: is there a way to navigate between posts of the same subcategory using the previous_post_link and next_post_link functions? But maintaining however both the category and the sub-category ...
claudio's user avatar
  • 111
0 votes
1 answer
606 views

How to backup single post in wordpress [closed]

Please Advice me. I wanted to backup single post with data and media file. But not link with original post.
Agshai's user avatar
  • 1
0 votes
1 answer
34 views

How do I find a way to create a global single.php for a custom post type?

I am working on making a custom post type plugin for my website. However, I want to make it universal for any theme I may decide to change. Or to be able to append the post type to a single post file ...
xensor's user avatar
  • 1
1 vote
1 answer
776 views

How To Pass Current Post Type ID from Single Template To Custom Page Template

Having a Custoom Post Type called movies, I am able to get the current Post ID in my single-movies.php template. Now can you please let me know how I can pass this post ID from the single template to ...
Mona Coder's user avatar
1 vote
1 answer
1k views

Show all posts in sidebar in single.php

Wordpress 4.x Why does the loop.php only show the current post in the sidebar when I view a post in single.php? I have: Post One Post Two Post Three If I view "Post One" (single.php), the sidebar ...
Prestosaurus's user avatar
1 vote
1 answer
67 views

How to check the terms in single custom post type template

I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-...
joe's user avatar
  • 13
-2 votes
1 answer
328 views

How to display <div> before H1 Title

I need display custom block before H1 Title in my posts. Please, tell me. Is there any function or hook to implement this? I cant edit file single.php, because I create different single templates ...
Alex Gromov's user avatar
0 votes
1 answer
213 views

Why custom post redirecting to index page?

i am new learner and trying to build a wordpress themei need your help in theme building ,my problem is that, i created a custom post type name is events and also created a single-events.php template ...
Tahridabbas's user avatar
2 votes
1 answer
35 views

Display only entire most recent post on author page?

Is there a way to display only the most recent post in its entirety on the author web page instead of all the posts? In other words, I would like the author web page to look just like a single post ...
HBCondo's user avatar
  • 153
0 votes
0 answers
316 views

How to make "single post" permalink maintain it's sub-page structure

I have a custom post type called "Classes", and I have multiple sub-pages for my site for each different schools classes page (which loops through said custom post type) I.E http://www....
peter k's user avatar
3 votes
1 answer
538 views

Display Single Attachment Image file size, uploaded date, resolution, file-name etc in Sidebar

Sorry for any wrong details. I am totally new to WordPress development. I am running a photo site. On single attachment page, I want to show the details (i.e upload date, filename, size, resolution) ...
Talha Basharat Ali's user avatar
1 vote
1 answer
872 views

Programmatically rewriting slug through functions.php but returns 404

I wanted to change the slug of a certain post type (in this case, article) into whatever a certain value in its custom field. I went to functions.php and put this code. function na_remove_slug( $...
Bwrites's user avatar
  • 111
0 votes
0 answers
385 views

customize src attribute in woocommerce single product image

I need to add suffix to the end of image file name (in "href" attribute) that show when i click on the woocommerce single product image. *: I'm using Enfold theme and is using magnific popup ...
igr33dy's user avatar
1 vote
1 answer
143 views

Single Template that can be applied only via URL

We want to test different landing pages to display only certain parts of a specific Custom Post Type's content metadata so I need to create templates that are used only when specifically crafted URLs ...
Trisha's user avatar
  • 418
0 votes
0 answers
54 views

Assign for all post of a post type a specific single-post template

I have created for my custom post type computer-hardware a template single-Computer-Hardware.php, with the following header: /* * Template Name: Computer-Hardware Post Template * Template Post ...
Carol.Kar's user avatar
  • 367
0 votes
1 answer
114 views

How to use single.php for creating, reading and editing Custom Posts with ACF

I have a WordPress custom post type product and I am now developing front end forms for creating, reading and editing these posts (I am using ACF). I am trying to use only single-product.php for this ...
Pito Axiu's user avatar
1 vote
1 answer
560 views

How to show the archive / post type description on Single templates

I have a Custom Post Type with an archive description. Both the following functions return said description from the archive-cpt.php template, as expected: the_archive_description() echo ...
poopaloop's user avatar
0 votes
2 answers
394 views

Is it possible to customize the post according to post format in single.php?

First let me know you that I have made a blog before and I have customize it according to the post format but I have customize it on the blog main page i.e. index.php. Now I am making a another blog ...
Owaiz Yusufi's user avatar
1 vote
1 answer
285 views

How to show "teaser" posts on blog / archive pages, otherwise full posts

Forgive me, I'm a PHP noob and writing too much of it makes my eyes glaze over; I'm sure this is a super simple solution and probably a dumb question. I'm working on a custom theme where I want to ...
sugarfiend's user avatar
0 votes
0 answers
955 views

How do I check if a post is password protected?

I am checking to see if a post is password protected and if it is I will display the form, if not the post will be displayed. However after the password has been entered the user is not taken to view ...
Neelam Khan's user avatar
0 votes
0 answers
37 views

I want to signin from first wordpress site to other wordpress website without registration..without using network mode

i have a wordpress website installed (without multisite wordpress network feature) on server so i want to login to other wordpress website with same credentials.. in-details: i want to create a link ...
Amol Sawant's user avatar
0 votes
1 answer
296 views

Add custom field information to source meta data

I try to add information from a custom field into the metadata in the source code. While searching for the solutions I found some. As I am not really an expert I ask you guys. I want to add ...
Martin Schmidt's user avatar
0 votes
1 answer
300 views

Conditional: IF current user has NOT commented on current post (not including post author)

I'm trying to find a way to have a conditional snippet in single.php where //do something happens if the current user has not commented on the current post. I'm hopeless at coding but I'm guessing I ...
Pete's user avatar
  • 998
0 votes
1 answer
76 views

custom post type single page

I have a custom post type called "listing" and am using a template called content-own.php to display all of my listings. In that page I am using: <a href="<?php echo str_replace( home_url(), '',...
jessica mele's user avatar
0 votes
2 answers
917 views

custom post type single post preview for pending status

I have created custom post type and created the post in a front custom form using logged in user and set status 'pending'. Now I want to show my created post preview like the published post. I have ...
Pukhraj Suthar's user avatar
1 vote
1 answer
1k views

How to delete read more span on single post view?

How could I complete delete following line on single post view? <p><span id="more-XXX"></span></p> I need to delete whole span tag. Is there any other option than ...
Trek's user avatar
  • 13
0 votes
1 answer
336 views

Try to showing product file size on product single page

i have new site for freebies so all people can download file direct on my site. I'm using woocommerce to share these file, and now i want to showing file size on my single product page. This my code: ...
Dannie Herdyawan's user avatar
0 votes
1 answer
61 views

How to use a capture from a rewrite rule inside a php file (like single.php)?

My rewrite rule to make a convenient url for deep-linking into podcasts add_filter("rewrite_rules_array", function($rules) { $newRules = array(); $newRules["(.*)/time/([\d|\:]+)s?$"] = '...
kater louis's user avatar
0 votes
1 answer
270 views

Insert sometext after first h3 in content

I try to change something my wordpress page. I'm always writing contect with h3 tag but mutiple like each post 3 times 3h. I want to add some text after first h3 tag. function add_content_after_h3(...
ZgrKARALAR's user avatar
1 vote
3 answers
1k views

Need to display same custom post type on 2 different singles templates

I have a client who wants to display home plans (a custom post type) on their website in 2 differently branded sections, depending on which listing page the post is accessed from. I found this ...
Ray Gulick's user avatar
2 votes
1 answer
275 views

Which action fire in front-end single post only

I need to add an action in the following situation : When it load a single page post in the frontend, before anything is displayed. I looked the 'the_post' action, but it's triggered at several areas, ...
Adam S's user avatar
  • 123
0 votes
1 answer
869 views

display multiple posts and posts content on a single URL

How can i display multiple posts and posts content on a single URL. Like this https://www.recruitment.guru/ssc/ssc-recruitment/ showing posts on single post page. Please suggest a solution.
Jay Kapoor's user avatar
1 vote
1 answer
149 views

Link for Most Recent Post

I am trying to make a comic website that has arrows pointing to First/Previous/Next/Latest on single.php. I've linked the first 3, but I'm struggling in figuring out how to link to Latest. It doesn't ...
Echo Martin's user avatar
0 votes
2 answers
1k views

Display Some text in some specific category not all category

I want to display some texts in specific category in single post based on category in wordpress.. how can i do that for example posts in news category display some text.(not all category) Thank you
Daniel's user avatar
  • 1
0 votes
3 answers
653 views

Can't access private custom posttype single- or archives-page

I have created a custom posttype labeled 'Richards' using a site-specific plugin with the following code. function add_richards_posttype() { $labels = array( 'name' => ...
hans3890's user avatar
0 votes
1 answer
57 views

Not Able To Render Single-CustomPostType.php File

I have CPT and Custom Taxonomy plugin like below function gen_service_tax() { $labels = array( 'name' => 'Service Types', 'singular_name' =&...
JJ BOBO's user avatar
3 votes
1 answer
11k views

the_post_thumbnail() based on the Post ID

This is How a code in single.php looks like → But needed that in homepage so I decided to make code based on the post ID → <?php $fpid = get_theme_mod('kirki_fpid'); ?> (The above is fetching ...
WordCent's user avatar
  • 1,867
2 votes
2 answers
11k views

get_terms parent for current product only

I wish someone can give me a clue. I am actually displaying all product category (product_cat taxonomy) on single page products, displaying also childs regarding the product itself. For instance: ...
jŪlIΞή Webotop's user avatar
0 votes
1 answer
3k views

Creating a Back button on detail post page to go back to blog page with same query strings and page id

So, I would like to have a back button on the single post page that can be dynamic to the point to where it knows where it is in the query and bring me back to the blog page on the right page number ...
user1355485's user avatar
1 vote
1 answer
252 views

global variables in templates

I have defined a global variable in one of my template files page.php. I can access the global variables in my loop. But when the loop displays an individual post in single.php, the variable has no ...
LindaH53's user avatar
0 votes
1 answer
192 views

I'm having a problem viewing the Youtube video

I'm having a problem viewing the Youtube video. In my single-custom I am using: <? Php echo wpautop ($post-> post_content); ?> And when I put the Youtube link he is not showing the video ...
Carlos Stevanato's user avatar
1 vote
1 answer
264 views

Is it possible to create rel="noindex, nofollow" for a single post if contain bad keywords?

I run a project using "Auto Generated Content" plugin, so my site will have tons of content instantly. Some post will contain unwanted and bad keywords, so it will need to be excluded from search ...
Lalabata's user avatar

1
2
3 4 5
9