How to reorder the content of the single post?

try this in functions.php function author_after_content($content) { if ( is_singular(‘post’) ) { $content .= “<p>بقلم : ” . the_author() . “</p>”; } return $content; } add_filter(‘the_content’, ‘author_after_content’, 20);

How to get nav to show current_page_parent class when on regular post (not blog), differentiated by category

I found the correct syntax is: if ( is_single() && in_category ( ‘5’ ) ) { However, I solved the problem using this code: //add category classes to single.php add_filter(‘body_class’,’add_category_to_single’); function add_category_to_single($classes, $class) { if (is_single() ) { global $post; foreach((get_the_category($post->ID)) as $category) { // add category slug to the $classes array $classes[] = $category->category_nicename; … Read more

Integrating WordPress with Your Website

If I understand your needs correctly, you would like to have your /blog page and post items aggregated and driven by WordPress without exposing the user to anything WordPress. To solve the problem with “wordpress” being in the url, you should actually be putting the entire contents of the WordPress install into the website.tld/blog directory. … Read more

Highlight archive link on single.php

As your links are generated by get_archives_link(), this is the place where you have to look. Doing so, by inspecting the source , you will notice that get_archives_link() – itself – doesn’t give you the possibility to add a CSS class to make the highlighting happen. There is of course the filter hook get_archives_link – … Read more

Blog post – single.php url

This is normal. You probably have your Permalinks set to “Post Name”. You can change your Permalinks to “Custom Structure” and put ‘/news’ in there before the post title, so the “Custom Structure” field would look like this: /news/%postname%/ That should do it.

What is wrong with my WP_Query Arguments?

Use this one- ‘category__not_in’ => array( 93, 94, 95 ), instead of- ‘category_not_in’ => 93, Note: The term is category__not_in, not category_not_in. Use 2 underscores after category. Edit: You are using- ‘offset’ => 1 That forces to show posts from 2nd one (skips the first post). So, it’s showing one post less! If you use … Read more

Link from archive-page.php to single-page.php

get_the_permalink() doesn’t echo anything. It just returns a string so that you can further manipulate it. You need the_permalink() instead, which will echo the link. The difference used to be clear in the Codex but now, in the much inferior, “developer” code reference toward which WordPress is migrating it is not so clear.

Single.php category entries not showing right colours

You should be running the first piece of code inside your foreach loop. What you are currently doing is to get all the post terms, get the first term object, then passing the custom field value of that term into your foreach loop for every post term. Your code should look something like this: $post_categories … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)