WordPress custom supports for custom post types

I’m just using register_post_type to generate my new post type ‘gcg_block’ and generate the ui menu in the admin page. Using add_post_type_support for ‘author’ gives me the column Author in my page (although not sortable). I want to add a column ‘Shortcode’ to this list and fill it with custom data. I believe I want … Read more

What does arg mean in WordPress

It is just the naming convention which increases code readability. you can replace it with any name it won’t affect your code. Example I: Example II: Both the code example I and II will have same output, but first example has a good user readability and if you have a long method/code then after seeing … Read more

WordPress – Check if user is logged in

I am fairly new to WordPress. On my homepage I have a navigation bar which I only want to show to people who are logged in as users. In my header.php the function is_logged_in doesn’t seem to work. I want to place a condition in my header.php file to check if the user has logged … Read more

WordPress thumbnail cropping not working

I’ve added the following code to my theme’s functions.php file: Within my template I have code such as: And this is the image it outputs: The original size of the image is 2440px x 1440px so I don’t understand why it’s not respecting my height category. It’s a brand new image that’s been uploaded, but … Read more

Creating a custom rebrandly link using a wordpress shortcode

I am trying to create a rebrandly short link using a WordPress shortcode. Here’s what I have so far: Following the directions for PHP here – https://developers.rebrandly.com/docs The shortcode I’m testing is [shortlink]https://example.com[/shortlink] but its not working. When I change the part: $post_data[“destination”] = $content; to $post_data[“destination”] = “http://example.com”; it works. I must be putting … Read more