wordpress-theming

Wordpress array to show post from certain category and show post excerpt and feature ing

十年热恋 提交于 2019-12-02 13:36:13
Hi all looking for a Wordpress help. I need to place a simple query/array to display posts from a certain cat e.g "News' that will include the posts featured image. Can anyone please help? Gary Try this <?php $query = new WP_Query('category_name=News&posts_per_page=4'); if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); if (has_post_thumbnail()) { ?> <a href="<?php the_permalink(' ') ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(); ?></a> <?php } ?> <h2><a href="<?php the_permalink(' ') ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <

Dynamically change Wordpress Theme

Deadly 提交于 2019-12-02 12:56:50
How can I set an a tag to dynamically change the theme currently being displayed by wordpress? I understand the switch function as described in a similar question here: Display page content using multiple templates - WordPress , but I don't know how to implement the change. Should the switch be added to index.php inside a theme, or inside the theme folder? Does my link point to the index.php file? I would like to do this without a plugin if possible. An example of a site which does this already: www.envye.com/wordpress/ Thank you! Use this in function.php function fxn_change_theme($theme) { if

Using wp_mail() instead of mail() in Wordpress does not work

吃可爱长大的小学妹 提交于 2019-12-02 11:43:25
问题 Since PHP mail has been disabled on my server it has stopped a theme integrated contact form from working. The theme is called Boldy and it has its own sendmail.php file which uses mail() instead of wp_mail() . Changing mail() to wp_mail() does not work, but I'm not sure why? <?php if (isset($_POST['submit'])) { error_reporting(E_NOTICE); function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } if ($

Finding custom-header.php in file manage on Wordpress Penscratch theme

倾然丶 夕夏残阳落幕 提交于 2019-12-02 11:28:28
My website is www.rosstheexplorer.com. I use Wordpress. I use the Penscratch theme. I have never consciously tweaked / altered file manager. I made a change to the custom-header.php and that change has caused me to be unable to load my site. My webhost (Bluehost) said they could restore the file on file manager if I could tell them the directory for the file. I have no idea what the directory is. I have always accessed the PHP files through Customise -> Appearance -> Editor. Now I can no longer access Editor or Dashboard, my error has resulted in me being blocked from my site. Can someone who

PHP Script Not Running in WordPress Correctly

假装没事ソ 提交于 2019-12-02 10:17:06
I recently converted http://usborrow.pizzli.com/apply to a WordPress Page Template for a site. Every other page came out fine, but when I go to http://usborrow.pizzli.com/?page_id=6 , the page seems to lose all of its styling. Any support would be appreciated. Apparently there's an issue with the relative URL reference. Rather than referencing to the stylesheet with <link href="../css/style.css" rel="stylesheet" type="text/css" /> Try absolute path instead <link href="/css/style.css" rel="stylesheet" type="text/css" /> This should work on all pages, assuming that you store the stylesheet file

jQuery selectmenu wordpress

蹲街弑〆低调 提交于 2019-12-02 09:28:10
I am moving a site from normal php to wordpress and currently they use jquery-selectmenu plugin for their select menus. I have tried to enqueu the script in wordpress head with no luck. The scripts from the previous site look as follows. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> <link rel="stylesheet" href="<?php echo $siteurl; ?>css/custom-theme/jquery-ui-1.8.1.custom.css" type="text/css" /> <script type="text/javascript" src="<?php echo $siteurl; ?>js/select-menu.js"></script> <script type="text/javascript" src="<?php

Change number of posts on consecutive category pages (Wordpress)

廉价感情. 提交于 2019-12-02 07:55:46
问题 I am trying change the number of posts that are displayed on a category pages to change on consecutive pages (page 2, 3, etc). So page one displays 7 posts, but pages 2, 3 and 4, etc of that category display only 6 posts per page (i.e. when you click 'next page' to list the older posts). I am aware that it is relatively straightforward to change the number of posts for different categories / archive pages - but this is different, as I would like the paginated pages to have different numbers

Is there a way to get a category's name in lowercase?

﹥>﹥吖頭↗ 提交于 2019-12-02 07:46:29
问题 I am setting up a Wordpress theme and I'm integrating a facebook "Like" button into each of the categories. I need a way of getting the current page URL in lowercase so I can have several like buttons for all the categories while each having different url links. Currently, when I use <?php get_permalink( ); ?> or <?php the_permalink( ); ?> in the category template, it outputs the URL plus the permalink of the first post, which isn't what I want currently. I've tried using but it outputs the

Using wp_mail() instead of mail() in Wordpress does not work

前提是你 提交于 2019-12-02 06:05:15
Since PHP mail has been disabled on my server it has stopped a theme integrated contact form from working. The theme is called Boldy and it has its own sendmail.php file which uses mail() instead of wp_mail() . Changing mail() to wp_mail() does not work, but I'm not sure why? <?php if (isset($_POST['submit'])) { error_reporting(E_NOTICE); function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } if ($_POST['name'] != '' && $_POST['email'] != '' && valid_email($_POST['email']) == TRUE && strlen($_POST[

Is there a way to get a category's name in lowercase?

无人久伴 提交于 2019-12-02 04:29:28
I am setting up a Wordpress theme and I'm integrating a facebook "Like" button into each of the categories. I need a way of getting the current page URL in lowercase so I can have several like buttons for all the categories while each having different url links. Currently, when I use <?php get_permalink( ); ?> or <?php the_permalink( ); ?> in the category template, it outputs the URL plus the permalink of the first post, which isn't what I want currently. I've tried using but it outputs the title with the first letter Capped. I need the category name in lowercase for the URL to be valid in