Articles of php

Child Theme's Read More Text

I’m sitting here trying to figure out how to change the Read More text. I’m currently creating a Child Theme of Oxygen and as far as I can tell, they don’t have a function to easily change it. I want to change the text without copying over the entire index.php file though this is line […]

How to edit wordpress pages through cpanel?

Can you visit http://cmscard.com/?page_id=9 in firefox ? The links are overlapping there. What to do ? If core pages or theme need to be edited, where to find the pages ? The stylesheet is contained in wp-content

How do I show my <p> containing my custom field ONLY if there is a set value on that custom field?

I am using the Custom Fields Plugin and have 2 custom fields assigned to my “products” custom post type. Field 1. Price Field 2 Discount Price So this is my code: <div class=”wrapper”> <p>Price: <?php the_field(‘price’); ?></p> </div> “Now this is what I am trying to achieve hypothetically” <div class=”wrapper”> <?php if (the_field(‘discount’); )is set: […]

WPDB secure custom form

I’m creating a custom form to update rows in a secondary MYSQL DB, different from the one of wordpress. This form is public and every user can access it. So I’ve created a plugin and I’m using also wpdb to connect with the database. How can I do this in a secure way? I’m using […]

Display all meta for a post?

I have a custom meta field for my posts and I’m able to display the value. But it only displays one row. Since I have more than one value I need to display all of them. I know I probably have to do some kind of for or while loop, but I don’t know how […]

preg_replace() No ending delimiter '.' found

I get this error: Warning: preg_replace() [function.preg-replace]: No ending delimiter ‘.’ found in but I can’t figure out why Here is the code: foreach( $content as $item ) { $item = preg_replace( array(‘.’,’ ‘), array(‘-‘,’-‘), strtolower($item)); $replace = ‘<h4 id=”‘.utf8_decode($item).'”>’; $phrase = preg_replace(‘/’.$tag.’/’, $replace, $phrase, 1); } Please also tell my WHY it doesn’t work

Passing PHP Variables to AJAX Loaded Pages

I have a blog that shows 9 blogs posts per page, with each additional page of blog posts automatically added using the Infinite Ajax Scroll plugin. Every time a blog post is successfully queried the $postCount variable increases its count by 1. […] <body> <div class=”posts”> <?php $postCount = 0; if ( have_posts() ) : […]

How to pick “full/thumbnail” images in the loop?

I am picking the latest posts through the WordPress loop using the below code, but it’s picking all images at full size: if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <!– Post Start –> <div id=”post”> <a class=”post_image” href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”> <?php if ( has_post_thumbnail() ): the_post_thumbnail(‘full’); else […]

display specific widget to a page

im trying to display a specific widget i need for the header current im using a code to display all widgets but my problem is that if I add additional widgets it will destroy my site. <?php dynamic_sidebar( ‘sidebar2’ ); ?> <?php else : ?> <!– This content shows up if there are no widgets […]

limit number of post for achive page

Im trying to limit the number of post for my archive page, in a specific category. I’ve manage to display post from just the category I desire, However, if i setup a loop to limit the number of post, it doest work but display post from all time, instead of the specific time . . […]