Browsing category WordPress

Get current page url in WordPress


Getting current page URL in WordPress isn’t that easy for starters. Most of the people use $_SERVER variable to get URL. I tried following one to get current URL to redirect it after login or logout. $current_page_url = $_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”]; The problem with this code was that it wasn’t giving me queried object information

Get custom fields for pages


To get values of custom fields from a post we use get_post_meta() but it doesn’t work for pages. get_metadata function has to be used for that purpose. It will bring custom fields meta data for pages. I used it to get some demo urls for anchors from specific page using this function. Screenshot is given below.

Remove Category or Tag Slug from url


A client asked me in ThemeForest comments that how to remove category slug in URL of WordPress blog installation. I researched a bit and found a very helpful article on http://premium.wpmudev.org/. I am writing short version below. My client tried some plugins, but none of those worked for him and myself so do not waste your time on plugins

Skipping post formats from query


If I do not want to show some post formats in any type of listing using custom query then this code is very helpful. $myposts = new WP_Query( array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array( ‘post-format-aside’, ‘post-format-audio’, ‘post-format-chat’, ‘post-format-gallery’, ‘post-format-image’, ‘post-format-link’, ‘post-format-quote’, ‘post-format-status’, ‘post-format-video’ ), ‘operator’ => ‘NOT

@Asad_Umar یہ ملک خباستدانوں سے بھرا پڑا ہے۔ مجھے اُمیدہے آپ کی پارٹی کچھ اصل سیاستدان اس ملک کودےسکےگی جومحمدعلی جناح سے مجت کرنیوالے ہوں۔

Ways to Lazy Load Images to Speed Up Your WordPress Site https://t.co/hUfKWM0P2x

@Asad_Umar بے شک

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Categories