Articles of php

How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)

I’ve created my own theme based on a very lean template. My theme is not parsing the markup to the correct html. It’s just showing the text without any markup around it. Here are the relevant observations for my situation: When editing the post it shows in “Text” mode, and a nice image with caption […]

Insert After Second Paragraph Without <P> Tag?

I use a code like the one shown below to insert ads after the first paragraph. The problem is that this code requires the content to be displayed within paragraph tags and I would like to use this code to insert a DIV. When I simply replace the tags with div tags the code no […]

Word Count Function Preventing Permalink Editing

This code counts the number of words in an excerpt and adds it to the excerpt meta box in the post edit screen: However, something about this code is preventing the editing of permalinks in the post edit screen and I am unable to identify the problem. Any ideas?

How to access function from outside of a class within this class in WP plugin?

I am developing a WP plugin called e.g. DD_Awesome_Plugin and this is my code so far (simplified version without additional code logic within class functions): class DD_Awesome_PLugin { public function __construct() { } public function add_menu_page() { add_options_page(‘DD Awesome PLugin’, ‘DD Awesome PLugin’, ‘administrator’, __FILE__, array(‘DD_Awesome_PLugin’, ‘display_options_page’)); } public function display_options_page() { $plugin_options = get_option(‘dd_my_awesome_plugin’); […]

How do I access the media settings

I have been trying to find a way to access the the maximum width of a large image as set on the media settings page? In my theme I am grabbing images from a server and have the ability to specify the size when I grab them. I want to grab the image with the […]

Row actions not showing? Why?

I have constructed a WP_List_Table that displays on a custom theme page that I have built. I am having some trouble getting the row actions to display, despite me reviewing all the possible info on the Internet about WP_List_Table. Any help would be great! class Testimonials_List_Table extends WP_List_Table { function __construct() { parent::__construct( array( ‘singular’=> […]

Why is this Ajax not working?

I’m not sure if I am abusing WordPress and Ajax by doing it this way but WP and Ajax Codex a well as Plugin Development with Ajax do not seem to be very helpful. I have created the following Ajax situation: (function($){ $(document).ready(function(){ $(‘a’).click(function(e){ var el = $(this).prev(‘input[type=”checkbox”]’); if(‘:checked’)){ el.prop(‘checked’,false); } $.ajax({ url : “<?php […]

WordPress Player Profiles + PHP

I’m totally new to website programming.. I am making a website for my Counter Strike Server. I want people to be able to create profiles. And these profiles have to display custom stats from their game performance.. the stats come from a mysql data base. Possible? Should i use phpbb?

Facebook “like” open graph meta in header.php

I would like to add open graph meta tags to my header.php, but can someone explain how this works if header.php comes before my loop with the relevant information?? <meta property=”og:title” content=”The Rock”/> <meta property=”og:type” content=”movie”/> <meta property=”og:url” content=””/> <meta property=”og:image” content=””/> <meta property=”og:site_name” content=”IMDb”/> <meta property=”fb:admins” content=”USER_ID”/> <meta property=”og:description” content=”A group of U.S. Marines, […]

Displaying custom post type on front page

I added a new custom post type to my WordPress theme but it refuses to show on the homepage. I tried setting <?php query_posts( array( ‘post_type’ => array(‘post’, ‘reviews’) ) );?> but it doesn’t seem to work, it just loops my normal posts. Any suggestions would be greatly helpful. Here’s a pastie of my index […]